Skip to content

evmrpc: derive block trace, sei_getCosmosTx, header gasLimit from populated data sources (CON-256)#3452

Open
wen-coding wants to merge 3 commits into
mainfrom
wen/derive_fields_from_proper_data_source
Open

evmrpc: derive block trace, sei_getCosmosTx, header gasLimit from populated data sources (CON-256)#3452
wen-coding wants to merge 3 commits into
mainfrom
wen/derive_fields_from_proper_data_source

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

Summary

Three eth-side block-scoped RPC paths leaned on /block_results data that isn't populated under Autobahn — they returned empty (or wrong) results regardless of block contents.

  • Block trace backend (debug_traceBlockBy*, sei_traceBlockBy*ExcludeTraceFail) now iterates the block's own tx list.
  • sei_getCosmosTx looks up the cosmos hash directly via receipt.TransactionIndex, no iteration needed.
  • getHeader (trace path's eth-block construction) sources gasLimit from sdkCtx.ConsensusParams(), matching the block.go:489-491 pattern already used by eth_getBlockByNumber. Under legacy this also fixes a latent silent fallback to DefaultBlockGasLimit.

Existing .iox fixtures only asserted response kind, so empty results / early-exit error paths looked indistinguishable from the fix; the trace fixtures now bind to the seeded deploy block and assert non-empty output, and a positive-case getCosmosTx-deploy.iox was added.

Supersedes #3449 (closed when the head branch was renamed).

Test plan

  • go test ./evmrpc/ (22.3s)
  • go test ./evmrpc/tests/ (27.7s)
  • Full RPC IO suite, docker localnet, Autobahn cluster: 161/161
  • Full RPC IO suite, docker localnet, legacy cluster: 160/160 (run on the earlier 5-fixture state; new fixture additive)
  • Buggy binary (block-trace fix reverted) on Autobahn: 156/160 — exactly the four updated trace fixtures fail
  • Buggy binary (sei_getCosmosTx fix reverted) on Autobahn: 160/161 — exactly the new getCosmosTx-deploy.iox fixture fails
  • gofmt -s -l clean

wen-coding and others added 3 commits May 16, 2026 09:36
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 16, 2026

PR Summary

Medium Risk
Medium risk because it changes core RPC behaviors for block tracing and sei_getCosmosTx, and alters how Ethereum headers derive GasLimit, which could affect downstream clients if edge cases (missing consensus params, tx index mismatches) are mishandled.

Overview
Fixes several EVM RPC paths that previously depended on Tendermint /block_results data (which may be missing under Autobahn), causing empty/incorrect responses.

debug_traceBlockBy* and sei_traceBlockBy*ExcludeTraceFail now iterate over the block’s own Txs list, sei_getCosmosTx now maps EVM→Cosmos tx hash directly via the receipt’s TransactionIndex, and getHeader now sources GasLimit from sdkCtx.ConsensusParams() (falling back to DefaultBlockGasLimit only when consensus params are absent).

Tests/fixtures are updated to assert non-empty trace output by binding to the seeded deploy tx’s block, and a new positive RPC-IO fixture is added for sei_getCosmosTx.

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

@github-actions
Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 16, 2026, 10:28 PM

@github-actions
Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 16, 2026, 10:28 PM

@wen-coding wen-coding changed the title evmrpc: derive block trace, sei_getCosmosTx, header gasLimit from populated data sources (CON-296) evmrpc: derive block trace, sei_getCosmosTx, header gasLimit from populated data sources (CON-256) May 16, 2026
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