From 67e9f66bf22098d33c3bad28b136c12006d0ddd5 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Mon, 16 Sep 2024 14:31:13 +0100 Subject: [PATCH] update head when node caught up --- crates/exex/exex/src/manager.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/exex/exex/src/manager.rs b/crates/exex/exex/src/manager.rs index 819794342a7f1..7f9645414be30 100644 --- a/crates/exex/exex/src/manager.rs +++ b/crates/exex/exex/src/manager.rs @@ -253,7 +253,6 @@ impl Stream for ExExNotifications { /// committed or reverted after the given head. #[derive(Debug)] pub struct ExExNotificationsWithHead { - #[allow(dead_code)] node_head: Head, components: Node, notifications: Receiver, @@ -302,12 +301,12 @@ impl ExExNotificationsWithHead { /// backfill from the node database. /// - ExEx is ahead of the node head (`node_head.number > exex_head.number`). Wait until the /// node head catches up to the ExEx head, and then repeat the synchronization process. - fn synchronize(&mut self, node_head: Head) -> eyre::Result<()> { + fn synchronize(&mut self) -> eyre::Result<()> { let backfill_job_factory = BackfillJobFactory::new( self.components.block_executor().clone(), self.components.provider().clone(), ); - match self.exex_head.block.number.cmp(&node_head.number) { + match self.exex_head.block.number.cmp(&self.node_head.number) { std::cmp::Ordering::Less => { // ExEx is behind the node head @@ -322,7 +321,7 @@ impl ExExNotificationsWithHead { // ExEx is on the canonical chain, start backfill let backfill = backfill_job_factory - .backfill(self.exex_head.block.number + 1..=node_head.number) + .backfill(self.exex_head.block.number + 1..=self.node_head.number) .into_stream(); self.backfill_job = Some(backfill); } else { @@ -375,7 +374,7 @@ impl Stream for ExExNotificationsWithHead Stream for ExExNotificationsWithHead