fix(evm): validate requests in block post-execution (#8529)

This commit is contained in:
Alexey Shekhirin
2024-05-31 16:20:18 +01:00
committed by GitHub
parent 256f6a954d
commit b8e8ce1f40
4 changed files with 5 additions and 7 deletions

1
Cargo.lock generated
View File

@ -6837,7 +6837,6 @@ dependencies = [
name = "reth-evm-ethereum" name = "reth-evm-ethereum"
version = "0.2.0-beta.7" version = "0.2.0-beta.7"
dependencies = [ 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-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=7320d4c)",
"alloy-sol-types", "alloy-sol-types",
"reth-ethereum-consensus", "reth-ethereum-consensus",

View File

@ -21,7 +21,6 @@ reth-ethereum-consensus.workspace = true
revm-primitives.workspace = true revm-primitives.workspace = true
# Alloy # Alloy
alloy-consensus.workspace = true
alloy-eips.workspace = true alloy-eips.workspace = true
alloy-sol-types.workspace = true alloy-sol-types.workspace = true

View File

@ -1,9 +1,8 @@
//! EIP-6110 deposit requests parsing //! EIP-6110 deposit requests parsing
use alloy_consensus::Request;
use alloy_eips::eip6110::{DepositRequest, MAINNET_DEPOSIT_CONTRACT_ADDRESS}; use alloy_eips::eip6110::{DepositRequest, MAINNET_DEPOSIT_CONTRACT_ADDRESS};
use alloy_sol_types::{sol, SolEvent}; use alloy_sol_types::{sol, SolEvent};
use reth_evm::execute::BlockValidationError; use reth_evm::execute::BlockValidationError;
use reth_primitives::{ChainSpec, Receipt}; use reth_primitives::{ChainSpec, Receipt, Request};
use revm_primitives::Log; use revm_primitives::Log;
sol! { sol! {

View File

@ -412,7 +412,7 @@ where
let EthExecuteOutput { receipts, requests, gas_used: _ } = let EthExecuteOutput { receipts, requests, gas_used: _ } =
self.executor.execute_without_verification(block, total_difficulty)?; 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 // prepare the state according to the prune mode
let retention = self.batch_record.bundle_retention(block.number); let retention = self.batch_record.bundle_retention(block.number);
@ -460,8 +460,9 @@ mod tests {
eip7002::{WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS, WITHDRAWAL_REQUEST_PREDEPLOY_CODE}, eip7002::{WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS, WITHDRAWAL_REQUEST_PREDEPLOY_CODE},
}; };
use reth_primitives::{ use reth_primitives::{
constants::ETH_TO_WEI, keccak256, public_key_to_address, trie::EMPTY_ROOT_HASH, Account, constants::{EMPTY_ROOT_HASH, ETH_TO_WEI},
Block, ChainSpecBuilder, ForkCondition, Transaction, TxKind, TxLegacy, B256, keccak256, public_key_to_address, Account, Block, ChainSpecBuilder, ForkCondition,
Transaction, TxKind, TxLegacy, B256,
}; };
use reth_revm::{ use reth_revm::{
database::StateProviderDatabase, state_change::HISTORY_SERVE_WINDOW, database::StateProviderDatabase, state_change::HISTORY_SERVE_WINDOW,