Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API scoring queue #565

Merged
merged 16 commits into from
Feb 7, 2025
Merged

Add API scoring queue #565

merged 16 commits into from
Feb 7, 2025

Conversation

dbobrenko
Copy link
Collaborator

@dbobrenko dbobrenko commented Feb 5, 2025

Changes

  • Add API scoring queue (FIFO), used to prevent validator DDOS with scoring requests in case of huge API activity.
  • In case of failed scoring request, same response retries to query validator up to 3 times.
  • Add new env variables:
    • SCORING_RATE_LIMIT_SEC, defaults to 0.5: Delay in seconds between scoring requests, applies when queue is not empty or size > SCORING_QUEUE_API_THRESHOLD.
    • SCORING_QUEUE_API_THRESHOLD, defaults to 5: Scoring queue size threshold when rate-limit start to kick in.

@dbobrenko dbobrenko marked this pull request as draft February 5, 2025 11:52
@dbobrenko dbobrenko self-assigned this Feb 6, 2025
@dbobrenko dbobrenko changed the title [WIP] Add scoring queue Add API scoring queue Feb 6, 2025
@dbobrenko dbobrenko marked this pull request as ready for review February 6, 2025 08:24
@dbobrenko dbobrenko merged commit 9703236 into staging Feb 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants