Skip to content

evmrpc: derive *ExcludeTraceFail from receipt store, not block trace (CON-257)#3402

Open
wen-coding wants to merge 1 commit intomainfrom
wen/exclude_tracefail_via_receipts
Open

evmrpc: derive *ExcludeTraceFail from receipt store, not block trace (CON-257)#3402
wen-coding wants to merge 1 commit intomainfrom
wen/exclude_tracefail_via_receipts

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

Summary

isPanicOrSyntheticTx (used by sei_getTransactionReceiptExcludeTraceFail,
sei_traceBlockByHash/NumberExcludeTraceFail) previously re-traced the
receipt's block and decided panic/synthetic from trace.Error and
trace-list absence.

Under Autobahn, sei-tendermint's BlockResults stub
(sei-tendermint/internal/rpc/core/blocks.go:260) returns no TxsResults
— the per-tx ABCI responses aren't persisted. So the block trace returns
[] for any block, and every tx hash looks "synthetic" → every
*ExcludeTraceFail call returns ErrPanicTx.

This PR sources the same decision from the receipt store directly:

GetReceipt error                          → exclude (no trace anyway)
TxType == ShellEVMTxType (synthetic)      → exclude (no real EVM tx)
Status == 0 (failed receipt, post #3383)  → exclude (panic-like)
Status == 1                               → include

The receipt store is fully populated under Autobahn (off-tree pebble DB,
written via FlushTransientReceipts at PreCommit), so this works without
the deferred BlockResults.TxsResults follow-up.

Behavior

  • Legacy / V2: equivalent. Status==0 and trace.Error != "" go
    hand-in-hand for receipts written through WriteReceipt (revert / OOG
    / EIP-7623 floor / etc.).
  • Autobahn (Giga + OCC): takes
    sei_getTransactionReceiptExcludeTraceFail from broken to working.
  • Side benefit: a single receipt-store lookup replaces a full block
    re-trace.

When BlockResults.TxsResults is eventually wired through Autobahn (likely
via Cody's litt block store), the trace-based path can come back as a
richer alternative, but this check doesn't need it.

Test plan

  • make test-evm-rpc-io (docker localnet, Giga + OCC + Autobahn): 160/160 pass
    • Previously 159/160 — sei_getTransactionReceiptExcludeTraceFail was
      failing with code=-32000 message="transaction is panic tx" because
      the empty trace-list path treated every tx as synthetic.
  • Same suite under Giga + OCC (no Autobahn): 160/160 pass — no regression
  • gofmt -s -l clean
  • go build ./... clean

🤖 Generated with Claude Code

isPanicOrSyntheticTx previously called TraceBlockByNumber on the receipt's
block and decided the answer from trace.Error / trace-list absence. Under
Autobahn, sei-tendermint's BlockResults stub returns no TxsResults (the
trace path has nothing to iterate), so debug_traceBlockByNumber returns []
and every tx looks "synthetic" — making sei_getTransactionReceiptExcludeTraceFail
and the trace-block ExcludeTraceFail variants always exclude every tx.

Replace the trace-based decision with a receipt-store read:

  GetReceipt error                         → exclude (no trace anyway)
  TxType == ShellEVMTxType (synthetic)     → exclude (no real EVM tx)
  Status == 0 (failed receipt, post #3383) → exclude (panic-like)
  Status == 1                              → include

This is functionally equivalent under legacy/V2 (status-0 receipts also
have trace.Error set in callTracer), and strictly correct under Autobahn
where the block trace can't distinguish synthetic from anything else.
Side benefit: a single receipt-store lookup instead of a full block re-trace.

When BlockResults.TxsResults is eventually wired through Autobahn (e.g. via
Cody's litt block store), the trace-based path could come back as a richer
alternative, but this check doesn't need it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 6, 2026, 11:19 PM

@wen-coding wen-coding changed the title evmrpc: derive *ExcludeTraceFail from receipt store, not block trace evmrpc: derive *ExcludeTraceFail from receipt store, not block trace (CON-257) May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.16%. Comparing base (8310d93) to head (1cc410f).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
evmrpc/tracers.go 0.00% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3402      +/-   ##
==========================================
+ Coverage   59.10%   59.16%   +0.06%     
==========================================
  Files        2101     2101              
  Lines      173195   173578     +383     
==========================================
+ Hits       102360   102699     +339     
- Misses      61955    61988      +33     
- Partials     8880     8891      +11     
Flag Coverage Δ
sei-chain-pr 65.75% <0.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/tracers.go 72.28% <0.00%> (+4.36%) ⬆️

... and 3 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.

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.

2 participants