Skip to content

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

Closed
wen-coding wants to merge 3 commits into
mainfrom
claude/practical-wu-261f97
Closed

evmrpc: derive block trace, sei_getCosmosTx, header gasLimit from populated data sources (CON-296)#3449
wen-coding wants to merge 3 commits into
mainfrom
claude/practical-wu-261f97

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

@wen-coding wen-coding commented May 16, 2026

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.

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

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
Changes core RPC behaviors for debug_traceBlockBy*/sei_traceBlockBy* and sei_getCosmosTx, which could affect downstream clients if any edge cases around tx ordering/indexing or consensus param availability are mishandled.

Overview
Fixes block-scoped trace RPCs to iterate over transactions from the resolved block (tmBlock.Block.Txs) instead of /block_results tx results, which may be unpopulated in some environments and previously produced empty traces.

Updates sei_getCosmosTx to return the Cosmos tx hash directly from the EVM receipt’s BlockNumber + TransactionIndex (with bounds checking) rather than scanning decoded transactions, and changes header gas-limit derivation to use SDK ConsensusParams at the block height with a default fallback.

Tightens tests: unit tests now cover consensus-params gas limit behavior without relying on BlockResults, and RPC IO fixtures bind block hash/number from a seeded deploy receipt and assert non-empty trace output; adds a positive-case sei_getCosmosTx fixture.

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

github-actions Bot commented May 16, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 16, 2026, 9:42 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.29%. Comparing base (823a78d) to head (f33e827).

Files with missing lines Patch % Lines
evmrpc/association.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3449      +/-   ##
==========================================
- Coverage   59.29%   59.29%   -0.01%     
==========================================
  Files        2125     2125              
  Lines      175629   175607      -22     
==========================================
- Hits       104144   104129      -15     
+ Misses      62404    62400       -4     
+ Partials     9081     9078       -3     
Flag Coverage Δ
sei-chain-pr 67.33% <75.00%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
evmrpc/simulate.go 74.34% <100.00%> (+0.15%) ⬆️
evmrpc/association.go 40.19% <50.00%> (-4.35%) ⬇️
🚀 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.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding changed the title evmrpc: iterate Block.Txs in block trace backend (CON-296) evmrpc: derive block trace + sei_getCosmosTx from populated data sources (CON-296) May 16, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding changed the title evmrpc: derive block trace + sei_getCosmosTx from populated data sources (CON-296) evmrpc: derive block trace, sei_getCosmosTx, header gasLimit from populated data sources (CON-296) May 16, 2026
@wen-coding wen-coding closed this May 16, 2026
@wen-coding wen-coding deleted the claude/practical-wu-261f97 branch May 16, 2026 22:27
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