Skip to content

feat(evmonly): add eth_getBalance RPC - #4140

Open
codchen wants to merge 1 commit into
mainfrom
codex/evmonly-get-balance
Open

feat(evmonly): add eth_getBalance RPC#4140
codchen wants to merge 1 commit into
mainfrom
codex/evmonly-get-balance

Conversation

@codchen

@codchen codchen commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 14, 2026, 1:52 AM

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.62%. Comparing base (9407b6d) to head (448897f).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
giga/evmonly/rpc/server.go 0.00% 1 Missing and 1 partial ⚠️
sei-tendermint/internal/rpc/core/mempool.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4140      +/-   ##
==========================================
- Coverage   61.58%   60.62%   -0.97%     
==========================================
  Files        2196     2080     -116     
  Lines      193825   180359   -13466     
==========================================
- Hits       119365   109336   -10029     
+ Misses      62888    60605    -2283     
+ Partials    11572    10418    -1154     
Flag Coverage Δ
sei-chain-pr 37.18% <77.77%> (?)
sei-db 69.80% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
giga/evmonly/rpc/balance.go 100.00% <100.00%> (ø)
giga/evmonly/rpc/server.go 31.25% <0.00%> (-1.01%) ⬇️
sei-tendermint/internal/rpc/core/mempool.go 45.02% <0.00%> (-0.48%) ⬇️

... and 117 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codchen
codchen marked this pull request as ready for review September 14, 2026 01:50
@cursor

cursor Bot commented Sep 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Introduces a new read path over committed EVM balances; scope is limited to current state with historical queries rejected, but balance correctness matters for tooling and offline signing workflows.

Overview
Adds eth_getBalance to the Autobahn EVM-only JSON-RPC server so clients can read an address balance from the current committed EVM state.

The handler accepts latest, safe, finalized, and pending (all mapped to current state); explicit block numbers and hashes return an error until historical state exists. The RPC Backend gains EvmBalance, wired through Environment.EvmBalance to the app, and the method is registered alongside existing eth_* endpoints.

Coverage includes unit tests, an HTTP eth_getBalance smoke test, post-transfer balance checks on every validator in the EVM-only integration load test, and Autobahn README docs (including cast balance).

Reviewed by Cursor Bugbot for commit 448897f. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds eth_getBalance to the EVM-only JSON-RPC surface, reading the current committed EVM state and rejecting historical selectors, with unit, registration, and Docker integration coverage. The block-selector gating, the nil Sei-address argument (only reachable in EVM-only mode, where it is ignored), the RPC-surface exposure, and the 2^200 + 1 integration assertion all check out; nothing blocking found.

Findings: 0 blocking | 0 non-blocking | 0 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • None at the file/PR level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant