internal/ethapi,webext: add debug_getRawReceipt RPC #24741
Closed
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.
This is a small tweak to #24726, which I closed since it didn't actually return the correct data for EIP-2718 non-legacy transactions. Turns out the fix was quite simple, just call
receipt.MarshalBinary()
instead ofrlp.EncodeToBytes(receipt)
, and now the EIP-2718 receipts are handled correctly.Otherwise, follows the same pattern as
debug_getBlockRlp
above it, using the same preamble code aseth_getTransactionReceipt
(https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1547).I fully admit the RPC name is now crossing into unwieldy territory, happy to change it to something more concise if any suggestions arise.. RPC name was changed todebug_getRawReceipt
to match Felix's suggestion in #24738 (comment)Tested on this Sepolia transaction:
https://sepolia.otterscan.io/tx/0x30296f5f32972c7c3b39963cfd91073000cb882c294adc2dcf0ac9ca34d67bd2
I used the
ethereumjs
trie implementation at https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/baseTrie.ts#L43 to confirm that this data correctly recreates the containing blocks receipt root (the block in question only had this one tx in it) using this code snippet: https://replit.com/@ryanleeschneider/TrieTest#index.ts