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

core, rpcdaemon: unify ExecutionProcessor and EVMExecutor #2364

Merged

Conversation

bzawisto
Copy link
Contributor

@bzawisto bzawisto commented Sep 19, 2024

This PR unifies (to some extent) the code that was duplicated in EVMExecutor and ExecutionProcessor. Some bits still require different implementation, but at least the logic is kept in a single place (in both validation.cpp and processor.cpp). Two tests have to be updated due to slightly different access pattern for retrieving balance.

@bzawisto bzawisto linked an issue Sep 19, 2024 that may be closed by this pull request
@bzawisto bzawisto marked this pull request as draft September 19, 2024 08:43
@bzawisto bzawisto force-pushed the 2304-deduplicate-code-in-rpcevmexecutor-and-executionprocessor branch from da0dc1a to 95e8c9c Compare October 1, 2024 09:34
@bzawisto bzawisto marked this pull request as ready for review October 1, 2024 09:59
@bzawisto bzawisto requested a review from canepat October 1, 2024 09:59
@JacekGlen JacekGlen changed the title Unify ExecutionProcessor and EVMExecutor core: unify ExecutionProcessor and EVMExecutor Oct 3, 2024
@@ -53,6 +55,8 @@ class ExecutionProcessor {

EVM& evm() noexcept { return evm_; }
const EVM& evm() const noexcept { return evm_; }
IntraBlockState& get_ibs_state() { return state_; }
void reset();
Copy link
Member

Choose a reason for hiding this comment

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

Some nitpicking here:

  1. we should rename get_ibs_state as intra_block_state both here and in EVMExecutor
  2. given that IntraBlockState is already exported, maybe it's better to avoid reset altogether and just call intra_block_state().clear_journal_and_substate()

None of these changes is necessary in this PR.

@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Oct 4, 2024
@canepat canepat changed the title core: unify ExecutionProcessor and EVMExecutor core, rpcdaemon: unify ExecutionProcessor and EVMExecutor Oct 4, 2024
@canepat canepat merged commit 6ad54da into master Oct 4, 2024
5 checks passed
@canepat canepat deleted the 2304-deduplicate-code-in-rpcevmexecutor-and-executionprocessor branch October 4, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deduplicate code in rpc::EVMExecutor and ExecutionProcessor
2 participants