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: Add more low-level methods to Executor #14440

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 12, 2025

It is possible to unify Executor and BatchExecutor. The only difference between them is that Executor::execute always consumes self not allowing for reuse of executor or inner State, and BatchExecutor exposes execute_and_verify_one which applies the state changes to &mut self.

This PR changes Executor to contain low-level execute_one and execute_one_with_state_hook which are similar to BatchExecutor::execute_and_verify_one. The only difference is that they do not perfom validation, and instead return BlockExecutionResult, containing receipts and requests which can be used for validation on callsite instead.

@klkvr klkvr force-pushed the klkvr/refactor-executor branch from 73d415f to c277b7e Compare February 12, 2025 10:35
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.

nice!

@mattsse mattsse added the A-sdk Related to reth's use as a library label Feb 12, 2025
@klkvr klkvr added this pull request to the merge queue Feb 12, 2025
Merged via the queue into main with commit 48bffd4 Feb 12, 2025
45 checks passed
@klkvr klkvr deleted the klkvr/refactor-executor branch February 12, 2025 11:27
frankudoags pushed a commit to frankudoags/reth that referenced this pull request Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants