refactor: change PayloadConfig to use parent header instead of parent block (#12159)

This commit is contained in:
Léa Narzis
2024-10-29 16:52:00 +07:00
committed by GitHub
parent b48fa68f65
commit 7880d4ddb0
6 changed files with 47 additions and 39 deletions

View File

@ -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(),