-
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
feat(engine): invalid block hooks crate #10629
Conversation
…xey/invalid-block-hook-crate
…xey/invalid-block-hook-crate
3d4578d
to
773eb4b
Compare
Box::new(InvalidBlockHookChain( | ||
hook.to_selection() | ||
.into_iter() | ||
.map(|hook| match hook { | ||
reth_node_core::args::InvalidBlockHook::Witness => { | ||
Ok(Box::new(reth_invalid_block_hooks::witness) | ||
as Box<dyn InvalidBlockHook>) | ||
} | ||
reth_node_core::args::InvalidBlockHook::PreState | | ||
reth_node_core::args::InvalidBlockHook::Opcode => { | ||
eyre::bail!("invalid block hook {hook:?} is not implemented yet") | ||
} | ||
}) | ||
.collect::<Result<Vec<_>, _>>()?, | ||
)) |
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.
unsure where best to put this logic: we can't have it in the engine crate, as the whole point of decoupling is that we have hooks crate separate from the engine, and we also can't have it in the invalid-block-hooks
crate, because the InvalidBlockHook
trait lives in the engine crate.
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 should be moved into the LaunchCtx type
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.
some suggestions
Box::new(InvalidBlockHookChain( | ||
hook.to_selection() | ||
.into_iter() | ||
.map(|hook| match hook { | ||
reth_node_core::args::InvalidBlockHook::Witness => { | ||
Ok(Box::new(reth_invalid_block_hooks::witness) | ||
as Box<dyn InvalidBlockHook>) | ||
} | ||
reth_node_core::args::InvalidBlockHook::PreState | | ||
reth_node_core::args::InvalidBlockHook::Opcode => { | ||
eyre::bail!("invalid block hook {hook:?} is not implemented yet") | ||
} | ||
}) | ||
.collect::<Result<Vec<_>, _>>()?, | ||
)) |
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 should be moved into the LaunchCtx type
Closes #10546