fix(exex): check exex head against node head to determine canonical (#11410)

This commit is contained in:
Alexey Shekhirin
2024-10-02 13:29:16 +03:00
committed by GitHub
parent 82cc96d0c0
commit 8d3a03a3b9

View File

@ -176,10 +176,13 @@ where
/// Checks if the ExEx head is on the canonical chain.
///
/// If the head block is not found in the database, it means we're not on the canonical chain
/// and we need to revert the notification with the ExEx head block.
/// If the head block is not found in the database or it's ahead of the node head, it means
/// we're not on the canonical chain and we need to revert the notification with the ExEx
/// head block.
fn check_canonical(&mut self) -> eyre::Result<Option<ExExNotification>> {
if self.provider.is_known(&self.exex_head.block.hash)? {
if self.provider.is_known(&self.exex_head.block.hash)? &&
self.exex_head.block.number <= self.node_head.number
{
debug!(target: "exex::notifications", "ExEx head is on the canonical chain");
return Ok(None)
}