Skip to content

Commit

Permalink
Merge branch 'main' into matt/bump-revm-alloy-prim
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Sep 26, 2024
2 parents f9fcbae + 20d6950 commit 41cf314
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 26 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ reth-storage-errors.workspace = true
reth-execution-types.workspace = true

revm.workspace = true

# alloy
alloy-primitives.workspace = true
alloy-eips.workspace = true

auto_impl.workspace = true
futures-util.workspace = true
metrics = { workspace = true, optional = true }
Expand Down
4 changes: 4 additions & 0 deletions crates/evm/execution-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ reth-trie.workspace = true

revm.workspace = true

# alloy
alloy-primitives.workspace = true
alloy-eips.workspace = true

serde = { workspace = true, optional = true }

[dev-dependencies]
Expand Down
9 changes: 6 additions & 3 deletions crates/evm/execution-types/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

use crate::ExecutionOutcome;
use alloc::{borrow::Cow, collections::BTreeMap};
use alloy_eips::{eip1898::ForkBlock, BlockNumHash};
use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash};
use core::{fmt, ops::RangeInclusive};
use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError};
use reth_primitives::{
Address, BlockHash, BlockNumHash, BlockNumber, ForkBlock, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, TxHash,
Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionSigned,
TransactionSignedEcRecovered,
};
use reth_trie::updates::TrieUpdates;
use revm::db::BundleState;
Expand Down Expand Up @@ -508,7 +510,8 @@ pub enum ChainSplit {
#[cfg(test)]
mod tests {
use super::*;
use reth_primitives::{Receipt, Receipts, TxType, B256};
use alloy_primitives::B256;
use reth_primitives::{Receipt, Receipts, TxType};
use revm::primitives::{AccountInfo, HashMap};

#[test]
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/execution-types/src/execute.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use reth_primitives::{Request, U256};
use alloy_primitives::U256;
use reth_primitives::Request;
use revm::db::BundleState;

/// A helper type for ethereum block inputs that consists of a block and the total difficulty.
Expand Down
10 changes: 4 additions & 6 deletions crates/evm/execution-types/src/execution_outcome.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::BlockExecutionOutput;
use reth_primitives::{
logs_bloom, Account, Address, BlockNumber, Bloom, Bytecode, Log, Receipt, Receipts, Requests,
StorageEntry, B256, U256,
};
use alloy_primitives::{Address, BlockNumber, Bloom, Log, B256, U256};
use reth_primitives::{logs_bloom, Account, Bytecode, Receipt, Receipts, Requests, StorageEntry};
use reth_trie::HashedPostState;
use revm::{
db::{states::BundleState, BundleAccount},
Expand Down Expand Up @@ -371,8 +369,8 @@ impl From<(BlockExecutionOutput<Receipt>, BlockNumber)> for ExecutionOutcome {
mod tests {
use super::*;
use alloy_eips::{eip6110::DepositRequest, eip7002::WithdrawalRequest};
use alloy_primitives::{FixedBytes, LogData};
use reth_primitives::{Address, Receipts, Request, Requests, TxType, B256};
use alloy_primitives::{Address, FixedBytes, LogData, B256};
use reth_primitives::{Receipts, Request, Requests, TxType};
use std::collections::HashMap;

#[test]
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/src/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use core::fmt::Display;

use crate::execute::{BatchExecutor, BlockExecutorProvider, Executor};
use alloy_primitives::BlockNumber;
use reth_execution_errors::BlockExecutionError;
use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_primitives::{BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderError;
use revm_primitives::db::Database;
Expand Down
5 changes: 3 additions & 2 deletions crates/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pub use reth_execution_errors::{BlockExecutionError, BlockValidationError};
pub use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome};
pub use reth_storage_errors::provider::ProviderError;

use alloy_primitives::BlockNumber;
use core::fmt::Display;
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_primitives::{BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use revm::State;
use revm_primitives::db::Database;
Expand Down Expand Up @@ -151,8 +152,8 @@ pub trait BlockExecutorProvider: Send + Sync + Clone + Unpin + 'static {
#[cfg(test)]
mod tests {
use super::*;
use alloy_primitives::U256;
use revm::db::{CacheDB, EmptyDBTyped};
use revm_primitives::U256;
use std::marker::PhantomData;

#[derive(Clone, Default)]
Expand Down
7 changes: 3 additions & 4 deletions crates/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ extern crate alloc;
use core::ops::Deref;

use crate::builder::RethEvmBuilder;
use reth_primitives::{Address, TransactionSigned, TransactionSignedEcRecovered, B256, U256};
use alloy_primitives::{Address, Bytes, B256, U256};
use reth_primitives::{TransactionSigned, TransactionSignedEcRecovered};
use reth_primitives_traits::BlockHeader;
use revm::{Database, Evm, GetInspector};
use revm_primitives::{
BlockEnv, Bytes, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, SpecId, TxEnv,
};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, SpecId, TxEnv};

pub mod builder;
pub mod either;
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/src/noop.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//! A no operation block executor implementation.

use alloy_primitives::BlockNumber;
use core::fmt::Display;
use reth_execution_errors::BlockExecutionError;
use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, ExecutionOutcome};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_primitives::{BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderError;
use revm::State;
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Provider trait for populating the EVM environment.

use crate::ConfigureEvmEnv;
use reth_primitives::{BlockHashOrNumber, Header};
use alloy_eips::eip1898::BlockHashOrNumber;
use reth_primitives::Header;
use reth_storage_errors::provider::ProviderResult;
use revm::primitives::{BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, SpecId};

Expand Down
3 changes: 2 additions & 1 deletion crates/evm/src/system_calls/eip2935.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ use alloc::{boxed::Box, string::ToString};
use alloy_eips::eip2935::HISTORY_STORAGE_ADDRESS;

use crate::ConfigureEvm;
use alloy_primitives::B256;
use core::fmt::Display;
use reth_chainspec::EthereumHardforks;
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_primitives::Header;
use revm::{interpreter::Host, Database, DatabaseCommit, Evm};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState, B256};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState};

/// Apply the [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) pre block contract call.
///
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/src/system_calls/eip4788.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ use alloc::{boxed::Box, string::ToString};

use crate::ConfigureEvm;
use alloy_eips::eip4788::BEACON_ROOTS_ADDRESS;
use alloy_primitives::B256;
use reth_chainspec::EthereumHardforks;
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_primitives::Header;
use revm::{interpreter::Host, Database, DatabaseCommit, Evm};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState, B256};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState};

/// Apply the [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) pre block contract call.
///
Expand Down
4 changes: 2 additions & 2 deletions crates/evm/src/system_calls/eip7002.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use core::fmt::Display;

use crate::ConfigureEvm;
use alloy_eips::eip7002::{WithdrawalRequest, WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS};
use alloy_primitives::{Address, Bytes, FixedBytes};
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_primitives::{Buf, Header, Request};
use revm::{interpreter::Host, Database, DatabaseCommit, Evm};
use revm_primitives::{
Address, BlockEnv, Bytes, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, FixedBytes,
ResultAndState,
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, ResultAndState,
};

/// Apply the [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002) post block contract call.
Expand Down
4 changes: 2 additions & 2 deletions crates/evm/src/system_calls/eip7251.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use core::fmt::Display;

use crate::ConfigureEvm;
use alloy_eips::eip7251::{ConsolidationRequest, CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS};
use alloy_primitives::{Address, Bytes, FixedBytes};
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_primitives::{Buf, Header, Request};
use revm::{interpreter::Host, Database, DatabaseCommit, Evm};
use revm_primitives::{
Address, BlockEnv, Bytes, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, FixedBytes,
ResultAndState,
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, ResultAndState,
};

/// Apply the [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251) post block contract call.
Expand Down
3 changes: 2 additions & 1 deletion crates/evm/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
use crate::execute::{
BatchExecutor, BlockExecutionInput, BlockExecutionOutput, BlockExecutorProvider, Executor,
};
use alloy_primitives::BlockNumber;
use parking_lot::Mutex;
use reth_execution_errors::BlockExecutionError;
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_primitives::{BlockWithSenders, Receipt};
use reth_prune_types::PruneModes;
use reth_storage_errors::provider::ProviderError;
use revm::State;
Expand Down

0 comments on commit 41cf314

Please sign in to comment.