From b8e8ce1f40be832f74116fe72b4701cdf74f18cb Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Fri, 31 May 2024 16:20:18 +0100 Subject: [PATCH] fix(evm): validate requests in block post-execution (#8529) --- Cargo.lock | 1 - crates/ethereum/evm/Cargo.toml | 1 - crates/ethereum/evm/src/eip6110.rs | 3 +-- crates/ethereum/evm/src/execute.rs | 7 ++++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5a6799e4..07e8aa54b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6837,7 +6837,6 @@ dependencies = [ name = "reth-evm-ethereum" version = "0.2.0-beta.7" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=7320d4c)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=7320d4c)", "alloy-sol-types", "reth-ethereum-consensus", diff --git a/crates/ethereum/evm/Cargo.toml b/crates/ethereum/evm/Cargo.toml index 815881d45..17b2dbd0b 100644 --- a/crates/ethereum/evm/Cargo.toml +++ b/crates/ethereum/evm/Cargo.toml @@ -21,7 +21,6 @@ reth-ethereum-consensus.workspace = true revm-primitives.workspace = true # Alloy -alloy-consensus.workspace = true alloy-eips.workspace = true alloy-sol-types.workspace = true diff --git a/crates/ethereum/evm/src/eip6110.rs b/crates/ethereum/evm/src/eip6110.rs index 2251a1d0e..0df99a997 100644 --- a/crates/ethereum/evm/src/eip6110.rs +++ b/crates/ethereum/evm/src/eip6110.rs @@ -1,9 +1,8 @@ //! EIP-6110 deposit requests parsing -use alloy_consensus::Request; use alloy_eips::eip6110::{DepositRequest, MAINNET_DEPOSIT_CONTRACT_ADDRESS}; use alloy_sol_types::{sol, SolEvent}; use reth_evm::execute::BlockValidationError; -use reth_primitives::{ChainSpec, Receipt}; +use reth_primitives::{ChainSpec, Receipt, Request}; use revm_primitives::Log; sol! { diff --git a/crates/ethereum/evm/src/execute.rs b/crates/ethereum/evm/src/execute.rs index 9d81358d8..397653e31 100644 --- a/crates/ethereum/evm/src/execute.rs +++ b/crates/ethereum/evm/src/execute.rs @@ -412,7 +412,7 @@ where let EthExecuteOutput { receipts, requests, gas_used: _ } = self.executor.execute_without_verification(block, total_difficulty)?; - validate_block_post_execution(block, self.executor.chain_spec(), &receipts, &[])?; + validate_block_post_execution(block, self.executor.chain_spec(), &receipts, &requests)?; // prepare the state according to the prune mode let retention = self.batch_record.bundle_retention(block.number); @@ -460,8 +460,9 @@ mod tests { eip7002::{WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS, WITHDRAWAL_REQUEST_PREDEPLOY_CODE}, }; use reth_primitives::{ - constants::ETH_TO_WEI, keccak256, public_key_to_address, trie::EMPTY_ROOT_HASH, Account, - Block, ChainSpecBuilder, ForkCondition, Transaction, TxKind, TxLegacy, B256, + constants::{EMPTY_ROOT_HASH, ETH_TO_WEI}, + keccak256, public_key_to_address, Account, Block, ChainSpecBuilder, ForkCondition, + Transaction, TxKind, TxLegacy, B256, }; use reth_revm::{ database::StateProviderDatabase, state_change::HISTORY_SERVE_WINDOW,