fix(tokenfactory): add pagination to DenomsFromCreator query (PLT-410)#3524
fix(tokenfactory): add pagination to DenomsFromCreator query (PLT-410)#3524amir-deris wants to merge 3 commits into
Conversation
PR SummaryMedium Risk Overview The proto request/response now carry Cosmos Wasm queries without pagination get a 2000-denom default cap (higher than typical gRPC defaults) to limit DoS while keeping many contracts working in one response. Tests cover limit, key, and offset paging; wasm binding tests assert Reviewed by Cursor Bugbot for commit 0c8617c. 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 174352 -8358
==========================================
- Hits 108077 101652 -6425
+ 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.

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