evmrpc: stop caching panic-tx decision for missing receipts (CON-296)#3441
Merged
Conversation
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>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
pompon0
approved these changes
May 15, 2026
masih
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isPanicOrSyntheticTx(used bysei_getTransactionReceiptExcludeTraceFail) cachedtruewheneverGetReceiptreturned an error. Under load the receipt store can lag the RPC for a freshly committed tx, so a legitimateStatus=1receipt 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:
isPanicTxFuncinsetup_test.go(hash-matching stub from PR RPC endpoints for excluding tracing failures #1995, Dec 2024 — added back when the real function re-traced blocks)(false, nil)stub inevmrpc/tests/utils.goEvery caller of
NewEVMHTTPServer'sisPanicOrSyntheticTxFuncoverride now passesnilor a trivial stub, so the parameter is removed entirely. Tests exercise the realDebugAPI.isPanicOrSyntheticTxend-to-end for the first time.Test plan
gofmt -s -lcleango build ./...cleango test ./evmrpc/ -count=1passes (22s)go test ./evmrpc/tests/ -count=1passes (28s)TestGetTransactionReceiptExcludeTraceFailLateReceiptpasses 100/100 under-count=100🤖 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_getTransactionReceiptExcludeTraceFailby stopping caching of the panic/synthetic decision whenGetReceiptreturns an error, allowing a tx to become traceable once its receipt write lands.Simplifies
NewEVMHTTPServerby removing theisPanicOrSyntheticTxFuncoverride parameter and deleting related test stubs, and adds a regression test ensuring a missing-receipt lookup does not poison the cache when aStatus=1receipt appears shortly after.Reviewed by Cursor Bugbot for commit 5239914. Bugbot is set up for automated code reviews on this repo. Configure here.