Skip to content
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

Merged
merged 27 commits into from
Sep 3, 2024
Merged

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Aug 30, 2024

Closes #10546

@rkrasiuk rkrasiuk added C-enhancement New feature or request A-consensus Related to the consensus engine labels Sep 2, 2024
@shekhirin shekhirin force-pushed the alexey/invalid-block-hook-crate branch from 3d4578d to 773eb4b Compare September 2, 2024 09:15
Comment on lines 209 to 223
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<_>, _>>()?,
))
Copy link
Collaborator Author

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.

Copy link
Collaborator

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

@shekhirin shekhirin marked this pull request as ready for review September 3, 2024 12:31
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some suggestions

crates/engine/tree/src/tree/invalid_block_hook.rs Outdated Show resolved Hide resolved
crates/engine/tree/src/tree/invalid_block_hook.rs Outdated Show resolved Hide resolved
Comment on lines 209 to 223
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<_>, _>>()?,
))
Copy link
Collaborator

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

crates/node/builder/src/launch/engine.rs Outdated Show resolved Hide resolved
Base automatically changed from dan/invalid-block-hook to main September 3, 2024 14:12
crates/node/builder/src/launch/common.rs Outdated Show resolved Hide resolved
crates/node/builder/src/launch/common.rs Outdated Show resolved Hide resolved
@shekhirin shekhirin added this pull request to the merge queue Sep 3, 2024
Merged via the queue into main with commit 9d46b06 Sep 3, 2024
36 checks passed
@shekhirin shekhirin deleted the alexey/invalid-block-hook-crate branch September 3, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants