fix: deduplicate block fetch in getTransactionReceipt#3244
Merged
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3244 +/- ##
=======================================
Coverage 59.26% 59.26%
=======================================
Files 2070 2070
Lines 169788 169784 -4
=======================================
- Hits 100631 100629 -2
+ Misses 60358 60357 -1
+ Partials 8799 8798 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
getTransactionReceipt fetched the same block twice: once inside the ante-failure branch (Status==0 && GasUsed==0) to recover sender info, and again unconditionally for receipt encoding. Hoist the single fetch above the branch so both paths share it, eliminating the redundant block store lookup on every receipt query that hits the ante-failure path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
efbe3b0 to
6e3e648
Compare
masih
approved these changes
Apr 15, 2026
blindchaser
approved these changes
Apr 15, 2026
yzang2019
added a commit
that referenced
this pull request
Apr 16, 2026
* main: Fix buffer offset in ProposerPriorityHash (CON-200) (#3255) Handle error case in light client divergence detector (#3254) perf(evmrpc): eliminate redundant block fetches in simulate backend (#3208) fix(evmrpc): omit notifications from legacy JSON-RPC batch responses per spec (#3246) fix: deduplicate block fetch in getTransactionReceipt (#3244)
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
getTransactionReceiptwas fetching the same block twice viablockByNumberRespectingWatermarks: once inside the ante-failure branch (Status==0 && GasUsed==0) at line 141, and again unconditionally at line 172 forencodeReceiptMotivation
Every
eth_getTransactionReceiptcall that hits the ante-failure path (tx failed before reaching the VM) paid for two redundant block store lookups. This is a hot RPC method — wallets, explorers, and indexers poll it continuously.Test plan
TestGetTransactionReceipt*tests passTestGetTransaction*tests pass (zero regressions)gofmt -s -l evmrpc/tx.goproduces no outputgo build ./evmrpc/compiles cleanly🤖 Generated with Claude Code