-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(engine): add validate_payload and validate_block methods to EngineValidator trait #17429
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
Conversation
48b5476
to
d24e849
Compare
crates/engine/primitives/src/lib.rs
Outdated
@@ -106,7 +130,7 @@ pub trait EngineTypes: | |||
|
|||
/// Type that validates an [`ExecutionPayload`]. | |||
#[auto_impl::auto_impl(&, Arc)] | |||
pub trait PayloadValidator: Send + Sync + Unpin + 'static { | |||
pub trait PayloadValidator<State = ()>: Send + Sync + Unpin + 'static { |
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.
we likely don't need this generic if we make TreeCtx<'_, Self::Block>
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 believe it would be easier if TreeCtx
can hold a full state instance, so that we can call the new methods like validate_payload(payload, TreeCtx { state: &self.state})
if we make TreeCtx
generic over block this would be more difficult, or am i missing something?
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#s figure this out later
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 trait is now generic over N: NodePrimitives
d24e849
to
9ffce5b
Compare
9ffce5b
to
801520e
Compare
801520e
to
8c8c463
Compare
e8d32ea
to
cfb66da
Compare
8c8c463
to
22354ff
Compare
cfb66da
to
a18e6be
Compare
22354ff
to
92dd6c1
Compare
pub trait EngineValidator< | ||
Types: PayloadTypes, | ||
N: NodePrimitives = reth_ethereum_primitives::EthPrimitives, | ||
>: PayloadValidator<ExecutionData = Types::ExecutionData> |
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.
NodePrimitives
are already available as Types::BuiltPayload::Primitives
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.
awesome thx! done ptal
…neValidator trait
e1481b7
to
c139158
Compare
towards #17413
Adds new validation methods to the
EngineValidator
trait as a first step towards repurposing it for more flexible payload and block validation.validate_payload
andvalidate_block
methods with default implementations to maintain backward compatibility