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

refactor: implement BlockExecutionStrategyFactory directly on EvmConfig #14675

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 24, 2025

Towards #14571

Exposes BlockExecutionStrategyFactory implementation directly on EvmConfig thus fully encapsulating block and transaction execution semantics in it.

This allows all of the components holding EvmConfig to get access to pre/post execution changes and receipts construction implementation without additional generics

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.

awesome

Comment on lines -250 to -253
let chain_spec = ctx.chain_spec();
let evm_config = EthEvmConfig::new(ctx.chain_spec());
let strategy_factory = EthExecutionStrategyFactory::new(chain_spec, evm_config.clone());
let executor = BasicBlockExecutorProvider::new(strategy_factory);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@@ -191,7 +191,7 @@ pub trait BlockExecutionStrategy {
}

/// A strategy factory that can create block execution strategies.
pub trait BlockExecutionStrategyFactory: Send + Sync + Clone + Unpin + 'static {
pub trait BlockExecutionStrategyFactory: ConfigureEvmFor<Self::Primitives> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

hell yeah

@mattsse mattsse added M-changelog This change should be included in the changelog A-execution Related to the Execution and EVM A-sdk Related to reth's use as a library labels Feb 24, 2025
@klkvr klkvr added this pull request to the merge queue Feb 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2025
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 A-sdk Related to reth's use as a library M-changelog This change should be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants