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

[DO NOT MERGE]: PoC rpc rate limit middleware #2208

Closed
wants to merge 35 commits into from

Conversation

niklasad1
Copy link
Member

@niklasad1 niklasad1 commented Nov 7, 2023

This PR adds the following:

  • CLI option to enable global rate limiting per connection by --rpc-rate-limit (calls per min)
  • Rewrite RpcMetrics as JSON-RPC specific middleware
  • Add RateLimiting middleware

@niklasad1 niklasad1 changed the title [DO NOT MERGE]: rpc middleware [DO NOT MERGE]: rpc rate limit middleware Nov 10, 2023
@niklasad1 niklasad1 changed the title [DO NOT MERGE]: rpc rate limit middleware [DO NOT MERGE]: PoC rpc rate limit middleware Nov 10, 2023
@xlc
Copy link
Contributor

xlc commented Dec 9, 2023

we have recently implemented rate limiting with Subway https://github.com/AcalaNetwork/subway

@niklasad1
Copy link
Member Author

niklasad1 commented Dec 9, 2023

we have recently implemented rate limiting with Subway https://github.com/AcalaNetwork/subway

Nice but I think it's worth to provide a custom ResponseFuture not box the futures as it will run for every rpc call and use more memory. When native async trait is thing in rust we could change the middleware in jsonrpsee to be easier to work with.

//cc @PierreBesson may be worth to test out subway now :)

The govenor crate looks neat.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5014220

@niklasad1 niklasad1 closed this Feb 12, 2024
bkontur pushed a commit that referenced this pull request May 14, 2024
bkontur pushed a commit that referenced this pull request May 15, 2024
bkontur pushed a commit that referenced this pull request May 15, 2024
bkontur pushed a commit that referenced this pull request May 15, 2024
bkontur pushed a commit that referenced this pull request May 15, 2024
bkontur pushed a commit that referenced this pull request May 16, 2024
bkontur pushed a commit that referenced this pull request May 17, 2024
bkontur pushed a commit that referenced this pull request May 17, 2024
svyatonik pushed a commit that referenced this pull request May 17, 2024
bkontur pushed a commit that referenced this pull request May 20, 2024
bkontur pushed a commit that referenced this pull request May 21, 2024
bkontur pushed a commit that referenced this pull request May 22, 2024
bkontur pushed a commit that referenced this pull request May 23, 2024
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.

3 participants