chore: relax some eth component bounds (#15977)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2025-04-28 21:00:09 +03:00
committed by GitHub
parent 6c94e9090d
commit 2dd811cc69
3 changed files with 16 additions and 12 deletions

View File

@@ -2,20 +2,20 @@
pub use crate::{payload::EthereumPayloadBuilder, EthereumEngineValidator};
use crate::{EthEngineTypes, EthEvmConfig};
use alloy_eips::merge::EPOCH_SLOTS;
use reth_chainspec::{ChainSpec, EthChainSpec};
use alloy_eips::{eip7840::BlobParams, merge::EPOCH_SLOTS};
use reth_chainspec::{ChainSpec, EthChainSpec, EthereumHardforks};
use reth_consensus::{ConsensusError, FullConsensus};
use reth_ethereum_consensus::EthBeaconConsensus;
use reth_ethereum_engine_primitives::{
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes,
};
use reth_ethereum_primitives::{EthPrimitives, PooledTransaction};
use reth_ethereum_primitives::{EthPrimitives, PooledTransaction, TransactionSigned};
use reth_evm::{
execute::BasicBlockExecutorProvider, ConfigureEvm, EvmFactory, EvmFactoryFor,
NextBlockEnvAttributes,
};
use reth_network::{EthNetworkPrimitives, NetworkHandle, PeersInfo};
use reth_node_api::{AddOnsContext, FullNodeComponents, NodeAddOns, TxTy};
use reth_node_api::{AddOnsContext, FullNodeComponents, NodeAddOns, NodePrimitives, TxTy};
use reth_node_builder::{
components::{
BasicPayloadServiceBuilder, ComponentsBuilder, ConsensusBuilder, ExecutorBuilder,
@@ -330,7 +330,10 @@ pub struct EthereumPoolBuilder {
impl<Types, Node> PoolBuilder<Node> for EthereumPoolBuilder
where
Types: NodeTypes<ChainSpec = ChainSpec, Primitives = EthPrimitives>,
Types: NodeTypes<
ChainSpec: EthereumHardforks,
Primitives: NodePrimitives<SignedTx = TransactionSigned>,
>,
Node: FullNodeTypes<Types = Types>,
{
type Pool = EthTransactionPool<Node::Provider, DiskFileBlobStore>;
@@ -342,13 +345,14 @@ where
let blob_cache_size = if let Some(blob_cache_size) = pool_config.blob_cache_size {
blob_cache_size
} else {
// get the current blob params for the current timestamp
// get the current blob params for the current timestamp, fallback to default Cancun
// params
let current_timestamp =
SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?.as_secs();
let blob_params = ctx
.chain_spec()
.blob_params_at_timestamp(current_timestamp)
.unwrap_or(ctx.chain_spec().blob_params.cancun);
.unwrap_or_else(BlobParams::cancun);
// Derive the blob cache size from the target blob count, to auto scale it by
// multiplying it with the slot count for 2 epochs: 384 for pectra

View File

@@ -1,6 +1,6 @@
//! Payload component configuration for the Ethereum node.
use reth_chainspec::ChainSpec;
use reth_chainspec::EthereumHardforks;
use reth_ethereum_engine_primitives::{
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes,
};
@@ -20,7 +20,7 @@ pub struct EthereumPayloadBuilder;
impl<Types, Node, Pool, Evm> PayloadBuilderBuilder<Node, Pool, Evm> for EthereumPayloadBuilder
where
Types: NodeTypes<ChainSpec = ChainSpec, Primitives = EthPrimitives>,
Types: NodeTypes<ChainSpec: EthereumHardforks, Primitives = EthPrimitives>,
Node: FullNodeTypes<Types = Types>,
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TxTy<Node::Types>>>
+ Unpin

View File

@@ -18,7 +18,7 @@ use reth_basic_payload_builder::{
is_better_payload, BuildArguments, BuildOutcome, MissingPayloadBehaviour, PayloadBuilder,
PayloadConfig,
};
use reth_chainspec::{ChainSpec, ChainSpecProvider, EthChainSpec, EthereumHardforks};
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
use reth_errors::{BlockExecutionError, BlockValidationError};
use reth_ethereum_primitives::{EthPrimitives, TransactionSigned};
use reth_evm::{
@@ -77,7 +77,7 @@ impl<Pool, Client, EvmConfig> EthereumPayloadBuilder<Pool, Client, EvmConfig> {
impl<Pool, Client, EvmConfig> PayloadBuilder for EthereumPayloadBuilder<Pool, Client, EvmConfig>
where
EvmConfig: ConfigureEvm<Primitives = EthPrimitives, NextBlockEnvCtx = NextBlockEnvAttributes>,
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec> + Clone,
Client: StateProviderFactory + ChainSpecProvider<ChainSpec: EthereumHardforks> + Clone,
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
{
type Attributes = EthPayloadBuilderAttributes;
@@ -143,7 +143,7 @@ pub fn default_ethereum_payload<EvmConfig, Client, Pool, F>(
) -> Result<BuildOutcome<EthBuiltPayload>, PayloadBuilderError>
where
EvmConfig: ConfigureEvm<Primitives = EthPrimitives, NextBlockEnvCtx = NextBlockEnvAttributes>,
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = ChainSpec>,
Client: StateProviderFactory + ChainSpecProvider<ChainSpec: EthereumHardforks>,
Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>,
F: FnOnce(BestTransactionsAttributes) -> BestTransactionsIter<Pool>,
{