mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
fix new payload notifier
This commit is contained in:
@@ -119,6 +119,7 @@ impl<T: BeaconChainTypes> PayloadNotifier<T> {
|
|||||||
&self.chain,
|
&self.chain,
|
||||||
self.block.message().tree_hash_root(),
|
self.block.message().tree_hash_root(),
|
||||||
self.block.message().slot(),
|
self.block.message().slot(),
|
||||||
|
self.block.message().parent_root(),
|
||||||
self.block.message().try_into()?,
|
self.block.message().try_into()?,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
@@ -139,6 +140,7 @@ pub async fn notify_new_payload<T: BeaconChainTypes>(
|
|||||||
chain: &Arc<BeaconChain<T>>,
|
chain: &Arc<BeaconChain<T>>,
|
||||||
beacon_block_root: Hash256,
|
beacon_block_root: Hash256,
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
|
parent_beacon_block_root: Hash256,
|
||||||
new_payload_request: NewPayloadRequest<'_, T::EthSpec>,
|
new_payload_request: NewPayloadRequest<'_, T::EthSpec>,
|
||||||
) -> Result<PayloadVerificationStatus, BlockError> {
|
) -> Result<PayloadVerificationStatus, BlockError> {
|
||||||
let execution_layer = chain
|
let execution_layer = chain
|
||||||
@@ -189,11 +191,9 @@ pub async fn notify_new_payload<T: BeaconChainTypes>(
|
|||||||
{
|
{
|
||||||
// This block has not yet been applied to fork choice, so the latest block that was
|
// This block has not yet been applied to fork choice, so the latest block that was
|
||||||
// imported to fork choice was the parent.
|
// imported to fork choice was the parent.
|
||||||
let latest_root = new_payload_request.parent_beacon_block_root()?;
|
|
||||||
|
|
||||||
chain
|
chain
|
||||||
.process_invalid_execution_payload(&InvalidationOperation::InvalidateMany {
|
.process_invalid_execution_payload(&InvalidationOperation::InvalidateMany {
|
||||||
head_block_root: *latest_root,
|
head_block_root: parent_beacon_block_root,
|
||||||
always_invalidate_head: false,
|
always_invalidate_head: false,
|
||||||
latest_valid_ancestor: latest_valid_hash,
|
latest_valid_ancestor: latest_valid_hash,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -62,8 +62,16 @@ impl<T: BeaconChainTypes> PayloadNotifier<T> {
|
|||||||
Ok(precomputed_status)
|
Ok(precomputed_status)
|
||||||
} else {
|
} else {
|
||||||
let block_root = self.envelope.message.beacon_block_root;
|
let block_root = self.envelope.message.beacon_block_root;
|
||||||
|
let parent_root = self.block.message().parent_root();
|
||||||
let request = Self::build_new_payload_request(&self.envelope, &self.block)?;
|
let request = Self::build_new_payload_request(&self.envelope, &self.block)?;
|
||||||
notify_new_payload(&self.chain, block_root, self.envelope.slot(), request).await
|
notify_new_payload(
|
||||||
|
&self.chain,
|
||||||
|
block_root,
|
||||||
|
self.envelope.slot(),
|
||||||
|
parent_root,
|
||||||
|
request,
|
||||||
|
)
|
||||||
|
.await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user