fix(tokenfactory): add pagination to DenomsFromCreator query (PLT-410)#3524
fix(tokenfactory): add pagination to DenomsFromCreator query (PLT-410)#3524amir-deris wants to merge 2 commits into
Conversation
PR SummaryLow Risk Overview The query request/response proto now includes standard Also fixes a proto comment typo ( Reviewed by Cursor Bugbot for commit 7a6849e. 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).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3524 +/- ##
==========================================
- Coverage 59.15% 58.30% -0.85%
==========================================
Files 2213 2140 -73
Lines 182710 174350 -8360
==========================================
- Hits 108077 101650 -6427
+ Misses 64930 63674 -1256
+ Partials 9703 9026 -677
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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 7a6849e. Configure here.
| return nil, nil, err | ||
| } | ||
| return denoms | ||
| return denoms, pageRes, nil |
There was a problem hiding this comment.
Default pagination silently truncates results to 100
Medium Severity
Previously getDenomsFromCreator iterated all entries and returned every denom. Now it delegates to query.Paginate, which applies DefaultLimit = 100 when no PageRequest is supplied. Existing callers that pass nil pagination — notably the wasm binding via GetDenomsFromCreator — will silently receive at most 100 denoms instead of all. Any creator with more than 100 denoms gets truncated results without the caller knowing, which is a breaking behavior change for the wasm query path where smart contracts may rely on a complete list.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7a6849e. Configure here.


Summary
DenomsFromCreatorperformed an unbounded full prefix scan with no limit, making it unsafe.paginationfield toQueryDenomsFromCreatorRequestandQueryDenomsFromCreatorResponse, routing the handler throughquery.Paginatewhich enforces the MaxLimit/MaxOffset bounds being added in PLT-361 (fix(sei-cosmos): harden paginated RPC queries against DoS via limit, offset, and count_total caps (PLT-361) #3494)Changes
proto/tokenfactory/query.proto— addedPageRequest/PageResponsepagination fields toDenomsFromCreatorrequest and responsex/tokenfactory/types/query.pb.go— regenerated viascripts/protoc.shx/tokenfactory/types/query.pb.gw.go— regenerated; REST gateway now reads?pagination.*query parametersx/tokenfactory/keeper/creators.go— replaced raw unbounded iterator withquery.Paginatex/tokenfactory/keeper/grpc_query.go— threads pagination through the handlerx/tokenfactory/client/cli/query.go— exposes--page-*flags on thedenoms-from-creatorcommandx/tokenfactory/keeper/grpc_query_test.go— added pagination tests (no pagination, limit, key-based cursor, offset)wasmbinding/test/query_test.go— fixed assertions to compare onlyDenomsfield sincePaginationis now always non-nil in the responseNotes
DefaultLimit = 100resultsquery.Paginateonce PLT-361 lands; this PR depends on that for the cap to be in effect🤖 Generated with Claude Code