mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
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:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user