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: default impl for some BlockExecutionStrategy methods #11941

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

fgimenez
Copy link
Member

@fgimenez fgimenez commented Oct 21, 2024

The implemented methods are:

  • finish: full implementation taking advantage of state_mut.
  • with_state_hook: empty, no state hook by default.
  • validate_block_post_execution: empty, no validation on batch executor by default.

@fgimenez fgimenez added the A-execution Related to the Execution and EVM label Oct 21, 2024
@fgimenez fgimenez changed the title feat: default impl for BlockExecutionStrategy methods feat: default impl for some BlockExecutionStrategy methods Oct 21, 2024
@@ -209,18 +213,23 @@ pub trait BlockExecutionStrategy<DB> {
fn state_mut(&mut self) -> &mut State<DB>;

/// Sets a hook to be called after each state change during execution.
fn with_state_hook(&mut self, hook: Option<Box<dyn OnStateHook>>);
fn with_state_hook(&mut self, _hook: Option<Box<dyn OnStateHook>>) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this a bit weird that we allow this if the hook can be ignored.
but I think for now this is okay.

@fgimenez fgimenez added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit d9d184d Oct 21, 2024
39 checks passed
@fgimenez fgimenez deleted the fgimenez/default-impl-ex-strategy-methods branch October 21, 2024 19:03
@fgimenez fgimenez restored the fgimenez/default-impl-ex-strategy-methods branch October 21, 2024 19:05
@fgimenez fgimenez deleted the fgimenez/default-impl-ex-strategy-methods branch October 21, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants