mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(primitives): move revm-primitives to reth-primitives (#5088)
This commit is contained in:
13
Cargo.lock
generated
13
Cargo.lock
generated
@ -6026,7 +6026,6 @@ dependencies = [
|
|||||||
"reth-interfaces",
|
"reth-interfaces",
|
||||||
"reth-metrics",
|
"reth-metrics",
|
||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
"reth-revm-primitives",
|
|
||||||
"reth-rpc-types",
|
"reth-rpc-types",
|
||||||
"reth-rpc-types-compat",
|
"reth-rpc-types-compat",
|
||||||
"reth-transaction-pool",
|
"reth-transaction-pool",
|
||||||
@ -6069,6 +6068,7 @@ dependencies = [
|
|||||||
"rayon",
|
"rayon",
|
||||||
"reth-codecs",
|
"reth-codecs",
|
||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
|
"revm",
|
||||||
"revm-primitives",
|
"revm-primitives",
|
||||||
"secp256k1",
|
"secp256k1",
|
||||||
"serde",
|
"serde",
|
||||||
@ -6105,7 +6105,6 @@ dependencies = [
|
|||||||
"reth-interfaces",
|
"reth-interfaces",
|
||||||
"reth-nippy-jar",
|
"reth-nippy-jar",
|
||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
"reth-revm-primitives",
|
|
||||||
"reth-trie",
|
"reth-trie",
|
||||||
"revm",
|
"revm",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
@ -6144,7 +6143,6 @@ dependencies = [
|
|||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
"reth-provider",
|
"reth-provider",
|
||||||
"reth-revm-inspectors",
|
"reth-revm-inspectors",
|
||||||
"reth-revm-primitives",
|
|
||||||
"revm",
|
"revm",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
@ -6165,14 +6163,6 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "reth-revm-primitives"
|
|
||||||
version = "0.1.0-alpha.10"
|
|
||||||
dependencies = [
|
|
||||||
"reth-primitives",
|
|
||||||
"revm",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reth-rpc"
|
name = "reth-rpc"
|
||||||
version = "0.1.0-alpha.10"
|
version = "0.1.0-alpha.10"
|
||||||
@ -6434,7 +6424,6 @@ dependencies = [
|
|||||||
"reth-metrics",
|
"reth-metrics",
|
||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
"reth-provider",
|
"reth-provider",
|
||||||
"reth-revm-primitives",
|
|
||||||
"reth-tasks",
|
"reth-tasks",
|
||||||
"revm",
|
"revm",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@ -23,7 +23,6 @@ members = [
|
|||||||
"crates/primitives",
|
"crates/primitives",
|
||||||
"crates/prune",
|
"crates/prune",
|
||||||
"crates/revm",
|
"crates/revm",
|
||||||
"crates/revm/revm-primitives",
|
|
||||||
"crates/revm/revm-inspectors",
|
"crates/revm/revm-inspectors",
|
||||||
"crates/rpc/ipc",
|
"crates/rpc/ipc",
|
||||||
"crates/rpc/rpc",
|
"crates/rpc/rpc",
|
||||||
|
|||||||
@ -25,14 +25,14 @@ use reth_primitives::{
|
|||||||
eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE, EMPTY_RECEIPTS, EMPTY_TRANSACTIONS,
|
eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE, EMPTY_RECEIPTS, EMPTY_TRANSACTIONS,
|
||||||
EMPTY_WITHDRAWALS, ETHEREUM_BLOCK_GAS_LIMIT, RETH_CLIENT_VERSION, SLOT_DURATION,
|
EMPTY_WITHDRAWALS, ETHEREUM_BLOCK_GAS_LIMIT, RETH_CLIENT_VERSION, SLOT_DURATION,
|
||||||
},
|
},
|
||||||
proofs, Block, BlockNumberOrTag, Bytes, ChainSpec, Header, IntoRecoveredTransaction, Receipt,
|
proofs,
|
||||||
Receipts, SealedBlock, Withdrawal, B256, EMPTY_OMMER_ROOT, U256,
|
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_provider::{BlockReaderIdExt, BlockSource, BundleStateWithReceipts, StateProviderFactory};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::StateProviderDatabase,
|
database::StateProviderDatabase,
|
||||||
env::tx_env_with_recovered,
|
|
||||||
into_reth_log,
|
|
||||||
state_change::{apply_beacon_root_contract_call, post_block_withdrawals_balance_increments},
|
state_change::{apply_beacon_root_contract_call, post_block_withdrawals_balance_increments},
|
||||||
};
|
};
|
||||||
use reth_tasks::TaskSpawner;
|
use reth_tasks::TaskSpawner;
|
||||||
|
|||||||
@ -14,7 +14,6 @@ reth-primitives.workspace = true
|
|||||||
reth-rpc-types.workspace = true
|
reth-rpc-types.workspace = true
|
||||||
reth-transaction-pool.workspace = true
|
reth-transaction-pool.workspace = true
|
||||||
reth-interfaces.workspace = true
|
reth-interfaces.workspace = true
|
||||||
reth-revm-primitives = { path = "../../revm/revm-primitives" }
|
|
||||||
reth-rpc-types-compat.workspace = true
|
reth-rpc-types-compat.workspace = true
|
||||||
|
|
||||||
## ethereum
|
## ethereum
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
use alloy_rlp::Encodable;
|
use alloy_rlp::Encodable;
|
||||||
use reth_primitives::{
|
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::{
|
use reth_rpc_types::engine::{
|
||||||
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadV1, PayloadAttributes,
|
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadV1, PayloadAttributes,
|
||||||
PayloadId,
|
PayloadId,
|
||||||
|
|||||||
@ -65,6 +65,8 @@ proptest = { workspace = true, optional = true }
|
|||||||
proptest-derive = { workspace = true, optional = true }
|
proptest-derive = { workspace = true, optional = true }
|
||||||
strum = { workspace = true, features = ["derive"] }
|
strum = { workspace = true, features = ["derive"] }
|
||||||
|
|
||||||
|
revm.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
test-fuzz = "4"
|
test-fuzz = "4"
|
||||||
@ -83,8 +85,8 @@ hash-db = "~0.15"
|
|||||||
reth-primitives = { path = ".", features = ["value-256"] }
|
reth-primitives = { path = ".", features = ["value-256"] }
|
||||||
|
|
||||||
|
|
||||||
# necessary so we don't hit a "undeclared 'std'":
|
# necessary so we don't hit a "undeclared 'std'":
|
||||||
# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198
|
# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198
|
||||||
secp256k1.workspace = true
|
secp256k1.workspace = true
|
||||||
criterion = "0.5"
|
criterion = "0.5"
|
||||||
pprof = { version = "0.12", features = ["flamegraph", "frame-pointer", "criterion"] }
|
pprof = { version = "0.12", features = ["flamegraph", "frame-pointer", "criterion"] }
|
||||||
|
|||||||
@ -39,6 +39,8 @@ mod precaution;
|
|||||||
pub mod proofs;
|
pub mod proofs;
|
||||||
mod prune;
|
mod prune;
|
||||||
mod receipt;
|
mod receipt;
|
||||||
|
/// Helpers for working with revm
|
||||||
|
pub mod revm;
|
||||||
pub mod serde_helper;
|
pub mod serde_helper;
|
||||||
pub mod snapshot;
|
pub mod snapshot;
|
||||||
pub mod stage;
|
pub mod stage;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use reth_primitives::{
|
use crate::{
|
||||||
revm_primitives::{AccountInfo, Log},
|
revm_primitives::{AccountInfo, Log},
|
||||||
Account, Address, Log as RethLog, TransactionKind, KECCAK_EMPTY, U256,
|
Account, Address, Log as RethLog, TransactionKind, KECCAK_EMPTY, U256,
|
||||||
};
|
};
|
||||||
@ -8,7 +8,7 @@ use revm::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Check equality between Revm and Reth `Log`s.
|
/// 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.address == reth_log.address &&
|
||||||
revm_log.data == reth_log.data &&
|
revm_log.data == reth_log.data &&
|
||||||
revm_log.topics == reth_log.topics
|
revm_log.topics == reth_log.topics
|
||||||
@ -1,6 +1,4 @@
|
|||||||
//! Reth block execution/validation configuration and constants
|
use crate::{revm_primitives, ChainSpec, Hardfork, Head};
|
||||||
|
|
||||||
use reth_primitives::{revm_primitives, ChainSpec, Hardfork, Head};
|
|
||||||
|
|
||||||
/// Returns the spec id at the given timestamp.
|
/// 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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use reth_primitives::{ChainSpecBuilder, Head, MAINNET, U256};
|
use crate::{ChainSpecBuilder, Head, MAINNET, U256};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_to_revm_spec() {
|
fn test_to_revm_spec() {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
use crate::config::revm_spec;
|
use crate::{
|
||||||
use reth_primitives::{
|
|
||||||
constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS},
|
constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS},
|
||||||
recover_signer,
|
recover_signer,
|
||||||
|
revm::config::revm_spec,
|
||||||
revm_primitives::{AnalysisKind, BlockEnv, CfgEnv, Env, SpecId, TransactTo, TxEnv},
|
revm_primitives::{AnalysisKind, BlockEnv, CfgEnv, Env, SpecId, TransactTo, TxEnv},
|
||||||
Address, Bytes, Chain, ChainSpec, Head, Header, Transaction, TransactionKind,
|
Address, Bytes, Chain, ChainSpec, Head, Header, Transaction, TransactionKind,
|
||||||
TransactionSignedEcRecovered, TxEip1559, TxEip2930, TxEip4844, TxLegacy, B256, U256,
|
TransactionSignedEcRecovered, TxEip1559, TxEip2930, TxEip4844, TxLegacy, B256, U256,
|
||||||
20
crates/primitives/src/revm/mod.rs
Normal file
20
crates/primitives/src/revm/mod.rs
Normal file
@ -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;
|
||||||
@ -13,7 +13,6 @@ description = "reth specific revm utilities"
|
|||||||
reth-primitives.workspace = true
|
reth-primitives.workspace = true
|
||||||
reth-interfaces.workspace = true
|
reth-interfaces.workspace = true
|
||||||
reth-provider.workspace = true
|
reth-provider.workspace = true
|
||||||
reth-revm-primitives = { path = "./revm-primitives" }
|
|
||||||
reth-revm-inspectors = { path = "./revm-inspectors" }
|
reth-revm-inspectors = { path = "./revm-inspectors" }
|
||||||
reth-consensus-common = { path = "../consensus/common" }
|
reth-consensus-common = { path = "../consensus/common" }
|
||||||
|
|
||||||
|
|||||||
@ -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
|
|
||||||
@ -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::*;
|
|
||||||
@ -26,8 +26,6 @@ pub use factory::Factory;
|
|||||||
|
|
||||||
/// reexport for convenience
|
/// reexport for convenience
|
||||||
pub use reth_revm_inspectors::*;
|
pub use reth_revm_inspectors::*;
|
||||||
/// reexport for convenience
|
|
||||||
pub use reth_revm_primitives::*;
|
|
||||||
|
|
||||||
/// Re-export everything
|
/// Re-export everything
|
||||||
pub use revm::{self, *};
|
pub use revm::{self, *};
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
database::StateProviderDatabase,
|
database::StateProviderDatabase,
|
||||||
env::{fill_cfg_and_block_env, fill_tx_env},
|
|
||||||
eth_dao_fork::{DAO_HARDFORK_BENEFICIARY, DAO_HARDKFORK_ACCOUNTS},
|
eth_dao_fork::{DAO_HARDFORK_BENEFICIARY, DAO_HARDKFORK_ACCOUNTS},
|
||||||
into_reth_log,
|
|
||||||
stack::{InspectorStack, InspectorStackConfig},
|
stack::{InspectorStack, InspectorStackConfig},
|
||||||
state_change::{apply_beacon_root_contract_call, post_block_balance_increments},
|
state_change::{apply_beacon_root_contract_call, post_block_balance_increments},
|
||||||
};
|
};
|
||||||
@ -11,6 +9,10 @@ use reth_interfaces::{
|
|||||||
RethError,
|
RethError,
|
||||||
};
|
};
|
||||||
use reth_primitives::{
|
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,
|
Address, Block, BlockNumber, Bloom, ChainSpec, Hardfork, Header, PruneMode, PruneModes,
|
||||||
PruneSegmentError, Receipt, ReceiptWithBloom, Receipts, TransactionSigned, B256,
|
PruneSegmentError, Receipt, ReceiptWithBloom, Receipts, TransactionSigned, B256,
|
||||||
MINIMUM_PRUNING_DISTANCE, U256,
|
MINIMUM_PRUNING_DISTANCE, U256,
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
use reth_consensus_common::calc;
|
use reth_consensus_common::calc;
|
||||||
use reth_interfaces::executor::{BlockExecutionError, BlockValidationError};
|
use reth_interfaces::executor::{BlockExecutionError, BlockValidationError};
|
||||||
use reth_primitives::{
|
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 revm::{primitives::ResultAndState, Database, DatabaseCommit, EVM};
|
||||||
use std::{collections::HashMap, fmt::Debug};
|
use std::{collections::HashMap, fmt::Debug};
|
||||||
|
|
||||||
|
|||||||
@ -14,12 +14,12 @@ use alloy_rlp::{Decodable, Encodable};
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use jsonrpsee::core::RpcResult;
|
use jsonrpsee::core::RpcResult;
|
||||||
use reth_primitives::{
|
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_provider::{BlockReaderIdExt, HeaderProvider, StateProviderBox};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::{StateProviderDatabase, SubState},
|
database::{StateProviderDatabase, SubState},
|
||||||
env::tx_env_with_recovered,
|
|
||||||
tracing::{
|
tracing::{
|
||||||
js::{JsDbRequest, JsInspector},
|
js::{JsDbRequest, JsInspector},
|
||||||
FourByteInspector, TracingInspector, TracingInspectorConfig,
|
FourByteInspector, TracingInspector, TracingInspectorConfig,
|
||||||
|
|||||||
@ -12,13 +12,11 @@ use crate::{
|
|||||||
EthApi,
|
EthApi,
|
||||||
};
|
};
|
||||||
use reth_network_api::NetworkInfo;
|
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::{
|
use reth_provider::{
|
||||||
BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, StateProvider, StateProviderFactory,
|
BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, StateProvider, StateProviderFactory,
|
||||||
};
|
};
|
||||||
use reth_revm::{
|
use reth_revm::{access_list::AccessListInspector, database::StateProviderDatabase};
|
||||||
access_list::AccessListInspector, database::StateProviderDatabase, env::tx_env_with_recovered,
|
|
||||||
};
|
|
||||||
use reth_rpc_types::{
|
use reth_rpc_types::{
|
||||||
state::StateOverride, AccessListWithGasUsed, BlockError, Bundle, CallRequest, EthCallResponse,
|
state::StateOverride, AccessListWithGasUsed, BlockError, Bundle, CallRequest, EthCallResponse,
|
||||||
StateContext,
|
StateContext,
|
||||||
|
|||||||
@ -4,14 +4,14 @@ use crate::eth::error::{EthApiError, EthResult};
|
|||||||
use core::fmt::Debug;
|
use core::fmt::Debug;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
constants::{eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE},
|
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,
|
Receipts, SealedBlock, SealedHeader, B256, EMPTY_OMMER_ROOT, U256,
|
||||||
};
|
};
|
||||||
use reth_provider::{BundleStateWithReceipts, ChainSpecProvider, StateProviderFactory};
|
use reth_provider::{BundleStateWithReceipts, ChainSpecProvider, StateProviderFactory};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::StateProviderDatabase,
|
database::StateProviderDatabase,
|
||||||
env::tx_env_with_recovered,
|
|
||||||
into_reth_log,
|
|
||||||
state_change::{apply_beacon_root_contract_call, post_block_withdrawals_balance_increments},
|
state_change::{apply_beacon_root_contract_call, post_block_withdrawals_balance_increments},
|
||||||
};
|
};
|
||||||
use reth_transaction_pool::TransactionPool;
|
use reth_transaction_pool::TransactionPool;
|
||||||
|
|||||||
@ -15,6 +15,7 @@ use async_trait::async_trait;
|
|||||||
use reth_network_api::NetworkInfo;
|
use reth_network_api::NetworkInfo;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
eip4844::calc_blob_gasprice,
|
eip4844::calc_blob_gasprice,
|
||||||
|
revm::env::{fill_block_env_with_coinbase, tx_env_with_recovered},
|
||||||
Address, BlockId, BlockNumberOrTag, Bytes, FromRecoveredPooledTransaction, Header,
|
Address, BlockId, BlockNumberOrTag, Bytes, FromRecoveredPooledTransaction, Header,
|
||||||
IntoRecoveredTransaction, Receipt, SealedBlock,
|
IntoRecoveredTransaction, Receipt, SealedBlock,
|
||||||
TransactionKind::{Call, Create},
|
TransactionKind::{Call, Create},
|
||||||
@ -25,7 +26,6 @@ use reth_provider::{
|
|||||||
};
|
};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::StateProviderDatabase,
|
database::StateProviderDatabase,
|
||||||
env::{fill_block_env_with_coinbase, tx_env_with_recovered},
|
|
||||||
tracing::{TracingInspector, TracingInspectorConfig},
|
tracing::{TracingInspector, TracingInspectorConfig},
|
||||||
};
|
};
|
||||||
use reth_rpc_types::{
|
use reth_rpc_types::{
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
use crate::eth::error::{EthApiError, EthResult, RpcInvalidTransactionError};
|
use crate::eth::error::{EthApiError, EthResult, RpcInvalidTransactionError};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
|
revm::env::{fill_tx_env, fill_tx_env_with_recovered},
|
||||||
AccessList, Address, TransactionSigned, TransactionSignedEcRecovered, TxHash, B256, U256,
|
AccessList, Address, TransactionSigned, TransactionSignedEcRecovered, TxHash, B256, U256,
|
||||||
};
|
};
|
||||||
use reth_revm::env::{fill_tx_env, fill_tx_env_with_recovered};
|
|
||||||
use reth_rpc_types::{
|
use reth_rpc_types::{
|
||||||
state::{AccountOverride, StateOverride},
|
state::{AccountOverride, StateOverride},
|
||||||
BlockOverrides, CallRequest,
|
BlockOverrides, CallRequest,
|
||||||
|
|||||||
@ -10,11 +10,12 @@ use crate::{
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use jsonrpsee::core::RpcResult as Result;
|
use jsonrpsee::core::RpcResult as Result;
|
||||||
use reth_consensus_common::calc::{base_block_reward, block_reward};
|
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_provider::{BlockReader, ChainSpecProvider, EvmEnvProvider, StateProviderFactory};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::StateProviderDatabase,
|
database::StateProviderDatabase,
|
||||||
env::tx_env_with_recovered,
|
|
||||||
tracing::{parity::populate_state_diff, TracingInspector, TracingInspectorConfig},
|
tracing::{parity::populate_state_diff, TracingInspector, TracingInspectorConfig},
|
||||||
};
|
};
|
||||||
use reth_rpc_api::TraceApiServer;
|
use reth_rpc_api::TraceApiServer;
|
||||||
|
|||||||
@ -28,7 +28,6 @@ proptest-derive = { workspace = true, optional = true }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
revm-primitives = { workspace = true, features = ["serde", "arbitrary"] }
|
revm-primitives = { workspace = true, features = ["serde", "arbitrary"] }
|
||||||
|
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
modular-bitfield = "0.11.2"
|
modular-bitfield = "0.11.2"
|
||||||
test-fuzz = "4"
|
test-fuzz = "4"
|
||||||
|
|||||||
@ -12,7 +12,6 @@ description = "Reth storage provider."
|
|||||||
# reth
|
# reth
|
||||||
reth-primitives.workspace = true
|
reth-primitives.workspace = true
|
||||||
reth-interfaces.workspace = true
|
reth-interfaces.workspace = true
|
||||||
reth-revm-primitives = { path = "../../revm/revm-primitives" }
|
|
||||||
reth-db.workspace = true
|
reth-db.workspace = true
|
||||||
reth-trie = { path = "../../trie" }
|
reth-trie = { path = "../../trie" }
|
||||||
reth-nippy-jar = { path = "../nippy-jar" }
|
reth-nippy-jar = { path = "../nippy-jar" }
|
||||||
|
|||||||
@ -6,10 +6,11 @@ use reth_db::{
|
|||||||
};
|
};
|
||||||
use reth_interfaces::db::DatabaseError;
|
use reth_interfaces::db::DatabaseError;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
keccak256, logs_bloom, Account, Address, BlockNumber, Bloom, Bytecode, Log, Receipt, Receipts,
|
keccak256, logs_bloom,
|
||||||
StorageEntry, B256, U256,
|
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::{
|
use reth_trie::{
|
||||||
hashed_cursor::{HashedPostState, HashedPostStateCursorFactory, HashedStorage},
|
hashed_cursor::{HashedPostState, HashedPostStateCursorFactory, HashedStorage},
|
||||||
StateRoot, StateRootError,
|
StateRoot, StateRootError,
|
||||||
@ -381,8 +382,9 @@ mod tests {
|
|||||||
transaction::DbTx,
|
transaction::DbTx,
|
||||||
DatabaseEnv,
|
DatabaseEnv,
|
||||||
};
|
};
|
||||||
use reth_primitives::{Address, Receipt, Receipts, StorageEntry, B256, MAINNET, U256};
|
use reth_primitives::{
|
||||||
use reth_revm_primitives::into_reth_acc;
|
revm::compat::into_reth_acc, Address, Receipt, Receipts, StorageEntry, B256, MAINNET, U256,
|
||||||
|
};
|
||||||
use revm::{
|
use revm::{
|
||||||
db::{
|
db::{
|
||||||
states::{
|
states::{
|
||||||
|
|||||||
@ -5,8 +5,7 @@ use reth_db::{
|
|||||||
transaction::{DbTx, DbTxMut},
|
transaction::{DbTx, DbTxMut},
|
||||||
};
|
};
|
||||||
use reth_interfaces::db::DatabaseError;
|
use reth_interfaces::db::DatabaseError;
|
||||||
use reth_primitives::{Bytecode, StorageEntry, U256};
|
use reth_primitives::{revm::compat::into_reth_acc, Bytecode, StorageEntry, U256};
|
||||||
use reth_revm_primitives::into_reth_acc;
|
|
||||||
use revm::db::states::{PlainStorageChangeset, StateChangeset};
|
use revm::db::states::{PlainStorageChangeset, StateChangeset};
|
||||||
|
|
||||||
/// A change to the state of the world.
|
/// A change to the state of the world.
|
||||||
|
|||||||
@ -6,8 +6,7 @@ use reth_db::{
|
|||||||
transaction::{DbTx, DbTxMut},
|
transaction::{DbTx, DbTxMut},
|
||||||
};
|
};
|
||||||
use reth_interfaces::db::DatabaseError;
|
use reth_interfaces::db::DatabaseError;
|
||||||
use reth_primitives::{BlockNumber, StorageEntry, B256, U256};
|
use reth_primitives::{revm::compat::into_reth_acc, BlockNumber, StorageEntry, B256, U256};
|
||||||
use reth_revm_primitives::into_reth_acc;
|
|
||||||
use revm::db::states::{PlainStateReverts, PlainStorageRevert, RevertToSlot};
|
use revm::db::states::{PlainStateReverts, PlainStorageRevert, RevertToSlot};
|
||||||
use std::iter::Peekable;
|
use std::iter::Peekable;
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@ use reth_interfaces::{
|
|||||||
};
|
};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
keccak256,
|
keccak256,
|
||||||
|
revm::{
|
||||||
|
config::revm_spec,
|
||||||
|
env::{fill_block_env, fill_cfg_and_block_env, fill_cfg_env},
|
||||||
|
},
|
||||||
stage::{StageCheckpoint, StageId},
|
stage::{StageCheckpoint, StageId},
|
||||||
trie::Nibbles,
|
trie::Nibbles,
|
||||||
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders,
|
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders,
|
||||||
@ -36,10 +40,6 @@ use reth_primitives::{
|
|||||||
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber,
|
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber,
|
||||||
Withdrawal, B256, U256,
|
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 reth_trie::{prefix_set::PrefixSetMut, StateRoot};
|
||||||
use revm::primitives::{BlockEnv, CfgEnv, SpecId};
|
use revm::primitives::{BlockEnv, CfgEnv, SpecId};
|
||||||
use std::{
|
use std::{
|
||||||
|
|||||||
@ -23,7 +23,6 @@ reth-provider.workspace = true
|
|||||||
reth-interfaces.workspace = true
|
reth-interfaces.workspace = true
|
||||||
reth-tasks.workspace = true
|
reth-tasks.workspace = true
|
||||||
revm.workspace = true
|
revm.workspace = true
|
||||||
reth-revm-primitives = { path = "../revm/revm-primitives" }
|
|
||||||
alloy-rlp.workspace = true
|
alloy-rlp.workspace = true
|
||||||
|
|
||||||
# async/futures
|
# async/futures
|
||||||
|
|||||||
@ -14,11 +14,11 @@ use reth_primitives::{
|
|||||||
ETHEREUM_BLOCK_GAS_LIMIT,
|
ETHEREUM_BLOCK_GAS_LIMIT,
|
||||||
},
|
},
|
||||||
kzg::KzgSettings,
|
kzg::KzgSettings,
|
||||||
|
revm::compat::calculate_intrinsic_gas_after_merge,
|
||||||
ChainSpec, InvalidTransactionError, SealedBlock, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
|
ChainSpec, InvalidTransactionError, SealedBlock, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
|
||||||
EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
|
EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
|
||||||
};
|
};
|
||||||
use reth_provider::{AccountReader, StateProviderFactory};
|
use reth_provider::{AccountReader, StateProviderFactory};
|
||||||
use reth_revm_primitives::calculate_intrinsic_gas_after_merge;
|
|
||||||
use reth_tasks::TaskSpawner;
|
use reth_tasks::TaskSpawner;
|
||||||
use std::{
|
use std::{
|
||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
|
|||||||
@ -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:
|
Generally reth is composed of a few components, with supporting crates. The main components can be defined as:
|
||||||
|
|
||||||
- [Storage](#storage)
|
- [Project Layout](#project-layout)
|
||||||
- [Networking](#networking)
|
- [Documentation](#documentation)
|
||||||
- [Consensus](#consensus)
|
- [Binaries](#binaries)
|
||||||
- [Execution](#execution)
|
- [Storage](#storage)
|
||||||
- [Sync](#sync)
|
- [Networking](#networking)
|
||||||
- [RPC](#rpc)
|
- [Common](#common)
|
||||||
- [Payloads](#payloads)
|
- [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).
|
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`](../../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-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
|
### Sync
|
||||||
|
|
||||||
@ -152,4 +162,4 @@ Small utility crates.
|
|||||||
[jsonrpsee]: https://github.com/paritytech/jsonrpsee/
|
[jsonrpsee]: https://github.com/paritytech/jsonrpsee/
|
||||||
[tracing]: https://crates.io/crates/tracing
|
[tracing]: https://crates.io/crates/tracing
|
||||||
[eip-1459]: https://eips.ethereum.org/EIPS/eip-1459
|
[eip-1459]: https://eips.ethereum.org/EIPS/eip-1459
|
||||||
[engine-spec]: https://github.com/ethereum/execution-apis/tree/main/src/engine
|
[engine-spec]: https://github.com/ethereum/execution-apis/tree/main/src/engine
|
||||||
|
|||||||
Reference in New Issue
Block a user