mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat(builder): ethereum builder config (#13315)
This commit is contained in:
@ -8,6 +8,7 @@ use reth_chainspec::ChainSpec;
|
||||
use reth_ethereum_engine_primitives::{
|
||||
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes,
|
||||
};
|
||||
use reth_ethereum_payload_builder::EthereumBuilderConfig;
|
||||
use reth_evm::execute::BasicBlockExecutorProvider;
|
||||
use reth_evm_ethereum::execute::EthExecutionStrategyFactory;
|
||||
use reth_network::{EthNetworkPrimitives, NetworkHandle, PeersInfo};
|
||||
@ -23,6 +24,7 @@ use reth_node_builder::{
|
||||
rpc::{EngineValidatorBuilder, RpcAddOns},
|
||||
BuilderContext, Node, NodeAdapter, NodeComponentsBuilder, PayloadBuilderConfig, PayloadTypes,
|
||||
};
|
||||
use reth_node_core::version::default_extra_data_bytes;
|
||||
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
|
||||
use reth_primitives::{EthPrimitives, PooledTransactionsElement};
|
||||
use reth_provider::{CanonStateSubscriptions, EthStorage};
|
||||
@ -228,9 +230,24 @@ where
|
||||
}
|
||||
|
||||
/// A basic ethereum payload service.
|
||||
#[derive(Debug, Default, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct EthereumPayloadBuilder;
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct EthereumPayloadBuilder {
|
||||
/// Payload builder configuration.
|
||||
config: EthereumBuilderConfig,
|
||||
}
|
||||
|
||||
impl Default for EthereumPayloadBuilder {
|
||||
fn default() -> Self {
|
||||
Self { config: EthereumBuilderConfig::new(default_extra_data_bytes()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl EthereumPayloadBuilder {
|
||||
/// Create new ethereum payload builder.
|
||||
pub const fn new(config: EthereumBuilderConfig) -> Self {
|
||||
Self { config }
|
||||
}
|
||||
}
|
||||
|
||||
impl EthereumPayloadBuilder {
|
||||
/// A helper method initializing [`PayloadBuilderService`] with the given EVM config.
|
||||
@ -254,7 +271,7 @@ impl EthereumPayloadBuilder {
|
||||
>,
|
||||
{
|
||||
let payload_builder =
|
||||
reth_ethereum_payload_builder::EthereumPayloadBuilder::new(evm_config);
|
||||
reth_ethereum_payload_builder::EthereumPayloadBuilder::new(evm_config, self.config);
|
||||
let conf = ctx.payload_builder_config();
|
||||
|
||||
let payload_job_config = BasicPayloadJobGeneratorConfig::default()
|
||||
|
||||
Reference in New Issue
Block a user