Add Rate limit and concurrency control for RPC with proof queries#2951
Merged
Add Rate limit and concurrency control for RPC with proof queries#2951
Conversation
Introduce limits to control the rate of calls to LoadVersion as well as maximum in-flight LoadVersion at any given point in time. This is because, such calls are expensive, and excessive call to RPC for these calls can cause an RPC node to fall behind.
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
philipsu522
approved these changes
Feb 22, 2026
yzang2019
reviewed
Feb 22, 2026
yzang2019
reviewed
Feb 22, 2026
| // historical path (this is where RPC pressure happens) | ||
| if needProof { | ||
| if err := rs.tryAcquireHistProofPermit(); err != nil { | ||
| return sdkerrors.QueryResult(err) |
Contributor
There was a problem hiding this comment.
Can we add some error logs here? Or maybe a metric for success/failure?
yzang2019
reviewed
Feb 22, 2026
Contributor
|
Maybe add a unit test for this new feature? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2951 +/- ##
===========================================
- Coverage 57.83% 52.05% -5.78%
===========================================
Files 2110 26 -2084
Lines 174073 4322 -169751
===========================================
- Hits 100678 2250 -98428
+ Misses 64427 1863 -62564
+ Partials 8968 209 -8759
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
philipsu522
approved these changes
Feb 22, 2026
yzang2019
approved these changes
Feb 22, 2026
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-2951-to-release/v6.3
git worktree add --checkout .worktree/backport-2951-to-release/v6.3 backport-2951-to-release/v6.3
cd .worktree/backport-2951-to-release/v6.3
git reset --hard HEAD^
git cherry-pick -x f4b318c1a986200e0fef42af3ace4787c140b758
git push --force-with-lease |
masih
added a commit
that referenced
this pull request
Feb 22, 2026
) Introduce limits to control the rate of calls to LoadVersion as well as maximum in-flight LoadVersion at any given point in time. This is because, such calls are expensive, and excessive call to RPC for these calls can cause an RPC node to fall behind. (cherry picked from commit f4b318c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce limits to control the rate of calls to LoadVersion as well as maximum in-flight LoadVersion at any given point in time.
This is because, such calls are expensive, and excessive call to RPC for these calls can cause an RPC node to fall behind.