Add precompile-backed bank query client#3424
Conversation
|
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 #3424 +/- ##
==========================================
- Coverage 59.34% 59.34% -0.01%
==========================================
Files 2112 2116 +4
Lines 174772 175477 +705
==========================================
+ Hits 103724 104131 +407
- Misses 62010 62203 +193
- Partials 9038 9143 +105
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Pushed
Local verification: go test ./precompiles/query ./precompiles/bank/query ./precompiles/bank ./precompiles/addr ./sei-cosmos/x/bank/client/cli
go test ./precompiles/...The repo |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 93b0b77. Configure here.
| pageRes := &sdkquery.PageResponse{NextKey: nextKey} | ||
| if countTotal && !keyPagination { | ||
| pageRes.Total = orderedLen | ||
| } |
There was a problem hiding this comment.
Pagination omits Total for key-based requests
Medium Severity
The paginate function deliberately skips setting pageRes.Total when key-based pagination is used (countTotal && !keyPagination), but the Cosmos SDK's Paginate sets Total for key-based pagination when CountTotal is true. Since the bindings (e.g., AllBalances, SpendableBalances, TotalSupply) claim ExactProtobufShape, consumers relying on Total being populated during key-based paginated queries will get a zero value instead of the actual item count, silently diverging from the original gRPC query behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93b0b77. Configure here.
|
Pushed Local verification: go test ./precompiles/bank ./precompiles/bank/query ./precompiles/query ./sei-cosmos/x/bank/client/cli |


Summary
precompiles/queryClientConn bridge that maps generated QueryClient calls to EVM RPCeth_callprecompile bindingsTests
go test ./precompiles/...go test ./precompiles/query ./precompiles/bank/query ./precompiles/bank ./precompiles/addr ./sei-cosmos/x/bank/client/cliNote
Medium Risk
Introduces a new query transport layer that routes generated gRPC
QueryClientcalls through EVM RPCeth_call, and expands the bank precompile ABI; errors or ABI mismatches could break CLI/query behavior despite added tests.Overview
Switches bank CLI queries to EVM RPC.
x/bankCLI commands now build their generatedQueryClienton top of a newprecompiles/queryClientConn, configured via a new--evm-rpcflag (defaulthttp://localhost:8545) and honoring the existing height selection.Adds a shared precompile-backed query bridge + bank bindings. New
precompiles/querycode provides a registry-based method router, ABI pack/unpack helpers, and Sei↔EVM address conversion via theaddrprecompile;precompiles/bank/queryregisters bindings for key bank queries (balances, spendable, supply, params, metadata) including pagination reconstruction.Extends the bank precompile query surface. The bank precompile ABI and executor add missing retained view methods (string-address variants, spendable balances, total supply, denom metadata, params) and refactors supply handling; interfaces and tests are updated accordingly, plus an RFC documenting the migration approach.
Reviewed by Cursor Bugbot for commit d750c83. Bugbot is set up for automated code reviews on this repo. Configure here.