fix: lower sei-cosmos pagination query MaxLimit to 10,000#3494
fix: lower sei-cosmos pagination query MaxLimit to 10,000#3494amir-deris wants to merge 2 commits into
Conversation
PR SummaryMedium Risk Overview Updated bank module callers ( Reviewed by Cursor Bugbot for commit d5241fa. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit da36bbb. Configure here.
| // MaxLimit is the maximum limit the paginate function can handle | ||
| // which equals the maximum value that can be stored in uint64 | ||
| const MaxLimit = math.MaxUint64 | ||
| const MaxLimit = uint64(10_000) |
There was a problem hiding this comment.
Test still uses reduced MaxLimit constant
Medium Severity
Reducing query.MaxLimit from math.MaxUint64 to uint64(10_000) affects genesis_test.go line 123, which still uses query.MaxLimit to fetch all supply entries. The production code in genesis.go and invariants.go was correctly updated to use math.MaxUint64 directly, but the test was missed. If test data ever exceeds 10,000 denominations, the test would silently return truncated results and could produce false-passing assertions.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit da36bbb. Configure here.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3494 +/- ##
=======================================
Coverage 59.08% 59.08%
=======================================
Files 2187 2187
Lines 182237 182249 +12
=======================================
+ Hits 107679 107689 +10
- Misses 64911 64914 +3
+ Partials 9647 9646 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|


Summary
MaxLimitinsei-cosmos/types/query/pagination.gofrommath.MaxUint64to10_000to cap the number of items a paginated RPC query can request in a single call, preventing unbounded scans that can degrade node performance.x/bank(ExportGenesis,TotalSupplyinvariant) that legitimately need to iterate all supply entries to passmath.MaxUint64directly, preserving their existing behavior.Test plan
ExportGenesisandTotalSupplyinvariant still work correctly on a node with many token denominations