-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TransactionReceipt.RawRepresentation method #63
base: master
Are you sure you want to change the base?
Conversation
d0442fc
to
28fdfb4
Compare
28fdfb4
to
e4c792f
Compare
Rebased and updated to support pre-EIP-658 tx receipts (which had .Root instead of .Status). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
Haven't fully verified - approving to unblock.
// The EIP-2718 ReceiptPayload for this transaction is rlp([status, cumulativeGasUsed, logsBloom, logs]). | ||
// Same as TransactionTypeLegacy. | ||
if t.Status == nil { | ||
fields = append(fields, "status") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a case for TransactionTypeBlob
here?
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