Skip to content

Commit 516de43

Browse files
committed
docs(archiver): document wall-clock orphan-block prune
1 parent aad2641 commit 516de43

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

yarn-project/archiver/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ The archiver runs a periodic sync loop with two phases:
2626

2727
```
2828
sync()
29-
├── processQueuedBlocks() # Handle blocks pushed via addBlock()
29+
├── processQueuedBlocks() # Handle blocks pushed via addBlock()
30+
├── pruneOrphanProposedBlocks() # Wall-clock prune of orphan block-only tips
3031
└── syncFromL1()
31-
├── handleL1ToL2Messages() # Sync messages from Inbox contract
32-
├── handleCheckpoints() # Sync checkpoints from Rollup contract
32+
├── handleL1ToL2Messages() # Sync messages from Inbox contract
33+
├── handleCheckpoints() # Sync checkpoints from Rollup contract
3334
├── pruneUncheckpointedBlocks() # Prune provisional blocks from expired slots
34-
├── handleEpochPrune() # Proactive unwind before proof window expires
35+
├── handleEpochPrune() # Proactive unwind before proof window expires
3536
└── checkForNewCheckpointsBeforeL1SyncPoint() # Handle L1 reorg edge case
3637
```
3738

@@ -100,8 +101,9 @@ Queued blocks are processed at the start of each sync iteration. This allows the
100101
Blocks added via `addBlock()` are considered "provisional" until they appear in an L1 checkpoint. These provisional blocks may need to be reconciled when:
101102
- **Checkpoint mismatch**: A checkpoint lands on L1 with different blocks than stored locally (e.g., a different proposer won the slot)
102103
- **Slot expiration**: An L2 slot ends without any checkpoint being mined on L1
104+
- **Orphan proposed block**: Under proposer pipelining, a proposer can broadcast a block-only proposal but never the matching `CheckpointProposal` (e.g. it crashes before assembling the checkpoint). The provisional block then has no proposed checkpoint backing it.
103105

104-
When `handleCheckpoints()` processes incoming checkpoints, it compares archive roots of local blocks against the checkpoint's blocks. If they differ, local blocks are pruned and replaced with the checkpoint's blocks. After checkpoint sync, `pruneUncheckpointedBlocks()` removes any remaining provisional blocks from slots that have ended. Both cases emit `L2PruneUncheckpointed`.
106+
When `handleCheckpoints()` processes incoming checkpoints, it compares archive roots of local blocks against the checkpoint's blocks. If they differ, local blocks are pruned and replaced with the checkpoint's blocks. After checkpoint sync, `pruneUncheckpointedBlocks()` removes any remaining provisional blocks from slots that have ended. Independently, `pruneOrphanProposedBlocks()` runs on wall-clock time (so it fires during quiet L1 periods) and removes a block-only tip once its build slot ended without a matching proposed checkpoint, plus a grace window configured via `orphanProposedBlockPruneGraceSeconds`. All three cases emit `L2PruneUncheckpointed`.
105107

106108
### Querying Block Data
107109

0 commit comments

Comments
 (0)