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

fix(l1): full-sync with both consensus and execution node #2081

Draft
wants to merge 4 commits into
base: fix/full-sync
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
9 changes: 7 additions & 2 deletions crates/networking/p2p/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,13 @@ impl SyncManager {
}
}

// Check if we already found the sync head
let sync_head_found = block_hashes.contains(&sync_head);
// Filter out everything after the sync_head
let mut sync_head_found = false;
if let Some(index) = block_hashes.iter().position(|&hash| hash == sync_head) {
sync_head_found = true;
block_hashes = block_hashes.iter().take(index + 1).cloned().collect();
}

// Update current fetch head if needed
let last_block_hash = last_block_header.compute_block_hash();
if !sync_head_found {
Expand Down
Loading