mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: Add Transaction AT to ConfigureEvm (#13106)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -9031,6 +9031,7 @@ dependencies = [
|
||||
"reth-network-api",
|
||||
"reth-node-api",
|
||||
"reth-primitives",
|
||||
"reth-primitives-traits",
|
||||
"reth-provider",
|
||||
"reth-revm",
|
||||
"reth-rpc-eth-types",
|
||||
|
||||
@ -8,8 +8,8 @@ use reth_engine_primitives::InvalidBlockHook;
|
||||
use reth_evm::{
|
||||
state_change::post_block_balance_increments, system_calls::SystemCaller, ConfigureEvm,
|
||||
};
|
||||
use reth_primitives::{NodePrimitives, SealedBlockWithSenders, SealedHeader, TransactionSigned};
|
||||
use reth_primitives_traits::{HeaderTy, SignedTransaction};
|
||||
use reth_primitives::{NodePrimitives, SealedBlockWithSenders, SealedHeader};
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_provider::{BlockExecutionOutput, ChainSpecProvider, StateProviderFactory};
|
||||
use reth_revm::{
|
||||
database::StateProviderDatabase, db::states::bundle_state::BundleRetention,
|
||||
@ -63,8 +63,8 @@ where
|
||||
trie_updates: Option<(&TrieUpdates, B256)>,
|
||||
) -> eyre::Result<()>
|
||||
where
|
||||
N: NodePrimitives<SignedTx = TransactionSigned>,
|
||||
EvmConfig: ConfigureEvm<Header = N::BlockHeader>,
|
||||
N: NodePrimitives,
|
||||
EvmConfig: ConfigureEvm<Header = N::BlockHeader, Transaction = N::SignedTx>,
|
||||
{
|
||||
// TODO(alexey): unify with `DebugApi::debug_execution_witness`
|
||||
|
||||
@ -298,13 +298,13 @@ where
|
||||
|
||||
impl<P, EvmConfig, N> InvalidBlockHook<N> for InvalidBlockWitnessHook<P, EvmConfig>
|
||||
where
|
||||
N: NodePrimitives<SignedTx = TransactionSigned>,
|
||||
N: NodePrimitives,
|
||||
P: StateProviderFactory
|
||||
+ ChainSpecProvider<ChainSpec: EthChainSpec + EthereumHardforks>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
EvmConfig: ConfigureEvm<Header = HeaderTy<N>>,
|
||||
EvmConfig: ConfigureEvm<Header = N::BlockHeader, Transaction = N::SignedTx>,
|
||||
{
|
||||
fn on_invalid_block(
|
||||
&self,
|
||||
|
||||
@ -110,7 +110,7 @@ where
|
||||
S: Stream<Item = BeaconEngineMessage<Engine>>,
|
||||
Engine: EngineTypes,
|
||||
Provider: BlockReader<Block = reth_primitives::Block> + StateProviderFactory,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = Header, Transaction = reth_primitives::TransactionSigned>,
|
||||
Spec: EthereumHardforks,
|
||||
{
|
||||
type Item = S::Item;
|
||||
@ -257,7 +257,7 @@ fn create_reorg_head<Provider, Evm, Spec>(
|
||||
) -> RethResult<(ExecutionPayload, ExecutionPayloadSidecar)>
|
||||
where
|
||||
Provider: BlockReader<Block = reth_primitives::Block> + StateProviderFactory,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = Header, Transaction = reth_primitives::TransactionSigned>,
|
||||
Spec: EthereumHardforks,
|
||||
{
|
||||
let chain_spec = payload_validator.chain_spec();
|
||||
|
||||
@ -58,8 +58,15 @@ impl<EvmConfig> EthExecutionStrategyFactory<EvmConfig> {
|
||||
|
||||
impl<EvmConfig> BlockExecutionStrategyFactory for EthExecutionStrategyFactory<EvmConfig>
|
||||
where
|
||||
EvmConfig:
|
||||
Clone + Unpin + Sync + Send + 'static + ConfigureEvm<Header = alloy_consensus::Header>,
|
||||
EvmConfig: Clone
|
||||
+ Unpin
|
||||
+ Sync
|
||||
+ Send
|
||||
+ 'static
|
||||
+ ConfigureEvm<
|
||||
Header = alloy_consensus::Header,
|
||||
Transaction = reth_primitives::TransactionSigned,
|
||||
>,
|
||||
{
|
||||
type Primitives = EthPrimitives;
|
||||
|
||||
@ -128,7 +135,10 @@ where
|
||||
impl<DB, EvmConfig> BlockExecutionStrategy for EthExecutionStrategy<DB, EvmConfig>
|
||||
where
|
||||
DB: Database<Error: Into<ProviderError> + Display>,
|
||||
EvmConfig: ConfigureEvm<Header = alloy_consensus::Header>,
|
||||
EvmConfig: ConfigureEvm<
|
||||
Header = alloy_consensus::Header,
|
||||
Transaction = reth_primitives::TransactionSigned,
|
||||
>,
|
||||
{
|
||||
type DB = DB;
|
||||
type Error = BlockExecutionError;
|
||||
|
||||
@ -62,6 +62,7 @@ impl EthEvmConfig {
|
||||
|
||||
impl ConfigureEvmEnv for EthEvmConfig {
|
||||
type Header = Header;
|
||||
type Transaction = TransactionSigned;
|
||||
type Error = Infallible;
|
||||
|
||||
fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) {
|
||||
|
||||
@ -32,8 +32,6 @@ reth-primitives.workspace = true
|
||||
reth-revm = { workspace = true, features = ["std"] }
|
||||
reth-trie-db.workspace = true
|
||||
|
||||
alloy-consensus.workspace = true
|
||||
|
||||
# revm with required ethereum features
|
||||
revm = { workspace = true, features = ["secp256k1", "blst", "c-kzg"] }
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use alloy_consensus::Header;
|
||||
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
|
||||
use reth_beacon_consensus::EthBeaconConsensus;
|
||||
use reth_chainspec::ChainSpec;
|
||||
@ -13,7 +12,8 @@ use reth_evm::execute::BasicBlockExecutorProvider;
|
||||
use reth_evm_ethereum::execute::EthExecutionStrategyFactory;
|
||||
use reth_network::{NetworkHandle, PeersInfo};
|
||||
use reth_node_api::{
|
||||
AddOnsContext, ConfigureEvm, EngineValidator, FullNodeComponents, NodeTypesWithDB, TxTy,
|
||||
AddOnsContext, ConfigureEvm, EngineValidator, FullNodeComponents, HeaderTy, NodeTypesWithDB,
|
||||
TxTy,
|
||||
};
|
||||
use reth_node_builder::{
|
||||
components::{
|
||||
@ -242,7 +242,7 @@ impl EthereumPayloadBuilder {
|
||||
where
|
||||
Types: NodeTypesWithEngine<ChainSpec = ChainSpec, Primitives = EthPrimitives>,
|
||||
Node: FullNodeTypes<Types = Types>,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = HeaderTy<Types>, Transaction = TxTy<Node::Types>>,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
|
||||
@ -91,7 +91,7 @@ where
|
||||
// Default implementation of [PayloadBuilder] for unit type
|
||||
impl<EvmConfig, Pool, Client> PayloadBuilder<Pool, Client> for EthereumPayloadBuilder<EvmConfig>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec>,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
|
||||
{
|
||||
@ -155,7 +155,7 @@ pub fn default_ethereum_payload<EvmConfig, Pool, Client, F>(
|
||||
best_txs: F,
|
||||
) -> Result<BuildOutcome<EthBuiltPayload>, PayloadBuilderError>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec>,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
|
||||
F: FnOnce(BestTransactionsAttributes) -> BestTransactionsIter<Pool>,
|
||||
|
||||
@ -20,7 +20,6 @@ extern crate alloc;
|
||||
use crate::builder::RethEvmBuilder;
|
||||
use alloy_consensus::BlockHeader as _;
|
||||
use alloy_primitives::{Address, Bytes, B256, U256};
|
||||
use reth_primitives::TransactionSigned;
|
||||
use reth_primitives_traits::BlockHeader;
|
||||
use revm::{Database, Evm, GetInspector};
|
||||
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, SpecId, TxEnv};
|
||||
@ -116,18 +115,21 @@ pub trait ConfigureEvmEnv: Send + Sync + Unpin + Clone + 'static {
|
||||
/// The header type used by the EVM.
|
||||
type Header: BlockHeader;
|
||||
|
||||
/// The transaction type.
|
||||
type Transaction;
|
||||
|
||||
/// The error type that is returned by [`Self::next_cfg_and_block_env`].
|
||||
type Error: core::error::Error + Send + Sync;
|
||||
|
||||
/// Returns a [`TxEnv`] from a [`TransactionSigned`] and [`Address`].
|
||||
fn tx_env(&self, transaction: &TransactionSigned, signer: Address) -> TxEnv {
|
||||
/// Returns a [`TxEnv`] from a transaction and [`Address`].
|
||||
fn tx_env(&self, transaction: &Self::Transaction, signer: Address) -> TxEnv {
|
||||
let mut tx_env = TxEnv::default();
|
||||
self.fill_tx_env(&mut tx_env, transaction, signer);
|
||||
tx_env
|
||||
}
|
||||
|
||||
/// Fill transaction environment from a [`TransactionSigned`] and the given sender address.
|
||||
fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address);
|
||||
/// Fill transaction environment from a transaction and the given sender address.
|
||||
fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &Self::Transaction, sender: Address);
|
||||
|
||||
/// Fill transaction environment with a system contract call.
|
||||
fn fill_tx_env_system_contract_call(
|
||||
|
||||
@ -49,7 +49,7 @@ pub trait FullNodeComponents: FullNodeTypes + Clone + 'static {
|
||||
type Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Self::Types>>> + Unpin;
|
||||
|
||||
/// The node's EVM configuration, defining settings for the Ethereum Virtual Machine.
|
||||
type Evm: ConfigureEvm<Header = HeaderTy<Self::Types>>;
|
||||
type Evm: ConfigureEvm<Header = HeaderTy<Self::Types>, Transaction = TxTy<Self::Types>>;
|
||||
|
||||
/// The type that knows how to execute blocks.
|
||||
type Executor: BlockExecutorProvider<Primitives = <Self::Types as NodeTypes>::Primitives>;
|
||||
|
||||
@ -377,7 +377,7 @@ where
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>>,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>, Transaction = TxTy<Node::Types>>,
|
||||
Executor: BlockExecutorProvider<Primitives = <Node::Types as NodeTypes>::Primitives>,
|
||||
Cons: FullConsensus<<Node::Types as NodeTypes>::Primitives> + Clone + Unpin + 'static,
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//! EVM component for the node builder.
|
||||
use crate::{BuilderContext, FullNodeTypes};
|
||||
use reth_evm::execute::BlockExecutorProvider;
|
||||
use reth_node_api::{ConfigureEvm, HeaderTy};
|
||||
use reth_node_api::{ConfigureEvm, HeaderTy, TxTy};
|
||||
use std::future::Future;
|
||||
|
||||
/// A type that knows how to build the executor types.
|
||||
@ -9,7 +9,7 @@ pub trait ExecutorBuilder<Node: FullNodeTypes>: Send {
|
||||
/// The EVM config to use.
|
||||
///
|
||||
/// This provides the node with the necessary configuration to configure an EVM.
|
||||
type EVM: ConfigureEvm<Header = HeaderTy<Node::Types>>;
|
||||
type EVM: ConfigureEvm<Header = HeaderTy<Node::Types>, Transaction = TxTy<Node::Types>>;
|
||||
|
||||
/// The type that knows how to execute blocks.
|
||||
type Executor: BlockExecutorProvider<
|
||||
@ -26,7 +26,7 @@ pub trait ExecutorBuilder<Node: FullNodeTypes>: Send {
|
||||
impl<Node, F, Fut, EVM, Executor> ExecutorBuilder<Node> for F
|
||||
where
|
||||
Node: FullNodeTypes,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>>,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>, Transaction = TxTy<Node::Types>>,
|
||||
Executor:
|
||||
BlockExecutorProvider<Primitives = <Node::Types as reth_node_api::NodeTypes>::Primitives>,
|
||||
F: FnOnce(&BuilderContext<Node>) -> Fut + Send,
|
||||
|
||||
@ -40,7 +40,7 @@ pub trait NodeComponents<T: FullNodeTypes>: Clone + Unpin + Send + Sync + 'stati
|
||||
type Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<T::Types>>> + Unpin;
|
||||
|
||||
/// The node's EVM configuration, defining settings for the Ethereum Virtual Machine.
|
||||
type Evm: ConfigureEvm<Header = HeaderTy<T::Types>>;
|
||||
type Evm: ConfigureEvm<Header = HeaderTy<T::Types>, Transaction = TxTy<T::Types>>;
|
||||
|
||||
/// The type that knows how to execute blocks.
|
||||
type Executor: BlockExecutorProvider<Primitives = <T::Types as NodeTypes>::Primitives>;
|
||||
@ -99,7 +99,7 @@ where
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>>,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>, Transaction = TxTy<Node::Types>>,
|
||||
Executor: BlockExecutorProvider<Primitives = <Node::Types as NodeTypes>::Primitives>,
|
||||
Cons: FullConsensus<<Node::Types as NodeTypes>::Primitives> + Clone + Unpin + 'static,
|
||||
{
|
||||
@ -139,7 +139,7 @@ impl<Node, Pool, EVM, Executor, Cons> Clone for Components<Node, Pool, EVM, Exec
|
||||
where
|
||||
Node: FullNodeTypes,
|
||||
Pool: TransactionPool,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>>,
|
||||
EVM: ConfigureEvm<Header = HeaderTy<Node::Types>, Transaction = TxTy<Node::Types>>,
|
||||
Executor: BlockExecutorProvider,
|
||||
Cons: Clone,
|
||||
{
|
||||
|
||||
@ -22,7 +22,7 @@ use reth_optimism_chainspec::OpChainSpec;
|
||||
use reth_optimism_consensus::validate_block_post_execution;
|
||||
use reth_optimism_forks::OpHardfork;
|
||||
use reth_optimism_primitives::OpPrimitives;
|
||||
use reth_primitives::{BlockWithSenders, Receipt, TxType};
|
||||
use reth_primitives::{BlockWithSenders, Receipt, TransactionSigned, TxType};
|
||||
use reth_revm::{Database, State};
|
||||
use revm_primitives::{db::DatabaseCommit, EnvWithHandlerCfg, ResultAndState, U256};
|
||||
use tracing::trace;
|
||||
@ -52,8 +52,12 @@ impl<EvmConfig> OpExecutionStrategyFactory<EvmConfig> {
|
||||
|
||||
impl<EvmConfig> BlockExecutionStrategyFactory for OpExecutionStrategyFactory<EvmConfig>
|
||||
where
|
||||
EvmConfig:
|
||||
Clone + Unpin + Sync + Send + 'static + ConfigureEvm<Header = alloy_consensus::Header>,
|
||||
EvmConfig: Clone
|
||||
+ Unpin
|
||||
+ Sync
|
||||
+ Send
|
||||
+ 'static
|
||||
+ ConfigureEvm<Header = alloy_consensus::Header, Transaction = TransactionSigned>,
|
||||
{
|
||||
type Primitives = OpPrimitives;
|
||||
type Strategy<DB: Database<Error: Into<ProviderError> + Display>> =
|
||||
@ -115,7 +119,7 @@ where
|
||||
impl<DB, EvmConfig> BlockExecutionStrategy for OpExecutionStrategy<DB, EvmConfig>
|
||||
where
|
||||
DB: Database<Error: Into<ProviderError> + Display>,
|
||||
EvmConfig: ConfigureEvm<Header = alloy_consensus::Header>,
|
||||
EvmConfig: ConfigureEvm<Header = alloy_consensus::Header, Transaction = TransactionSigned>,
|
||||
{
|
||||
type DB = DB;
|
||||
type Primitives = OpPrimitives;
|
||||
|
||||
@ -57,6 +57,7 @@ impl OpEvmConfig {
|
||||
|
||||
impl ConfigureEvmEnv for OpEvmConfig {
|
||||
type Header = Header;
|
||||
type Transaction = TransactionSigned;
|
||||
type Error = DecodeError;
|
||||
|
||||
fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) {
|
||||
|
||||
@ -34,7 +34,7 @@ use reth_optimism_rpc::{
|
||||
OpEthApi, SequencerClient,
|
||||
};
|
||||
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
|
||||
use reth_primitives::BlockBody;
|
||||
use reth_primitives::{BlockBody, TransactionSigned};
|
||||
use reth_provider::{
|
||||
providers::ChainStorage, BlockBodyReader, BlockBodyWriter, CanonStateSubscriptions,
|
||||
ChainSpecProvider, DBProvider, EthStorage, ProviderResult, ReadBodyInput,
|
||||
@ -468,7 +468,7 @@ where
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
|
||||
+ Unpin
|
||||
+ 'static,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
{
|
||||
let payload_builder = reth_optimism_payload_builder::OpPayloadBuilder::new(evm_config)
|
||||
.with_transactions(self.best_transactions)
|
||||
|
||||
@ -98,7 +98,7 @@ impl<EvmConfig, Txs> OpPayloadBuilder<EvmConfig, Txs> {
|
||||
}
|
||||
impl<EvmConfig, Txs> OpPayloadBuilder<EvmConfig, Txs>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
Txs: OpPayloadTransactions,
|
||||
{
|
||||
/// Constructs an Optimism payload from the transactions sent via the
|
||||
@ -155,7 +155,7 @@ where
|
||||
|
||||
impl<EvmConfig, Txs> OpPayloadBuilder<EvmConfig, Txs>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
{
|
||||
/// Returns the configured [`CfgEnvWithHandlerCfg`] and [`BlockEnv`] for the targeted payload
|
||||
/// (that has the `parent` as its parent).
|
||||
@ -217,7 +217,7 @@ impl<Pool, Client, EvmConfig, Txs> PayloadBuilder<Pool, Client> for OpPayloadBui
|
||||
where
|
||||
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = OpChainSpec>,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
Txs: OpPayloadTransactions,
|
||||
{
|
||||
type Attributes = OpPayloadBuilderAttributes;
|
||||
@ -294,7 +294,7 @@ where
|
||||
ctx: &OpPayloadBuilderCtx<EvmConfig>,
|
||||
) -> Result<BuildOutcomeKind<ExecutedPayload>, PayloadBuilderError>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
DB: Database<Error = ProviderError>,
|
||||
{
|
||||
let Self { pool, best } = self;
|
||||
@ -339,7 +339,7 @@ where
|
||||
ctx: OpPayloadBuilderCtx<EvmConfig>,
|
||||
) -> Result<BuildOutcomeKind<OpBuiltPayload>, PayloadBuilderError>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
DB: Database<Error = ProviderError> + AsRef<P>,
|
||||
P: StateRootProvider + HashedPostStateProvider,
|
||||
{
|
||||
@ -465,7 +465,7 @@ where
|
||||
ctx: &OpPayloadBuilderCtx<EvmConfig>,
|
||||
) -> Result<ExecutionWitness, PayloadBuilderError>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
DB: Database<Error = ProviderError> + AsRef<P>,
|
||||
P: StateProofProvider,
|
||||
{
|
||||
@ -700,7 +700,7 @@ impl<EvmConfig> OpPayloadBuilderCtx<EvmConfig> {
|
||||
|
||||
impl<EvmConfig> OpPayloadBuilderCtx<EvmConfig>
|
||||
where
|
||||
EvmConfig: ConfigureEvm<Header = Header>,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
{
|
||||
/// apply eip-4788 pre block contract call
|
||||
pub fn apply_pre_beacon_root_contract_call<DB>(
|
||||
|
||||
@ -7,7 +7,7 @@ use alloy_primitives::{BlockNumber, B256};
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||
use reth_evm::ConfigureEvm;
|
||||
use reth_optimism_consensus::calculate_receipt_root_no_memo_optimism;
|
||||
use reth_primitives::{Receipt, SealedBlockWithSenders};
|
||||
use reth_primitives::{Receipt, SealedBlockWithSenders, TransactionSigned};
|
||||
use reth_provider::{
|
||||
BlockReader, BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, ExecutionOutcome, ProviderTx,
|
||||
ReceiptProvider, StateProviderFactory,
|
||||
@ -33,7 +33,7 @@ where
|
||||
+ ChainSpecProvider<ChainSpec: EthChainSpec + EthereumHardforks>
|
||||
+ StateProviderFactory,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = ProviderTx<N::Provider>>>,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
>,
|
||||
{
|
||||
#[inline]
|
||||
|
||||
@ -9,7 +9,7 @@ use reth_chainspec::ChainSpecProvider;
|
||||
use reth_evm::ConfigureEvm;
|
||||
use reth_optimism_chainspec::OpChainSpec;
|
||||
use reth_optimism_payload_builder::OpPayloadBuilder;
|
||||
use reth_primitives::SealedHeader;
|
||||
use reth_primitives::{SealedHeader, TransactionSigned};
|
||||
use reth_provider::{BlockReaderIdExt, ProviderError, ProviderResult, StateProviderFactory};
|
||||
pub use reth_rpc_api::DebugExecutionWitnessApiServer;
|
||||
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
|
||||
@ -49,7 +49,7 @@ where
|
||||
+ StateProviderFactory
|
||||
+ ChainSpecProvider<ChainSpec = OpChainSpec>
|
||||
+ 'static,
|
||||
EvmConfig: ConfigureEvm<Header = Header> + 'static,
|
||||
EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned> + 'static,
|
||||
{
|
||||
fn execute_payload(
|
||||
&self,
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
//! Network: NetworkInfo + Peers + Clone + 'static,
|
||||
//! Events:
|
||||
//! CanonStateSubscriptions<Primitives = reth_primitives::EthPrimitives> + Clone + 'static,
|
||||
//! EvmConfig: ConfigureEvm<Header = Header>,
|
||||
//! EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
//! BlockExecutor: BlockExecutorProvider<Primitives = Events::Primitives>,
|
||||
//! Consensus: reth_consensus::FullConsensus + Clone + 'static,
|
||||
//! {
|
||||
@ -135,7 +135,7 @@
|
||||
//! CanonStateSubscriptions<Primitives = reth_primitives::EthPrimitives> + Clone + 'static,
|
||||
//! EngineApi: EngineApiServer<EngineT>,
|
||||
//! EngineT: EngineTypes,
|
||||
//! EvmConfig: ConfigureEvm<Header = Header>,
|
||||
//! EvmConfig: ConfigureEvm<Header = Header, Transaction = TransactionSigned>,
|
||||
//! BlockExecutor: BlockExecutorProvider<Primitives = Events::Primitives>,
|
||||
//! Consensus: reth_consensus::FullConsensus + Clone + 'static,
|
||||
//! {
|
||||
|
||||
@ -16,6 +16,7 @@ workspace = true
|
||||
revm.workspace = true
|
||||
revm-inspectors.workspace = true
|
||||
revm-primitives = { workspace = true, features = ["dev"] }
|
||||
reth-primitives-traits.workspace = true
|
||||
reth-errors.workspace = true
|
||||
reth-evm.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
|
||||
@ -19,7 +19,7 @@ use futures::Future;
|
||||
use reth_chainspec::EthChainSpec;
|
||||
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
|
||||
use reth_node_api::BlockBody;
|
||||
use reth_primitives::TransactionSigned;
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_provider::{BlockIdReader, ChainSpecProvider, HeaderProvider};
|
||||
use reth_revm::{
|
||||
database::StateProviderDatabase,
|
||||
@ -664,14 +664,15 @@ pub trait Call: LoadState<Evm: ConfigureEvm<Header = Header>> + SpawnBlocking {
|
||||
where
|
||||
DB: Database + DatabaseCommit,
|
||||
EthApiError: From<DB::Error>,
|
||||
I: IntoIterator<Item = (&'a Address, &'a TransactionSigned)>,
|
||||
I: IntoIterator<Item = (&'a Address, &'a <Self::Evm as ConfigureEvmEnv>::Transaction)>,
|
||||
<Self::Evm as ConfigureEvmEnv>::Transaction: SignedTransaction,
|
||||
{
|
||||
let env = EnvWithHandlerCfg::new_with_cfg_env(cfg, block_env, Default::default());
|
||||
|
||||
let mut evm = self.evm_config().evm_with_env(db, env);
|
||||
let mut index = 0;
|
||||
for (sender, tx) in transactions {
|
||||
if tx.hash() == target_tx_hash {
|
||||
if *tx.tx_hash() == target_tx_hash {
|
||||
// reached the target transaction
|
||||
break
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ pub trait LoadPendingBlock:
|
||||
+ ChainSpecProvider<ChainSpec: EthChainSpec + EthereumHardforks>
|
||||
+ StateProviderFactory,
|
||||
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = ProviderTx<Self::Provider>>>,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = Header, Transaction = ProviderTx<Self::Provider>>,
|
||||
>
|
||||
{
|
||||
/// Returns a handle to the pending block.
|
||||
|
||||
@ -31,7 +31,7 @@ where
|
||||
Pool: TransactionPool<
|
||||
Transaction: PoolTransaction<Consensus = ProviderTx<Self::Provider>>,
|
||||
>,
|
||||
Evm: ConfigureEvm<Header = Header>,
|
||||
Evm: ConfigureEvm<Header = Header, Transaction = ProviderTx<Self::Provider>>,
|
||||
>,
|
||||
{
|
||||
#[inline]
|
||||
|
||||
@ -84,6 +84,8 @@ impl MyEvmConfig {
|
||||
|
||||
impl ConfigureEvmEnv for MyEvmConfig {
|
||||
type Header = Header;
|
||||
type Transaction = TransactionSigned;
|
||||
|
||||
type Error = Infallible;
|
||||
|
||||
fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) {
|
||||
|
||||
@ -148,6 +148,7 @@ impl StatefulPrecompileMut for WrappedPrecompile {
|
||||
|
||||
impl ConfigureEvmEnv for MyEvmConfig {
|
||||
type Header = Header;
|
||||
type Transaction = TransactionSigned;
|
||||
type Error = Infallible;
|
||||
|
||||
fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) {
|
||||
|
||||
Reference in New Issue
Block a user