fix(rpc): Fix eth_getBlockReceipts crash when KV indexer is overwritten#877
Open
fix(rpc): Fix eth_getBlockReceipts crash when KV indexer is overwritten#877
Conversation
This comment has been minimized.
This comment has been minimized.
JayT106
added a commit
that referenced
this pull request
Mar 31, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
663beea to
8cf38b6
Compare
8cf38b6 to
a2a3089
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #877 +/- ##
===========================================
+ Coverage 43.07% 43.11% +0.03%
===========================================
Files 195 195
Lines 16551 16597 +46
===========================================
+ Hits 7130 7156 +26
- Misses 8697 8708 +11
- Partials 724 733 +9
🚀 New features to boost your workflow:
|
thomas-nguy
requested changes
Apr 6, 2026
thomas-nguy
left a comment
There was a problem hiding this comment.
Change the implementation to return the receipt in the block
…rite Signed-off-by: JayT106 <JayT106@users.noreply.github.com>
Author
Done! |
|
@copilot review the PR |
PR review completed. The implementation looks correct and the tests pass. Here's a summary: Changes reviewed:
No issues found. Edge cases are handled (out-of-range indexes, decode errors, tx not found in block). All related tests pass (commit |
Copilot
AI
changed the title
fix(rpc): Fix eth_getBlockReceipts crash
fix(rpc): Fix eth_getBlockReceipts crash when KV indexer is overwritten
Apr 8, 2026
songgaoye
reviewed
Apr 8, 2026
songgaoye
reviewed
Apr 8, 2026
thomas-nguy
reviewed
Apr 9, 2026
songgaoye
reviewed
Apr 9, 2026
songgaoye
approved these changes
Apr 9, 2026
…rite Signed-off-by: JayT106 <JayT106@users.noreply.github.com>
Co-authored-by: Thomas <81727899+thomas-nguy@users.noreply.github.com> Signed-off-by: JayT106 <JayT106@users.noreply.github.com>
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.
eth_getBlockReceipts(andeth_getTransactionReceiptwith an explicit block scope) could crash or return a receipt from the wrong block when the KV tx indexer had been overwritten to point the same Ethereum tx hash at a later block height.Changes
GetBlockReceipts– skipnilreceipts instead of panicking on appendGetTransactionReceipt– compare indexer-reported height against the caller-suppliedresBlockheight; when they differ, rebuild theTxResultfrom the requested block's data rather than trusting the stale indextxResultFromBlockHash(new helper) – walks all transactions in aResultBlock, parses each viaParseTxResult, and returns a correctly-anchoredTxResult+ResultBlockResultsfor the requested block; returns(nil, blockRes, nil)when the hash is not present in the blockTestGetTransactionReceipt_BlockScopedWhenIndexerOverwrittencovering the full overwrite scenario: index two blocks for the same tx hash, verify block-scoped queries return data anchored to the requested block