feat: add reth-evm crate (#7397)

This commit is contained in:
Matthias Seitz
2024-04-01 18:31:02 +02:00
committed by GitHub
parent d6933bad99
commit 2de0bc4976
14 changed files with 53 additions and 22 deletions

18
crates/evm/Cargo.toml Normal file
View File

@ -0,0 +1,18 @@
[package]
name = "reth-evm"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lints]
workspace = true
[dependencies]
# reth
reth-primitives.workspace = true
revm-primitives.workspace = true
revm.workspace = true

View File

@ -1,3 +1,13 @@
//! Traits for configuring an EVM specifics.
#![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/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use reth_primitives::{revm::env::fill_block_env, Address, ChainSpec, Header, Transaction, U256};
use revm::{Database, Evm, EvmBuilder};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, SpecId, TxEnv};

View File

@ -14,9 +14,8 @@ workspace = true
# reth
reth-primitives.workspace = true
reth-rpc-types.workspace = true
revm-primitives.workspace = true
thiserror.workspace = true
revm.workspace = true
reth-evm.workspace = true
# io
# misc
serde.workspace = true
thiserror.workspace = true

View File

@ -1,5 +0,0 @@
//! Traits and structs for working with a configurable EVM.
/// Traits for working with a configurable EVM.
mod traits;
pub use traits::{ConfigureEvm, ConfigureEvmEnv};

View File

@ -20,8 +20,7 @@ pub use engine::{
};
/// Traits and helper types used to abstract over EVM methods and types.
pub mod evm;
pub use evm::{ConfigureEvm, ConfigureEvmEnv};
pub use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
pub mod primitives;

View File

@ -19,7 +19,7 @@ reth-db.workspace = true
reth-trie = { workspace = true, features = ["metrics"] }
reth-nippy-jar.workspace = true
reth-codecs.workspace = true
reth-node-api.workspace = true
reth-evm.workspace = true
revm.workspace = true

View File

@ -8,8 +8,8 @@ use crate::{
TransactionVariant, TransactionsProvider, WithdrawalsProvider,
};
use reth_db::{database::Database, init_db, models::StoredBlockBodyIndices, DatabaseEnv};
use reth_evm::ConfigureEvmEnv;
use reth_interfaces::{provider::ProviderResult, RethError, RethResult};
use reth_node_api::ConfigureEvmEnv;
use reth_primitives::{
stage::{StageCheckpoint, StageId},
Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, ChainInfo,

View File

@ -26,12 +26,12 @@ use reth_db::{
transaction::{DbTx, DbTxMut},
BlockNumberList, DatabaseError,
};
use reth_evm::ConfigureEvmEnv;
use reth_interfaces::{
p2p::headers::downloader::SyncTarget,
provider::{ProviderResult, RootMismatch},
RethResult,
};
use reth_node_api::ConfigureEvmEnv;
use reth_primitives::{
keccak256,
revm::{config::revm_spec, env::fill_block_env},

View File

@ -10,6 +10,7 @@ use reth_db::{
database::Database,
models::{AccountBeforeTx, StoredBlockBodyIndices},
};
use reth_evm::ConfigureEvmEnv;
use reth_interfaces::{
blockchain_tree::{
error::{CanonicalError, InsertBlockError},
@ -20,7 +21,6 @@ use reth_interfaces::{
provider::ProviderResult,
RethResult,
};
use reth_node_api::ConfigureEvmEnv;
use reth_primitives::{
stage::{StageCheckpoint, StageId},
Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber,

View File

@ -7,8 +7,8 @@ use crate::{
};
use parking_lot::Mutex;
use reth_db::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_evm::ConfigureEvmEnv;
use reth_interfaces::provider::{ProviderError, ProviderResult};
use reth_node_api::ConfigureEvmEnv;
use reth_primitives::{
keccak256, trie::AccountProof, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId,
BlockNumber, BlockWithSenders, Bytecode, Bytes, ChainInfo, ChainSpec, Header, Receipt,

View File

@ -7,8 +7,8 @@ use crate::{
WithdrawalsProvider,
};
use reth_db::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_evm::ConfigureEvmEnv;
use reth_interfaces::provider::ProviderResult;
use reth_node_api::ConfigureEvmEnv;
use reth_primitives::{
stage::{StageCheckpoint, StageId},
trie::AccountProof,

View File

@ -1,5 +1,5 @@
use reth_evm::ConfigureEvmEnv;
use reth_interfaces::provider::ProviderResult;
use reth_node_api::ConfigureEvmEnv;
use reth_primitives::{BlockHashOrNumber, Header};
use revm::primitives::{BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, SpecId};