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

rpc server: update jsonrpsee to v0.21 and provide rate limiting middleware #3028

Closed
niklasad1 opened this issue Jan 23, 2024 · 1 comment
Closed
Assignees
Labels
I5-enhancement An additional feature request.

Comments

@niklasad1
Copy link
Member

niklasad1 commented Jan 23, 2024

Superseeds #47

The rate-limiting in jsonrpsee has been replaced by JSON-RPC specific middleware and backpressure.

The way forward is that substrate should provide rate limiting and additional APIs for builders to provide their own custom middleware for similar things.

Thus, what I have in mind is that substrate/polkadot-sdk should provide the following:

  • New CLI option to enable global rate limiting such --rpc-rate-limit <CALLS_PER_MINUTE>
  • Rewrite RpcMetrics as JSON-RPC specific middleware

Alternatives

https://github.com/AcalaNetwork/subway is a RPC proxy that does similar things but has more functionality but I reckon it may be nice for builders to have something simple to use in polkadot-sdk useful.

@niklasad1 niklasad1 added the I5-enhancement An additional feature request. label Jan 23, 2024
@niklasad1 niklasad1 self-assigned this Jan 23, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 17, 2024
Add RPC server rate limiting which can be utilized by the CLI
`--rpc-rate-limit <calls/per minute>`

Resolves first part of
#3028

//cc @PierreBesson @kogeler  you might be interested in this one

---------

Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
@niklasad1
Copy link
Member Author

Closed by #3301

bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
Add RPC server rate limiting which can be utilized by the CLI
`--rpc-rate-limit <calls/per minute>`

Resolves first part of
paritytech#3028

//cc @PierreBesson @kogeler  you might be interested in this one

---------

Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

1 participant