fix(builder): desired block gas limit (#13351)

This commit is contained in:
Roman Krasiuk
2024-12-12 17:29:33 +01:00
committed by GitHub
parent 6ff2510ad9
commit e9577729f8
19 changed files with 66 additions and 50 deletions

View File

@ -27,7 +27,6 @@ reth-consensus.workspace = true
reth-beacon-consensus.workspace = true
reth-rpc.workspace = true
reth-node-api.workspace = true
reth-node-core.workspace = true
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-revm = { workspace = true, features = ["std"] }
@ -43,7 +42,7 @@ eyre.workspace = true
reth-chainspec.workspace = true
reth-db.workspace = true
reth-exex.workspace = true
reth-node-api.workspace = true
reth-node-core.workspace = true
reth-payload-primitives.workspace = true
reth-e2e-test-utils.workspace = true
reth-rpc-eth-api.workspace = true

View File

@ -1,7 +1,5 @@
//! Ethereum Node types config.
use std::sync::Arc;
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
use reth_beacon_consensus::EthBeaconConsensus;
use reth_chainspec::ChainSpec;
@ -24,7 +22,6 @@ 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};
@ -35,6 +32,7 @@ use reth_transaction_pool::{
TransactionValidationTaskExecutor,
};
use reth_trie_db::MerklePatriciaTrie;
use std::sync::Arc;
use crate::{EthEngineTypes, EthEvmConfig};
@ -230,24 +228,9 @@ where
}
/// A basic ethereum payload service.
#[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 }
}
}
#[derive(Clone, Default, Debug)]
#[non_exhaustive]
pub struct EthereumPayloadBuilder;
impl EthereumPayloadBuilder {
/// A helper method initializing [`PayloadBuilderService`] with the given EVM config.
@ -270,9 +253,11 @@ impl EthereumPayloadBuilder {
PayloadBuilderAttributes = EthPayloadBuilderAttributes,
>,
{
let payload_builder =
reth_ethereum_payload_builder::EthereumPayloadBuilder::new(evm_config, self.config);
let conf = ctx.payload_builder_config();
let payload_builder = reth_ethereum_payload_builder::EthereumPayloadBuilder::new(
evm_config,
EthereumBuilderConfig::new(conf.extradata_bytes()).with_gas_limit(conf.gas_limit()),
);
let payload_job_config = BasicPayloadJobGeneratorConfig::default()
.interval(conf.interval())