chore: Remove ChainSpec from PayloadConfig (#11103)

Co-authored-by: garwah <garwah@garwah>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
garwah
2024-09-25 16:45:51 +10:00
committed by GitHub
parent 53f23bf3dc
commit ab66f58e5c
12 changed files with 28 additions and 52 deletions

View File

@ -5,7 +5,6 @@ use reth::{
transaction_pool::TransactionPool,
};
use reth_basic_payload_builder::{BasicPayloadJobGeneratorConfig, PayloadBuilder, PayloadConfig};
use reth_chainspec::ChainSpec;
use reth_node_api::PayloadBuilderAttributes;
use reth_payload_builder::{PayloadBuilderError, PayloadJobGenerator};
use reth_primitives::{BlockNumberOrTag, Bytes};
@ -22,8 +21,6 @@ pub struct EmptyBlockPayloadJobGenerator<Client, Pool, Tasks, Builder> {
executor: Tasks,
/// The configuration for the job generator.
_config: BasicPayloadJobGeneratorConfig,
/// The chain spec.
chain_spec: Arc<ChainSpec>,
/// The type responsible for building payloads.
///
/// See [PayloadBuilder]
@ -40,10 +37,9 @@ impl<Client, Pool, Tasks, Builder> EmptyBlockPayloadJobGenerator<Client, Pool, T
pool: Pool,
executor: Tasks,
config: BasicPayloadJobGeneratorConfig,
chain_spec: Arc<ChainSpec>,
builder: Builder,
) -> Self {
Self { client, pool, executor, _config: config, builder, chain_spec }
Self { client, pool, executor, _config: config, builder }
}
}
@ -80,12 +76,7 @@ where
// we already know the hash, so we can seal it
block.seal(attributes.parent())
};
let config = PayloadConfig::new(
Arc::new(parent_block),
Bytes::default(),
attributes,
Arc::clone(&self.chain_spec),
);
let config = PayloadConfig::new(Arc::new(parent_block), Bytes::default(), attributes);
Ok(EmptyBlockPayloadJob {
client: self.client.clone(),
_pool: self.pool.clone(),

View File

@ -56,7 +56,6 @@ where
pool,
ctx.task_executor().clone(),
payload_job_config,
ctx.chain_spec().clone(),
reth_ethereum_payload_builder::EthereumPayloadBuilder::new(EthEvmConfig::new(
ctx.chain_spec(),
)),