diff --git a/Cargo.lock b/Cargo.lock index 9109b50d5..1bb9275dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6026,7 +6026,6 @@ dependencies = [ "reth-interfaces", "reth-metrics", "reth-primitives", - "reth-revm-primitives", "reth-rpc-types", "reth-rpc-types-compat", "reth-transaction-pool", @@ -6069,6 +6068,7 @@ dependencies = [ "rayon", "reth-codecs", "reth-primitives", + "revm", "revm-primitives", "secp256k1", "serde", @@ -6105,7 +6105,6 @@ dependencies = [ "reth-interfaces", "reth-nippy-jar", "reth-primitives", - "reth-revm-primitives", "reth-trie", "revm", "tempfile", @@ -6144,7 +6143,6 @@ dependencies = [ "reth-primitives", "reth-provider", "reth-revm-inspectors", - "reth-revm-primitives", "revm", "tracing", ] @@ -6165,14 +6163,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "reth-revm-primitives" -version = "0.1.0-alpha.10" -dependencies = [ - "reth-primitives", - "revm", -] - [[package]] name = "reth-rpc" version = "0.1.0-alpha.10" @@ -6434,7 +6424,6 @@ dependencies = [ "reth-metrics", "reth-primitives", "reth-provider", - "reth-revm-primitives", "reth-tasks", "revm", "serde", diff --git a/Cargo.toml b/Cargo.toml index 1100498a9..46a591017 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ members = [ "crates/primitives", "crates/prune", "crates/revm", - "crates/revm/revm-primitives", "crates/revm/revm-inspectors", "crates/rpc/ipc", "crates/rpc/rpc", diff --git a/crates/payload/basic/src/lib.rs b/crates/payload/basic/src/lib.rs index ff2db5d88..4d4feaa3b 100644 --- a/crates/payload/basic/src/lib.rs +++ b/crates/payload/basic/src/lib.rs @@ -25,14 +25,14 @@ use reth_primitives::{ eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE, EMPTY_RECEIPTS, EMPTY_TRANSACTIONS, EMPTY_WITHDRAWALS, ETHEREUM_BLOCK_GAS_LIMIT, RETH_CLIENT_VERSION, SLOT_DURATION, }, - proofs, Block, BlockNumberOrTag, Bytes, ChainSpec, Header, IntoRecoveredTransaction, Receipt, - Receipts, SealedBlock, Withdrawal, B256, EMPTY_OMMER_ROOT, U256, + proofs, + revm::{compat::into_reth_log, env::tx_env_with_recovered}, + Block, BlockNumberOrTag, Bytes, ChainSpec, Header, IntoRecoveredTransaction, Receipt, Receipts, + SealedBlock, Withdrawal, B256, EMPTY_OMMER_ROOT, U256, }; use reth_provider::{BlockReaderIdExt, BlockSource, BundleStateWithReceipts, StateProviderFactory}; use reth_revm::{ database::StateProviderDatabase, - env::tx_env_with_recovered, - into_reth_log, state_change::{apply_beacon_root_contract_call, post_block_withdrawals_balance_increments}, }; use reth_tasks::TaskSpawner; diff --git a/crates/payload/builder/Cargo.toml b/crates/payload/builder/Cargo.toml index 05c0abe01..164aea196 100644 --- a/crates/payload/builder/Cargo.toml +++ b/crates/payload/builder/Cargo.toml @@ -14,7 +14,6 @@ reth-primitives.workspace = true reth-rpc-types.workspace = true reth-transaction-pool.workspace = true reth-interfaces.workspace = true -reth-revm-primitives = { path = "../../revm/revm-primitives" } reth-rpc-types-compat.workspace = true ## ethereum diff --git a/crates/payload/builder/src/payload.rs b/crates/payload/builder/src/payload.rs index 519dadd71..f3d0f1f99 100644 --- a/crates/payload/builder/src/payload.rs +++ b/crates/payload/builder/src/payload.rs @@ -2,9 +2,9 @@ use alloy_rlp::Encodable; use reth_primitives::{ - Address, BlobTransactionSidecar, ChainSpec, Header, SealedBlock, Withdrawal, B256, U256, + revm::config::revm_spec_by_timestamp_after_merge, Address, BlobTransactionSidecar, ChainSpec, + Header, SealedBlock, Withdrawal, B256, U256, }; -use reth_revm_primitives::config::revm_spec_by_timestamp_after_merge; use reth_rpc_types::engine::{ ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadV1, PayloadAttributes, PayloadId, diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 5e2b457a0..005929ecb 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -65,6 +65,8 @@ proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } strum = { workspace = true, features = ["derive"] } +revm.workspace = true + [dev-dependencies] serde_json.workspace = true test-fuzz = "4" @@ -83,8 +85,8 @@ hash-db = "~0.15" reth-primitives = { path = ".", features = ["value-256"] } -# necessary so we don't hit a "undeclared 'std'": -# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198 +# necessary so we don't hit a "undeclared 'std'": +# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198 secp256k1.workspace = true criterion = "0.5" pprof = { version = "0.12", features = ["flamegraph", "frame-pointer", "criterion"] } diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index c82cf4c3f..a433a8789 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -39,6 +39,8 @@ mod precaution; pub mod proofs; mod prune; mod receipt; +/// Helpers for working with revm +pub mod revm; pub mod serde_helper; pub mod snapshot; pub mod stage; diff --git a/crates/revm/revm-primitives/src/compat.rs b/crates/primitives/src/revm/compat.rs similarity index 94% rename from crates/revm/revm-primitives/src/compat.rs rename to crates/primitives/src/revm/compat.rs index 07de35ae3..36c947149 100644 --- a/crates/revm/revm-primitives/src/compat.rs +++ b/crates/primitives/src/revm/compat.rs @@ -1,4 +1,4 @@ -use reth_primitives::{ +use crate::{ revm_primitives::{AccountInfo, Log}, Account, Address, Log as RethLog, TransactionKind, KECCAK_EMPTY, U256, }; @@ -8,7 +8,7 @@ use revm::{ }; /// Check equality between Revm and Reth `Log`s. -pub fn is_log_equal(revm_log: &Log, reth_log: &reth_primitives::Log) -> bool { +pub fn is_log_equal(revm_log: &Log, reth_log: &crate::Log) -> bool { revm_log.address == reth_log.address && revm_log.data == reth_log.data && revm_log.topics == reth_log.topics diff --git a/crates/revm/revm-primitives/src/config.rs b/crates/primitives/src/revm/config.rs similarity index 97% rename from crates/revm/revm-primitives/src/config.rs rename to crates/primitives/src/revm/config.rs index 209405c17..81920a6dc 100644 --- a/crates/revm/revm-primitives/src/config.rs +++ b/crates/primitives/src/revm/config.rs @@ -1,6 +1,4 @@ -//! Reth block execution/validation configuration and constants - -use reth_primitives::{revm_primitives, ChainSpec, Hardfork, Head}; +use crate::{revm_primitives, ChainSpec, Hardfork, Head}; /// Returns the spec id at the given timestamp. /// @@ -56,7 +54,7 @@ pub fn revm_spec(chain_spec: &ChainSpec, block: Head) -> revm_primitives::SpecId #[cfg(test)] mod tests { use super::*; - use reth_primitives::{ChainSpecBuilder, Head, MAINNET, U256}; + use crate::{ChainSpecBuilder, Head, MAINNET, U256}; #[test] fn test_to_revm_spec() { diff --git a/crates/revm/revm-primitives/src/env.rs b/crates/primitives/src/revm/env.rs similarity index 99% rename from crates/revm/revm-primitives/src/env.rs rename to crates/primitives/src/revm/env.rs index 3ad3a9475..2d71f01b1 100644 --- a/crates/revm/revm-primitives/src/env.rs +++ b/crates/primitives/src/revm/env.rs @@ -1,7 +1,7 @@ -use crate::config::revm_spec; -use reth_primitives::{ +use crate::{ constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS}, recover_signer, + revm::config::revm_spec, revm_primitives::{AnalysisKind, BlockEnv, CfgEnv, Env, SpecId, TransactTo, TxEnv}, Address, Bytes, Chain, ChainSpec, Head, Header, Transaction, TransactionKind, TransactionSignedEcRecovered, TxEip1559, TxEip2930, TxEip4844, TxLegacy, B256, U256, diff --git a/crates/primitives/src/revm/mod.rs b/crates/primitives/src/revm/mod.rs new file mode 100644 index 000000000..14bafa18e --- /dev/null +++ b/crates/primitives/src/revm/mod.rs @@ -0,0 +1,20 @@ +/// The `compat` module contains a set of utility functions that bridge the gap between Revm and +/// Reth Ethereum implementations. +/// +/// These functions enable the conversion of data structures between the two implementations, such +/// as converting `Log` structures, `AccountInfo`, and `Account` objects. +/// +/// Additionally, it provides a function to calculate intrinsic gas usage for transactions beyond +/// the Merge hardfork, offering compatibility for both Shanghai and Merge Ethereum specifications. +/// +/// These utilities facilitate interoperability and data exchange between Revm and Reth +/// implementations. +pub mod compat; +/// Reth block execution/validation configuration and constants +pub mod config; +/// The `env` module provides essential utilities for managing Ethereum transaction and block +/// environments. +/// +/// It includes functions to fill transaction and block environments with relevant data, handle +/// system contract calls, and recover the signer of Ethereum headers. +pub mod env; diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 6f57a6f06..54da247c2 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -13,7 +13,6 @@ description = "reth specific revm utilities" reth-primitives.workspace = true reth-interfaces.workspace = true reth-provider.workspace = true -reth-revm-primitives = { path = "./revm-primitives" } reth-revm-inspectors = { path = "./revm-inspectors" } reth-consensus-common = { path = "../consensus/common" } diff --git a/crates/revm/revm-primitives/Cargo.toml b/crates/revm/revm-primitives/Cargo.toml deleted file mode 100644 index ff3bc9f1f..000000000 --- a/crates/revm/revm-primitives/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "reth-revm-primitives" -version.workspace = true -edition.workspace = true -rust-version.workspace = true -license.workspace = true -homepage.workspace = true -repository.workspace = true -description = "core reth specific revm utilities" - -[dependencies] -# reth -reth-primitives.workspace = true -revm.workspace = true \ No newline at end of file diff --git a/crates/revm/revm-primitives/src/lib.rs b/crates/revm/revm-primitives/src/lib.rs deleted file mode 100644 index cc1c7bf20..000000000 --- a/crates/revm/revm-primitives/src/lib.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! Revm utils and implementations specific to reth. - -#![doc( - html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png", - html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", - issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" -)] -#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)] -#![deny(unused_must_use, rust_2018_idioms)] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] - -pub mod config; - -/// Helpers for configuring Revm [`Env`](reth_primitives::revm_primitives::Env). -pub mod env; - -/// Helpers for type compatibility between reth and revm types -mod compat; -pub use compat::*; diff --git a/crates/revm/src/lib.rs b/crates/revm/src/lib.rs index ab2e40923..b4aae09d0 100644 --- a/crates/revm/src/lib.rs +++ b/crates/revm/src/lib.rs @@ -26,8 +26,6 @@ pub use factory::Factory; /// reexport for convenience pub use reth_revm_inspectors::*; -/// reexport for convenience -pub use reth_revm_primitives::*; /// Re-export everything pub use revm::{self, *}; diff --git a/crates/revm/src/processor.rs b/crates/revm/src/processor.rs index 97cba016f..bc6cd89dd 100644 --- a/crates/revm/src/processor.rs +++ b/crates/revm/src/processor.rs @@ -1,8 +1,6 @@ use crate::{ database::StateProviderDatabase, - env::{fill_cfg_and_block_env, fill_tx_env}, eth_dao_fork::{DAO_HARDFORK_BENEFICIARY, DAO_HARDKFORK_ACCOUNTS}, - into_reth_log, stack::{InspectorStack, InspectorStackConfig}, state_change::{apply_beacon_root_contract_call, post_block_balance_increments}, }; @@ -11,6 +9,10 @@ use reth_interfaces::{ RethError, }; use reth_primitives::{ + revm::{ + compat::into_reth_log, + env::{fill_cfg_and_block_env, fill_tx_env}, + }, Address, Block, BlockNumber, Bloom, ChainSpec, Hardfork, Header, PruneMode, PruneModes, PruneSegmentError, Receipt, ReceiptWithBloom, Receipts, TransactionSigned, B256, MINIMUM_PRUNING_DISTANCE, U256, diff --git a/crates/revm/src/state_change.rs b/crates/revm/src/state_change.rs index 4ebe5b544..20a162acb 100644 --- a/crates/revm/src/state_change.rs +++ b/crates/revm/src/state_change.rs @@ -1,9 +1,9 @@ use reth_consensus_common::calc; use reth_interfaces::executor::{BlockExecutionError, BlockValidationError}; use reth_primitives::{ - constants::SYSTEM_ADDRESS, Address, ChainSpec, Header, Withdrawal, B256, U256, + constants::SYSTEM_ADDRESS, revm::env::fill_tx_env_with_beacon_root_contract_call, Address, + ChainSpec, Header, Withdrawal, B256, U256, }; -use reth_revm_primitives::env::fill_tx_env_with_beacon_root_contract_call; use revm::{primitives::ResultAndState, Database, DatabaseCommit, EVM}; use std::{collections::HashMap, fmt::Debug}; diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index c2b58a983..7fb6c3a8e 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -14,12 +14,12 @@ use alloy_rlp::{Decodable, Encodable}; use async_trait::async_trait; use jsonrpsee::core::RpcResult; use reth_primitives::{ - Account, Address, Block, BlockId, BlockNumberOrTag, Bytes, TransactionSigned, B256, + revm::env::tx_env_with_recovered, Account, Address, Block, BlockId, BlockNumberOrTag, Bytes, + TransactionSigned, B256, }; use reth_provider::{BlockReaderIdExt, HeaderProvider, StateProviderBox}; use reth_revm::{ database::{StateProviderDatabase, SubState}, - env::tx_env_with_recovered, tracing::{ js::{JsDbRequest, JsInspector}, FourByteInspector, TracingInspector, TracingInspectorConfig, diff --git a/crates/rpc/rpc/src/eth/api/call.rs b/crates/rpc/rpc/src/eth/api/call.rs index daafa306c..af18291a6 100644 --- a/crates/rpc/rpc/src/eth/api/call.rs +++ b/crates/rpc/rpc/src/eth/api/call.rs @@ -12,13 +12,11 @@ use crate::{ EthApi, }; use reth_network_api::NetworkInfo; -use reth_primitives::{BlockId, BlockNumberOrTag, Bytes, U256}; +use reth_primitives::{revm::env::tx_env_with_recovered, BlockId, BlockNumberOrTag, Bytes, U256}; use reth_provider::{ BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, StateProvider, StateProviderFactory, }; -use reth_revm::{ - access_list::AccessListInspector, database::StateProviderDatabase, env::tx_env_with_recovered, -}; +use reth_revm::{access_list::AccessListInspector, database::StateProviderDatabase}; use reth_rpc_types::{ state::StateOverride, AccessListWithGasUsed, BlockError, Bundle, CallRequest, EthCallResponse, StateContext, diff --git a/crates/rpc/rpc/src/eth/api/pending_block.rs b/crates/rpc/rpc/src/eth/api/pending_block.rs index 3476155a7..d2dc2da9a 100644 --- a/crates/rpc/rpc/src/eth/api/pending_block.rs +++ b/crates/rpc/rpc/src/eth/api/pending_block.rs @@ -4,14 +4,14 @@ use crate::eth::error::{EthApiError, EthResult}; use core::fmt::Debug; use reth_primitives::{ constants::{eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE}, - proofs, Block, BlockId, BlockNumberOrTag, ChainSpec, Header, IntoRecoveredTransaction, Receipt, + proofs, + revm::{compat::into_reth_log, env::tx_env_with_recovered}, + Block, BlockId, BlockNumberOrTag, ChainSpec, Header, IntoRecoveredTransaction, Receipt, Receipts, SealedBlock, SealedHeader, B256, EMPTY_OMMER_ROOT, U256, }; use reth_provider::{BundleStateWithReceipts, ChainSpecProvider, StateProviderFactory}; use reth_revm::{ database::StateProviderDatabase, - env::tx_env_with_recovered, - into_reth_log, state_change::{apply_beacon_root_contract_call, post_block_withdrawals_balance_increments}, }; use reth_transaction_pool::TransactionPool; diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index a15354ec3..7f7054fdf 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -15,6 +15,7 @@ use async_trait::async_trait; use reth_network_api::NetworkInfo; use reth_primitives::{ eip4844::calc_blob_gasprice, + revm::env::{fill_block_env_with_coinbase, tx_env_with_recovered}, Address, BlockId, BlockNumberOrTag, Bytes, FromRecoveredPooledTransaction, Header, IntoRecoveredTransaction, Receipt, SealedBlock, TransactionKind::{Call, Create}, @@ -25,7 +26,6 @@ use reth_provider::{ }; use reth_revm::{ database::StateProviderDatabase, - env::{fill_block_env_with_coinbase, tx_env_with_recovered}, tracing::{TracingInspector, TracingInspectorConfig}, }; use reth_rpc_types::{ diff --git a/crates/rpc/rpc/src/eth/revm_utils.rs b/crates/rpc/rpc/src/eth/revm_utils.rs index 50d4324a6..0d3c04229 100644 --- a/crates/rpc/rpc/src/eth/revm_utils.rs +++ b/crates/rpc/rpc/src/eth/revm_utils.rs @@ -2,9 +2,9 @@ use crate::eth::error::{EthApiError, EthResult, RpcInvalidTransactionError}; use reth_primitives::{ + revm::env::{fill_tx_env, fill_tx_env_with_recovered}, AccessList, Address, TransactionSigned, TransactionSignedEcRecovered, TxHash, B256, U256, }; -use reth_revm::env::{fill_tx_env, fill_tx_env_with_recovered}; use reth_rpc_types::{ state::{AccountOverride, StateOverride}, BlockOverrides, CallRequest, diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index 54cca2012..f562b4555 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -10,11 +10,12 @@ use crate::{ use async_trait::async_trait; use jsonrpsee::core::RpcResult as Result; use reth_consensus_common::calc::{base_block_reward, block_reward}; -use reth_primitives::{BlockId, BlockNumberOrTag, Bytes, SealedHeader, B256, U256}; +use reth_primitives::{ + revm::env::tx_env_with_recovered, BlockId, BlockNumberOrTag, Bytes, SealedHeader, B256, U256, +}; use reth_provider::{BlockReader, ChainSpecProvider, EvmEnvProvider, StateProviderFactory}; use reth_revm::{ database::StateProviderDatabase, - env::tx_env_with_recovered, tracing::{parity::populate_state_diff, TracingInspector, TracingInspectorConfig}, }; use reth_rpc_api::TraceApiServer; diff --git a/crates/storage/codecs/Cargo.toml b/crates/storage/codecs/Cargo.toml index e00ba69d8..0d43ff82e 100644 --- a/crates/storage/codecs/Cargo.toml +++ b/crates/storage/codecs/Cargo.toml @@ -28,7 +28,6 @@ proptest-derive = { workspace = true, optional = true } [dev-dependencies] revm-primitives = { workspace = true, features = ["serde", "arbitrary"] } - serde = "1.0" modular-bitfield = "0.11.2" test-fuzz = "4" diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 2be95fce1..c8c7b4fcb 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -12,7 +12,6 @@ description = "Reth storage provider." # reth reth-primitives.workspace = true reth-interfaces.workspace = true -reth-revm-primitives = { path = "../../revm/revm-primitives" } reth-db.workspace = true reth-trie = { path = "../../trie" } reth-nippy-jar = { path = "../nippy-jar" } diff --git a/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs b/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs index 96856591d..eb998cc43 100644 --- a/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs +++ b/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs @@ -6,10 +6,11 @@ use reth_db::{ }; use reth_interfaces::db::DatabaseError; use reth_primitives::{ - keccak256, logs_bloom, Account, Address, BlockNumber, Bloom, Bytecode, Log, Receipt, Receipts, - StorageEntry, B256, U256, + keccak256, logs_bloom, + revm::compat::{into_reth_acc, into_revm_acc}, + Account, Address, BlockNumber, Bloom, Bytecode, Log, Receipt, Receipts, StorageEntry, B256, + U256, }; -use reth_revm_primitives::{into_reth_acc, into_revm_acc}; use reth_trie::{ hashed_cursor::{HashedPostState, HashedPostStateCursorFactory, HashedStorage}, StateRoot, StateRootError, @@ -381,8 +382,9 @@ mod tests { transaction::DbTx, DatabaseEnv, }; - use reth_primitives::{Address, Receipt, Receipts, StorageEntry, B256, MAINNET, U256}; - use reth_revm_primitives::into_reth_acc; + use reth_primitives::{ + revm::compat::into_reth_acc, Address, Receipt, Receipts, StorageEntry, B256, MAINNET, U256, + }; use revm::{ db::{ states::{ diff --git a/crates/storage/provider/src/bundle_state/state_changes.rs b/crates/storage/provider/src/bundle_state/state_changes.rs index 65be37dc9..765fc0ee2 100644 --- a/crates/storage/provider/src/bundle_state/state_changes.rs +++ b/crates/storage/provider/src/bundle_state/state_changes.rs @@ -5,8 +5,7 @@ use reth_db::{ transaction::{DbTx, DbTxMut}, }; use reth_interfaces::db::DatabaseError; -use reth_primitives::{Bytecode, StorageEntry, U256}; -use reth_revm_primitives::into_reth_acc; +use reth_primitives::{revm::compat::into_reth_acc, Bytecode, StorageEntry, U256}; use revm::db::states::{PlainStorageChangeset, StateChangeset}; /// A change to the state of the world. diff --git a/crates/storage/provider/src/bundle_state/state_reverts.rs b/crates/storage/provider/src/bundle_state/state_reverts.rs index 0d1b897ae..8b7d5c7c2 100644 --- a/crates/storage/provider/src/bundle_state/state_reverts.rs +++ b/crates/storage/provider/src/bundle_state/state_reverts.rs @@ -6,8 +6,7 @@ use reth_db::{ transaction::{DbTx, DbTxMut}, }; use reth_interfaces::db::DatabaseError; -use reth_primitives::{BlockNumber, StorageEntry, B256, U256}; -use reth_revm_primitives::into_reth_acc; +use reth_primitives::{revm::compat::into_reth_acc, BlockNumber, StorageEntry, B256, U256}; use revm::db::states::{PlainStateReverts, PlainStorageRevert, RevertToSlot}; use std::iter::Peekable; diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index b78483e49..7208c12d7 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -28,6 +28,10 @@ use reth_interfaces::{ }; use reth_primitives::{ keccak256, + revm::{ + config::revm_spec, + env::{fill_block_env, fill_cfg_and_block_env, fill_cfg_env}, + }, stage::{StageCheckpoint, StageId}, trie::Nibbles, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, @@ -36,10 +40,6 @@ use reth_primitives::{ TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, B256, U256, }; -use reth_revm_primitives::{ - config::revm_spec, - env::{fill_block_env, fill_cfg_and_block_env, fill_cfg_env}, -}; use reth_trie::{prefix_set::PrefixSetMut, StateRoot}; use revm::primitives::{BlockEnv, CfgEnv, SpecId}; use std::{ diff --git a/crates/transaction-pool/Cargo.toml b/crates/transaction-pool/Cargo.toml index f6f5ab97b..e9aceb9a9 100644 --- a/crates/transaction-pool/Cargo.toml +++ b/crates/transaction-pool/Cargo.toml @@ -23,7 +23,6 @@ reth-provider.workspace = true reth-interfaces.workspace = true reth-tasks.workspace = true revm.workspace = true -reth-revm-primitives = { path = "../revm/revm-primitives" } alloy-rlp.workspace = true # async/futures diff --git a/crates/transaction-pool/src/validate/eth.rs b/crates/transaction-pool/src/validate/eth.rs index 1c26cb3d0..30500c4f3 100644 --- a/crates/transaction-pool/src/validate/eth.rs +++ b/crates/transaction-pool/src/validate/eth.rs @@ -14,11 +14,11 @@ use reth_primitives::{ ETHEREUM_BLOCK_GAS_LIMIT, }, kzg::KzgSettings, + revm::compat::calculate_intrinsic_gas_after_merge, ChainSpec, InvalidTransactionError, SealedBlock, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID, }; use reth_provider::{AccountReader, StateProviderFactory}; -use reth_revm_primitives::calculate_intrinsic_gas_after_merge; use reth_tasks::TaskSpawner; use std::{ marker::PhantomData, diff --git a/docs/repo/layout.md b/docs/repo/layout.md index 8418518fb..d7e0c430a 100644 --- a/docs/repo/layout.md +++ b/docs/repo/layout.md @@ -4,13 +4,24 @@ This repository contains several Rust crates that implement the different buildi Generally reth is composed of a few components, with supporting crates. The main components can be defined as: -- [Storage](#storage) -- [Networking](#networking) -- [Consensus](#consensus) -- [Execution](#execution) -- [Sync](#sync) -- [RPC](#rpc) -- [Payloads](#payloads) +- [Project Layout](#project-layout) + - [Documentation](#documentation) + - [Binaries](#binaries) + - [Storage](#storage) + - [Networking](#networking) + - [Common](#common) + - [Discovery](#discovery) + - [Protocol](#protocol) + - [Downloaders](#downloaders) + - [Consensus](#consensus) + - [Execution](#execution) + - [Sync](#sync) + - [RPC](#rpc) + - [Transports](#transports) + - [Common](#common-1) + - [Payloads](#payloads) + - [Primitives](#primitives) + - [Misc](#misc) The supporting crates are split into two categories: [primitives](#primitives) and [miscellaneous](#misc). @@ -78,7 +89,6 @@ Crates related to transaction execution. - [`revm`](../../crates/revm): An implementation of an executor using `revm` - [`revm/revm-inspectors`](../../crates/revm/revm-inspectors): Various revm inspectors for debugging and building traces for the trace-related RPC APIs. -- [`revm/revm-primitives`](../../crates/revm/revm-primitives): A crate for handling revm-reth type conversion ### Sync @@ -152,4 +162,4 @@ Small utility crates. [jsonrpsee]: https://github.com/paritytech/jsonrpsee/ [tracing]: https://crates.io/crates/tracing [eip-1459]: https://eips.ethereum.org/EIPS/eip-1459 -[engine-spec]: https://github.com/ethereum/execution-apis/tree/main/src/engine \ No newline at end of file +[engine-spec]: https://github.com/ethereum/execution-apis/tree/main/src/engine