Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip:fix: exex head ahead of host #14001

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/exex/exex/src/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ pub struct ExExNotificationsWithHead<P, E>
where
E: BlockExecutorProvider,
{
/// The node's real head.
node_head: Head,
provider: P,
executor: E,
Expand Down Expand Up @@ -315,10 +316,13 @@ where
if self.provider.is_known(&self.exex_head.block.hash)? &&
self.exex_head.block.number <= self.node_head.number
{
// we have the targeted block and that block is below the current head
debug!(target: "exex::notifications", "ExEx head is on the canonical chain");
return Ok(None)
}

// TODO: skip if exehead is ahead of the node

// If the head block is not found in the database, it means we're not on the canonical
// chain.

Expand Down Expand Up @@ -422,6 +426,8 @@ where
return Poll::Ready(None)
};

// TODO skip if chaintip is lower than exexhead

if let Some(committed_chain) = notification.committed_chain() {
this.exex_head.block = committed_chain.tip().num_hash();
} else if let Some(reverted_chain) = notification.reverted_chain() {
Expand Down
Loading