Skip to content

Add Rate limit and concurrency control for RPC with proof queries#2951

Merged
masih merged 4 commits intomainfrom
masih/rpc-proof-historic-limit
Feb 22, 2026
Merged

Add Rate limit and concurrency control for RPC with proof queries#2951
masih merged 4 commits intomainfrom
masih/rpc-proof-historic-limit

Conversation

@masih
Copy link
Collaborator

@masih masih commented 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.

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.
@github-actions
Copy link

github-actions bot commented Feb 22, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 22, 2026, 3:40 AM

// historical path (this is where RPC pressure happens)
if needProof {
if err := rs.tryAcquireHistProofPermit(); err != nil {
return sdkerrors.QueryResult(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add some error logs here? Or maybe a metric for success/failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added log for now

@yzang2019
Copy link
Contributor

Maybe add a unit test for this new feature?

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 90.76923% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.05%. Comparing base (e229d9e) to head (c71daa3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-cosmos/storev2/rootmulti/store.go 89.28% 2 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
sei-chain 50.12% <90.76%> (-7.68%) ⬇️
sei-db 68.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/seidb.go 66.23% <100.00%> (+0.03%) ⬆️
sei-db/config/sc_config.go 100.00% <100.00%> (ø)
sei-cosmos/storev2/rootmulti/store.go 44.62% <89.28%> (+2.82%) ⬆️

... and 2087 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih masih enabled auto-merge (squash) February 22, 2026 03:52
@masih masih merged commit f4b318c into main Feb 22, 2026
37 of 39 checks passed
@masih masih deleted the masih/rpc-proof-historic-limit branch February 22, 2026 03:54
@seidroid
Copy link

seidroid bot commented Feb 22, 2026

Created backport PR for release/v6.3:

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)
masih added a commit that referenced this pull request Feb 22, 2026
…PC with proof queries (#2953)

Backport of #2951 to `release/v6.3`.

Co-authored-by: Masih H. Derkani <m@derkani.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants