Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions crates/chain-orchestrator/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ pub struct ChainOrchestratorStatus {
pub l2: L2ChainStatus,
}

impl ChainOrchestratorStatus {
/// Returns true if the chain orchestrator is fully synced.
pub const fn is_synced(&self) -> bool {
self.l1.status.is_synced() && self.l2.status.is_synced()
}
}

impl ChainOrchestratorStatus {
/// Creates a new [`ChainOrchestratorStatus`] from the given sync state, latest L1 block number,
pub fn new(
Expand Down
5 changes: 5 additions & 0 deletions crates/node/src/add_ons/remote_block_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ where
continue;
}

if !self.orchestrator_handle.status().await?.is_synced() {
tracing::debug!(target: "scroll::remote_source", "Imported block is valid, but orchestrator is not synced, skipping build");
continue;
}

// Trigger block building on top of the imported block
self.orchestrator_handle.build_block();

Expand Down
Loading