feat(consensus): add EthereumReceipt type ported from reth#3683
Merged
mattsse merged 3 commits intoalloy-rs:mainfrom Feb 17, 2026
Merged
feat(consensus): add EthereumReceipt type ported from reth#3683mattsse merged 3 commits intoalloy-rs:mainfrom
EthereumReceipt type ported from reth#3683mattsse merged 3 commits intoalloy-rs:mainfrom
Conversation
onbjerg
reviewed
Feb 13, 2026
Member
onbjerg
left a comment
There was a problem hiding this comment.
following my review, this change is breaking
mattsse
requested changes
Feb 14, 2026
Member
mattsse
left a comment
There was a problem hiding this comment.
if we need this logic then we should be able to selectively enforce the Typed trait but always requiring a txtype introduces issues for
tx_type field to Receipt
Contributor
Author
|
Updated based on review, |
mattsse
requested changes
Feb 16, 2026
Comment on lines
61
to
69
| let mut receipt = receipt.into(); | ||
| receipt.receipt.tx_type = tx_type as u8; | ||
| match tx_type { | ||
| TxType::Legacy => Self::Legacy(receipt.into()), | ||
| TxType::Eip2930 => Self::Eip2930(receipt.into()), | ||
| TxType::Eip1559 => Self::Eip1559(receipt.into()), | ||
| TxType::Eip4844 => Self::Eip4844(receipt.into()), | ||
| TxType::Eip7702 => Self::Eip7702(receipt.into()), | ||
| TxType::Legacy => Self::Legacy(receipt), | ||
| TxType::Eip2930 => Self::Eip2930(receipt), | ||
| TxType::Eip1559 => Self::Eip1559(receipt), | ||
| TxType::Eip4844 => Self::Eip4844(receipt), | ||
| TxType::Eip7702 => Self::Eip7702(receipt), | ||
| } |
c1ed2fb to
82126b3
Compare
tx_type field to ReceiptEthereumReceipt type ported from reth
klkvr
approved these changes
Feb 17, 2026
mattsse
approved these changes
Feb 17, 2026
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.
Motivation
Port reth's
EthereumReceiptintoalloy-consensusas a step towards unifying receipt types between alloy and reth.Solution
Add
crates/consensus/src/receipt/receipt2.rscontaining:TxTytrait — bounds alias for the tx type generic (Debug + Copy + Eq + Send + Sync + InMemorySize + Typed2718 + TryFrom<u8> + Decodable + 'static)EthereumReceipt<T, L>struct — generic over tx type and log type, withtx_type,success,cumulative_gas_used,logsfieldsTxReceipt,Typed2718,IsTyped2718,Eip2718EncodableReceipt,Eip2718DecodableReceipt,RlpEncodableReceipt,RlpDecodableReceipt,InMemorySizeFromconversions:ReceiptEnvelope → EthereumReceipt,EthereumReceipt → Receipt,EthereumReceipt<TxType> → ReceiptEnvelopeserde_bincode_compatmodule for bincode serialization supportWire it up via
mod.rsand re-exportEthereumReceiptandTxTyfrom the crate root.PR Checklist