-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: use BlockWithParent
for StageError
#13198
Conversation
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 doesn't solve the header type in stageerror issue yet.
looking at the stageerror error messages, looks like we can simply use the BlockWithParent
type that is hash+number+parent_hash instead of the header?
Actually yeah that would be better, will change stageerror to use that |
d3d6be4
to
568e404
Compare
568e404
to
661e06c
Compare
Had to change the |
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.
great! this should unblock abstraction of header stage which is the only reason pipeline needs concrete header generic right now
just a nit on unneeded generic
StageError
variant in PipelineError
BlockWithParent
for StageError
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.
lgtm
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.
makes sense,
nits
block: Box::new(BlockWithParent::new( | ||
header.parent_hash, | ||
NumHash::new(header.number, header_hash), | ||
)), |
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 can use the trait function I assume?
/// Generate a random [`BlockWithParent`]. | ||
pub fn random_block_with_parent<R: Rng>( | ||
rng: &mut R, | ||
number: u64, | ||
parent: Option<B256>, | ||
) -> BlockWithParent { | ||
BlockWithParent { parent: parent.unwrap_or_default(), block: NumHash::new(number, rng.gen()) } | ||
} |
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.
added alloy-rs/alloy#1777
This fixes #13197, changing to
BlockWithParent
for all of the fields that are currentlySealedHeader
inStageError