feat: alloy-evm and new revm integration (#14021)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: rakita <rakita@users.noreply.github.com>
This commit is contained in:
Arsenii Kulikov
2025-02-17 23:59:23 +04:00
committed by GitHub
parent bb6dec7ceb
commit 336c3d1fac
142 changed files with 1841 additions and 1929 deletions

View File

@@ -4,10 +4,7 @@ use alloy_primitives::{
Address, B256, U256,
};
use core::cell::RefCell;
use revm::primitives::{
db::{Database, DatabaseRef},
AccountInfo, Bytecode,
};
use revm::{bytecode::Bytecode, state::AccountInfo, Database, DatabaseRef};
/// A container type that caches reads from an underlying [`DatabaseRef`].
///
@@ -17,8 +14,7 @@ use revm::primitives::{
/// # Example
///
/// ```
/// use reth_revm::cached::CachedReads;
/// use revm::db::{DatabaseRef, State};
/// use reth_revm::{cached::CachedReads, DatabaseRef, db::State};
///
/// fn build_payload<DB: DatabaseRef>(db: DB) {
/// let mut cached_reads = CachedReads::default();

View File

@@ -4,11 +4,7 @@ use core::ops::{Deref, DerefMut};
use reth_primitives_traits::Account;
use reth_storage_api::{AccountReader, BlockHashReader, StateProvider};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use revm::{
db::DatabaseRef,
primitives::{AccountInfo, Bytecode},
Database,
};
use revm::{bytecode::Bytecode, state::AccountInfo, Database, DatabaseRef};
/// A helper trait responsible for providing state necessary for EVM execution.
///

View File

@@ -1,8 +1,5 @@
use alloy_primitives::{Address, B256, U256};
use revm::{
primitives::{AccountInfo, Bytecode},
Database,
};
use revm::{bytecode::Bytecode, state::AccountInfo, Database};
/// An enum type that can hold either of two different [`Database`] implementations.
///

View File

@@ -21,6 +21,9 @@ pub mod cancelled;
/// Contains glue code for integrating reth database into revm's [Database].
pub mod database;
pub use revm_database as db;
pub use revm_inspector as inspector;
/// Common test helpers
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;

View File

@@ -151,7 +151,7 @@ impl StateProofProvider for StateProviderTest {
}
impl HashedPostStateProvider for StateProviderTest {
fn hashed_post_state(&self, bundle_state: &revm::db::BundleState) -> HashedPostState {
fn hashed_post_state(&self, bundle_state: &revm_database::BundleState) -> HashedPostState {
HashedPostState::from_bundle_state::<KeccakKeyHasher>(bundle_state.state())
}
}

View File

@@ -1,6 +1,6 @@
use alloy_primitives::{keccak256, map::B256Map, Bytes, B256};
use reth_trie::{HashedPostState, HashedStorage};
use revm::State;
use revm_database::State;
/// Tracks state changes during execution.
#[derive(Debug, Clone, Default)]