Skip to content

evmrpc: stop caching panic-tx decision for missing receipts (CON-296)#3441

Merged
wen-coding merged 1 commit into
mainfrom
wen/fix_is_panic_or_synthetic_tx
May 15, 2026
Merged

evmrpc: stop caching panic-tx decision for missing receipts (CON-296)#3441
wen-coding merged 1 commit into
mainfrom
wen/fix_is_panic_or_synthetic_tx

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

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

Summary

isPanicOrSyntheticTx (used by sei_getTransactionReceiptExcludeTraceFail) cached true whenever GetReceipt returned an error. Under load the receipt store can lag the RPC for a freshly committed tx, so a legitimate Status=1 receipt that lands a few hundred ms after the first lookup stayed excluded for the full cache TTL (IsPanicCacheTTL = 1m).

The fix drops the cache write on the missing-receipt branch — receipt-derived outcomes (synthetic / Status=0 / Status=1) are still cached, since those are stable once a receipt is written.

This was a regression introduced by #3402: the prior trace-based implementation returned an error on missing receipts (caller retried), while the new receipt-store path committed to "panic" and cached it.

Cleanup

With the function now cheap and correct under both Autobahn and legacy, the long-standing test stubs that bypassed it can go:

Every caller of NewEVMHTTPServer's isPanicOrSyntheticTxFunc override now passes nil or a trivial stub, so the parameter is removed entirely. Tests exercise the real DebugAPI.isPanicOrSyntheticTx end-to-end for the first time.

Test plan

  • gofmt -s -l clean
  • go build ./... clean
  • go test ./evmrpc/ -count=1 passes (22s)
  • go test ./evmrpc/tests/ -count=1 passes (28s)
  • New regression test TestGetTransactionReceiptExcludeTraceFailLateReceipt passes 100/100 under -count=100
  • Confirmed the new test catches the bug — fails without the fix with "Should not be: "transaction is panic tx""

🤖 Generated with Claude Code


Note

Medium Risk
Changes receipt-based filtering for sei_getTransactionReceiptExcludeTraceFail, which can affect RPC responses under load and may alter client-visible behavior for recently committed transactions.

Overview
Fixes a regression in sei_getTransactionReceiptExcludeTraceFail by stopping caching of the panic/synthetic decision when GetReceipt returns an error, allowing a tx to become traceable once its receipt write lands.

Simplifies NewEVMHTTPServer by removing the isPanicOrSyntheticTxFunc override parameter and deleting related test stubs, and adds a regression test ensuring a missing-receipt lookup does not poison the cache when a Status=1 receipt appears shortly after.

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

isPanicOrSyntheticTx cached `true` whenever GetReceipt returned an
error. Under load the receipt store can lag the RPC for a freshly
committed tx, so legitimate Status=1 receipts that landed after the
first lookup stayed excluded for up to the cache TTL (1m). Drop the
cache write on the missing-receipt branch — receipt-derived outcomes
(synthetic / Status=0 / Status=1) are still cached, since those are
stable once written.

With the function now cheap and correct under both Autobahn and legacy,
the long-standing test stubs that bypassed it (isPanicTxFunc in
setup_test.go, the inline always-false stub in tests/utils.go) are no
longer earning their keep — tests now exercise the real path. The
NewEVMHTTPServer override parameter becomes dead and is removed; every
caller already passed nil or a trivial stub.

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

github-actions Bot commented May 15, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 15, 2026, 1:41 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.32%. Comparing base (5060dcd) to head (5239914).

Files with missing lines Patch % Lines
app/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3441   +/-   ##
=======================================
  Coverage   59.31%   59.32%           
=======================================
  Files        2120     2120           
  Lines      175523   175516    -7     
=======================================
+ Hits       104106   104117   +11     
+ Misses      62338    62320   -18     
  Partials     9079     9079           
Flag Coverage Δ
sei-chain-pr 61.97% <50.00%> (?)
sei-db 70.41% <ø> (-0.22%) ⬇️

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

Files with missing lines Coverage Δ
evmrpc/server.go 88.62% <100.00%> (+0.83%) ⬆️
evmrpc/tests/utils.go 71.95% <ø> (+1.12%) ⬆️
evmrpc/tracers.go 71.11% <ø> (+3.15%) ⬆️
app/app.go 69.85% <0.00%> (ø)

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

@wen-coding wen-coding added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit 87e2d4f May 15, 2026
66 of 68 checks passed
@wen-coding wen-coding deleted the wen/fix_is_panic_or_synthetic_tx branch May 15, 2026 13:59
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.

3 participants