Backport giga-1: feat(evmonly): add eth_getBalance RPC - #4174
seidroid[bot] wants to merge 1 commit into
Conversation
## Describe your changes and provide context - expose `eth_getBalance` from the EVM-only JSON-RPC server - read balances from the current committed EVM state - support `latest`, `safe`, `finalized`, and `pending`, while rejecting block heights and hashes until historical state is wired - add unit, JSON-RPC registration, and Docker integration coverage - document the endpoint and its supported block selectors in the Autobahn README ## Testing performed to validate your change - `go test -race -count=1 ./giga/evmonly/rpc/...` - `go test -count=1 ./sei-tendermint/internal/rpc/core/...` - `make autobahn-evmonly-integration-test` (four local Docker validators, 4,000 finalized transfers, post-transfer balance checks on every validator) - `golangci-lint run ./giga/evmonly/rpc/... ./sei-tendermint/internal/rpc/core/...` - `golangci-lint fmt --diff` (cherry picked from commit f0cd46c)
PR SummaryLow Risk Overview The handler accepts Unit tests cover tag acceptance, historical rejection, and HTTP JSON-RPC serving; Autobahn EVM-only load integration asserts per-validator balances after transfers. Autobahn E2E docs document Reviewed by Cursor Bugbot for commit 3c8f1ca. 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 @@
## giga-1 #4174 +/- ##
==========================================
- Coverage 66.69% 65.55% -1.14%
==========================================
Files 2202 2082 -120
Lines 169563 157618 -11945
==========================================
- Hits 113087 103334 -9753
+ Misses 56335 54143 -2192
Partials 141 141
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.
Clean backport of #4140 (eth_getBalance for the EVM-only RPC surface) — the diff is line-for-line identical in scope and size to the original, the new balanceAPI follows the existing sendAPI/receiptAPI shape, and unit plus integration coverage is present. One non-blocking note about the new Environment.EvmBalance wrapper's semantics outside EVM-only mode.
Findings: 0 blocking | 1 non-blocking | 1 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- None at the file/PR level.
- 1 suggestion(s)/nit(s) flagged inline on specific lines.
Inline comments (could not post inline; listed here)
sei-tendermint/internal/rpc/core/mempool.go:32(RIGHT) -- [suggestion]Environmentis the generic RPC environment, but this wrapper's contract only holds for the EVM-only application.App.EvmBalance's second parameter is the associated Sei address (seeinternal/mempool/tx.go, which passesevm.seiAddress); passingnilis fine forevmOnlyApplication, which ignores it, but onapp.App(app/abci.go:181) it takes the non-equal branch and addsGetBalance(ctx, nil), and the result is passed throughmempoolBalanceFloor— under themock_balancesbuild tag that floors the answer to the mock top-off amount, so the godoc's "current committed EVM state" would not be what an RPC caller gets. That path is unreachable today becauseevmonlyrpc.Startonly runs whenconfig.EVMOnlyis set (sei-tendermint/node/node.go:698), so this is a latent trap rather than a live bug: consider stating the EVM-only precondition in the doc comment, or sourcing the balance from the EVM-only app directly.
Backport of #4140 to
giga-1.