Add TransactionReceipt.RawRepresentation method#63
Open
ryanschneider wants to merge 1 commit intomasterfrom
Open
Add TransactionReceipt.RawRepresentation method#63ryanschneider wants to merge 1 commit intomasterfrom
ryanschneider wants to merge 1 commit intomasterfrom
Conversation
d0442fc to
28fdfb4
Compare
28fdfb4 to
e4c792f
Compare
Contributor
Author
|
Rebased and updated to support pre-EIP-658 tx receipts (which had .Root instead of .Status). |
antonydenyer
approved these changes
Jan 26, 2024
Contributor
antonydenyer
left a comment
There was a problem hiding this comment.
Seems reasonable.
Haven't fully verified - approving to unblock.
nthpool
reviewed
Feb 1, 2024
| // The EIP-2718 ReceiptPayload for this transaction is rlp([status, cumulativeGasUsed, logsBloom, logs]). | ||
| // Same as TransactionTypeLegacy. | ||
| if t.Status == nil { | ||
| fields = append(fields, "status") |
Contributor
There was a problem hiding this comment.
i see fields is appended to here & also for TransactionTypeLegacy (line 54) but nil is returned unconditionally, is that intentional?
| return rlp.Value{List: list} | ||
| } | ||
|
|
||
| switch t.TransactionType() { |
Contributor
There was a problem hiding this comment.
should there be a case for TransactionTypeBlob here?
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.
Ok, I think this is now ready for review. While we don't have a strict use case for this code at the moment, it does help verify things are correct. I dusted it off today since there were discussions on the Eth R&D Discord around a potential bug in how Infura was handling old tx receipts (see the mainnet test tx as an example) and was able to prove we are returning correct data by calculating the receiptRoot below.
Adding proper trie hashing support feels way out of scope for this project, so I'll continue to just verify the behavior "out of band" using ethereumJS since that's worked so far.
For posterity here's the scripts used to verify both the Sepolia and Mainent receipt roots (same code just different constants/comments):
Mainnet script
Sepolia script