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

feat: rate limiter #1526

Merged
merged 10 commits into from
Jan 28, 2025
Merged

feat: rate limiter #1526

merged 10 commits into from
Jan 28, 2025

Conversation

sergeytimoshin
Copy link
Contributor

@sergeytimoshin sergeytimoshin commented Jan 27, 2025

Implemented rate limiter for rpc calls.
Forester can be run with 3 optional flags:

--rpc-rate-limit <RPC_RATE_LIMIT>
--photon-rate-limit <PHOTON_RATE_LIMIT>
--send-tx-rate-limit <SEND_TX_RATE_LIMIT>

Copy link
Contributor

@ananas-block ananas-block left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit. Approved but didn't merge since I assume that you want to merge 1525 before this one.

@@ -66,7 +66,7 @@ pub struct StartArgs {
#[arg(long, env = "FORESTER_CU_LIMIT", default_value = "1000000")]
pub cu_limit: u32,

#[arg(long, env = "FORESTER_RPC_POOL_SIZE", default_value = "20")]
#[arg(long, env = "FORESTER_RPC_POOL_SIZE", default_value = "98")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice default :D

@@ -34,11 +34,14 @@ num-bigint = { workspace = true }
num-traits = { workspace = true }
reqwest = { workspace = true }

governor = "0.8.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this a workspace dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only used in one crate and shouldn't be used anywhere else, so I think we're fine here.

@sergeytimoshin sergeytimoshin merged commit e84da22 into main Jan 28, 2025
24 checks passed
@sergeytimoshin sergeytimoshin deleted the sergey/rate-limiter branch January 28, 2025 11:11
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