mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: configurable EVM execution limits (#21088)
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ use reth_network::{
|
||||
PeersInfo,
|
||||
};
|
||||
use reth_node_api::{
|
||||
AddOnsContext, BlockTy, BuildNextEnv, EngineTypes, FullNodeComponents, HeaderTy, NodeAddOns,
|
||||
AddOnsContext, BuildNextEnv, EngineTypes, FullNodeComponents, HeaderTy, NodeAddOns,
|
||||
NodePrimitives, PayloadAttributesBuilder, PayloadTypes, PrimitivesTy, TxTy,
|
||||
};
|
||||
use reth_node_builder::{
|
||||
@@ -165,6 +165,7 @@ impl OpNode {
|
||||
self.args;
|
||||
ComponentsBuilder::default()
|
||||
.node_types::<Node>()
|
||||
.executor(OpExecutorBuilder::default())
|
||||
.pool(
|
||||
OpPoolBuilder::default()
|
||||
.with_enable_tx_conditional(self.args.enable_tx_conditional)
|
||||
@@ -173,7 +174,6 @@ impl OpNode {
|
||||
self.args.supervisor_safety_level,
|
||||
),
|
||||
)
|
||||
.executor(OpExecutorBuilder::default())
|
||||
.payload(BasicPayloadServiceBuilder::new(
|
||||
OpPayloadBuilder::new(compute_pending_block)
|
||||
.with_da_config(self.da_config.clone())
|
||||
@@ -957,14 +957,19 @@ impl<T> OpPoolBuilder<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<Node, T> PoolBuilder<Node> for OpPoolBuilder<T>
|
||||
impl<Node, T, Evm> PoolBuilder<Node, Evm> for OpPoolBuilder<T>
|
||||
where
|
||||
Node: FullNodeTypes<Types: NodeTypes<ChainSpec: OpHardforks>>,
|
||||
T: EthPoolTransaction<Consensus = TxTy<Node::Types>> + OpPooledTx,
|
||||
Evm: ConfigureEvm<Primitives = PrimitivesTy<Node::Types>> + Clone + 'static,
|
||||
{
|
||||
type Pool = OpTransactionPool<Node::Provider, DiskFileBlobStore, T, BlockTy<Node::Types>>;
|
||||
type Pool = OpTransactionPool<Node::Provider, DiskFileBlobStore, Evm, T>;
|
||||
|
||||
async fn build_pool(self, ctx: &BuilderContext<Node>) -> eyre::Result<Self::Pool> {
|
||||
async fn build_pool(
|
||||
self,
|
||||
ctx: &BuilderContext<Node>,
|
||||
evm_config: Evm,
|
||||
) -> eyre::Result<Self::Pool> {
|
||||
let Self { pool_config_overrides, .. } = self;
|
||||
|
||||
// supervisor used for interop
|
||||
@@ -982,27 +987,27 @@ where
|
||||
.await;
|
||||
|
||||
let blob_store = reth_node_builder::components::create_blob_store(ctx)?;
|
||||
let validator = TransactionValidationTaskExecutor::eth_builder(ctx.provider().clone())
|
||||
.no_eip4844()
|
||||
.with_head_timestamp(ctx.head().timestamp)
|
||||
.with_max_tx_input_bytes(ctx.config().txpool.max_tx_input_bytes)
|
||||
.kzg_settings(ctx.kzg_settings()?)
|
||||
.set_tx_fee_cap(ctx.config().rpc.rpc_tx_fee_cap)
|
||||
.with_max_tx_gas_limit(ctx.config().txpool.max_tx_gas_limit)
|
||||
.with_minimum_priority_fee(ctx.config().txpool.minimum_priority_fee)
|
||||
.with_additional_tasks(
|
||||
pool_config_overrides
|
||||
.additional_validation_tasks
|
||||
.unwrap_or_else(|| ctx.config().txpool.additional_validation_tasks),
|
||||
)
|
||||
.build_with_tasks(ctx.task_executor().clone(), blob_store.clone())
|
||||
.map(|validator| {
|
||||
OpTransactionValidator::new(validator)
|
||||
// In --dev mode we can't require gas fees because we're unable to decode
|
||||
// the L1 block info
|
||||
.require_l1_data_gas_fee(!ctx.config().dev.dev)
|
||||
.with_supervisor(supervisor_client.clone())
|
||||
});
|
||||
let validator =
|
||||
TransactionValidationTaskExecutor::eth_builder(ctx.provider().clone(), evm_config)
|
||||
.no_eip4844()
|
||||
.with_max_tx_input_bytes(ctx.config().txpool.max_tx_input_bytes)
|
||||
.kzg_settings(ctx.kzg_settings()?)
|
||||
.set_tx_fee_cap(ctx.config().rpc.rpc_tx_fee_cap)
|
||||
.with_max_tx_gas_limit(ctx.config().txpool.max_tx_gas_limit)
|
||||
.with_minimum_priority_fee(ctx.config().txpool.minimum_priority_fee)
|
||||
.with_additional_tasks(
|
||||
pool_config_overrides
|
||||
.additional_validation_tasks
|
||||
.unwrap_or_else(|| ctx.config().txpool.additional_validation_tasks),
|
||||
)
|
||||
.build_with_tasks(ctx.task_executor().clone(), blob_store.clone())
|
||||
.map(|validator| {
|
||||
OpTransactionValidator::new(validator)
|
||||
// In --dev mode we can't require gas fees because we're unable to decode
|
||||
// the L1 block info
|
||||
.require_l1_data_gas_fee(!ctx.config().dev.dev)
|
||||
.with_supervisor(supervisor_client.clone())
|
||||
});
|
||||
|
||||
let final_pool_config = pool_config_overrides.apply(ctx.pool_config());
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
//! ComponentsBuilder::default()
|
||||
//! .node_types::<RethFullAdapter<_, OpNode>>()
|
||||
//! .noop_pool::<OpPooledTransaction>()
|
||||
//! .noop_network::<OpNetworkPrimitives>()
|
||||
//! .noop_consensus()
|
||||
//! .executor(OpExecutorBuilder::default())
|
||||
//! .noop_consensus()
|
||||
//! .noop_network::<OpNetworkPrimitives>()
|
||||
//! .noop_payload(),
|
||||
//! Box::new(()) as Box<dyn OnComponentInitializedHook<_>>,
|
||||
//! )
|
||||
|
||||
Reference in New Issue
Block a user