mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: change PayloadConfig to use parent header instead of parent block (#12159)
This commit is contained in:
@ -341,7 +341,7 @@ where
|
||||
args: BuildArguments<Pool, Client, Self::Attributes, Self::BuiltPayload>,
|
||||
) -> Result<BuildOutcome<Self::BuiltPayload>, PayloadBuilderError> {
|
||||
let BuildArguments { client, pool, cached_reads, config, cancel, best_payload } = args;
|
||||
let PayloadConfig { parent_block, extra_data, attributes } = config;
|
||||
let PayloadConfig { parent_header, extra_data, attributes } = config;
|
||||
|
||||
let chain_spec = client.chain_spec();
|
||||
|
||||
@ -354,7 +354,7 @@ where
|
||||
client,
|
||||
pool,
|
||||
cached_reads,
|
||||
config: PayloadConfig { parent_block, extra_data, attributes: attributes.0 },
|
||||
config: PayloadConfig { parent_header, extra_data, attributes: attributes.0 },
|
||||
cancel,
|
||||
best_payload,
|
||||
})
|
||||
@ -365,10 +365,10 @@ where
|
||||
client: &Client,
|
||||
config: PayloadConfig<Self::Attributes>,
|
||||
) -> Result<Self::BuiltPayload, PayloadBuilderError> {
|
||||
let PayloadConfig { parent_block, extra_data, attributes } = config;
|
||||
let PayloadConfig { parent_header, extra_data, attributes } = config;
|
||||
let chain_spec = client.chain_spec();
|
||||
<reth_ethereum_payload_builder::EthereumPayloadBuilder as PayloadBuilder<Pool, Client>>::build_empty_payload(&reth_ethereum_payload_builder::EthereumPayloadBuilder::new(EthEvmConfig::new(chain_spec.clone())),client,
|
||||
PayloadConfig { parent_block, extra_data, attributes: attributes.0})
|
||||
PayloadConfig { parent_header, extra_data, attributes: attributes.0})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ use reth::{
|
||||
use reth_basic_payload_builder::{BasicPayloadJobGeneratorConfig, PayloadBuilder, PayloadConfig};
|
||||
use reth_node_api::PayloadBuilderAttributes;
|
||||
use reth_payload_builder::{PayloadBuilderError, PayloadJobGenerator};
|
||||
use reth_primitives::BlockNumberOrTag;
|
||||
use reth_primitives::{BlockNumberOrTag, SealedHeader};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// The generator type that creates new jobs that builds empty blocks.
|
||||
@ -77,7 +77,10 @@ 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);
|
||||
let hash = parent_block.hash();
|
||||
let header = SealedHeader::new(parent_block.header().clone(), hash);
|
||||
|
||||
let config = PayloadConfig::new(Arc::new(header), Bytes::default(), attributes);
|
||||
Ok(EmptyBlockPayloadJob {
|
||||
client: self.client.clone(),
|
||||
_pool: self.pool.clone(),
|
||||
|
||||
Reference in New Issue
Block a user