Skip to content

Commit bc3d500

Browse files
authored
add event for skipping empty blocks (#493)
1 parent 7f517db commit bc3d500

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

crates/chain-orchestrator/src/event.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ pub enum ChainOrchestratorEvent {
9090
L2ConsolidatedBlockCommitted(L2BlockInfoWithL1Messages),
9191
/// A new block has been sequenced by the sequencer.
9292
BlockSequenced(ScrollBlock),
93+
/// Block building was skipped because the built payload was empty and empty blocks are
94+
/// disabled.
95+
BlockBuildingSkipped,
9396
/// A new block has been signed by the signer.
9497
SignedBlock {
9598
/// The signed block.

crates/chain-orchestrator/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ impl<
313313
.sign_block(block.clone())?;
314314
return Ok(Some(ChainOrchestratorEvent::BlockSequenced(block)));
315315
}
316+
return Ok(Some(ChainOrchestratorEvent::BlockBuildingSkipped));
316317
}
317318
}
318319

crates/node/src/add_ons/remote_block_source.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ where
214214
"Block built successfully, proceeding to next");
215215
break;
216216
}
217+
Some(ChainOrchestratorEvent::BlockBuildingSkipped) => {
218+
tracing::debug!(target: "scroll::remote_source", "Block building skipped (empty block)");
219+
break;
220+
}
217221
Some(_) => {
218222
// Ignore other events, keep waiting
219223
}

0 commit comments

Comments
 (0)