-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
primitives: use alloy Receipts
with Option
#12162
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: joshieDo <[email protected]>
@mattsse Nice bump here, is it ready to merge if I fix conflicts? |
receipts: Receipts::from(value.0.receipts), | ||
receipts: value.0.receipts.into_iter().map(Some).collect::<Vec<_>>().into(), |
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.
this new syntax is more complicated, I'm missing the point of this change
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.
Before we had this implemented in reth
impl From<Vec<Receipt>> for Receipts {
fn from(block_receipts: Vec<Receipt>) -> Self {
Self { receipt_vec: vec![block_receipts.into_iter().map(Option::Some).collect()] }
}
}
but now the situation is more generic in alloy with a generic parameter T https://github.com/alloy-rs/alloy/blob/86812dba8507e6f7741f666303a53cafef93c8c1/crates/consensus/src/receipt/receipts.rs#L81 so that this is not available anymore. But this should just be a temporary situation since we would like to remove soon the Option<>
in the definition of Receipts
in reth after the merge of this PR and some follow up work
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.
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.
The goal is was to use directly the alloy type, just importing it:
- Use the Receipts alloy type everywhere with
pub type Receipts = alloy_consensus::Receipts<Option<Receipt>>;
- Do some work to arrive at
pub type Receipts = alloy_consensus::Receipts<Receipt>;
(especially on pruning which is blocker right now)
But if we want to integrate a new Receipts type into reth maybe this PR is not relevant anymore
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 would hold off a bit with this pr until we have gotten further underway with #12454
Should close #7238
Superseed #12059