-
Notifications
You must be signed in to change notification settings - Fork 200
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
consensus: add BlockHeader
getter trait
#1302
base: main
Are you sure you want to change the base?
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.
@@ -638,6 +638,158 @@ impl<'a> arbitrary::Arbitrary<'a> for Header { | |||
} | |||
} | |||
|
|||
/// Trait for extracting specific Ethereum block data from a header | |||
pub trait BlockHeader { |
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.
from reth pov there's an argument for limiting these functions to the absolute necessary fields, or introduce sub traits, for example for evm you only need certain fields.
but since this doesn't clash with rpc, I think all of those are fine, and we could still do sub traits
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.
Let me know if you think we should split in subtraits now or if we should do that in a follow up if needed
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 think we can do in a followup if needed, realistically we only need this trait for one type really, the chain's header type and for op we can even reuse the L1 type
after thinking about this, this might be redundant since we already have HeaderResponse if we unify rpc with consensus, so I'd like to hold off here
Should close #1301