Skip to content

refactor(archiver): drop unused Inbox recovery state - #171

Draft
spalladino wants to merge 1 commit into
spl/fi-s02-deployment-blockfrom
spl/fi-s10-unused-recovery-state
Draft

spalladino wants to merge 1 commit into
spl/fi-s02-deployment-blockfrom
spl/fi-s10-unused-recovery-state

Conversation

@spalladino

@spalladino spalladino commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

This rung is behavior-preserving. It removes state and a branch in the archiver's Inbox message
synchronizer that no code path can reach, and points two call sites at a helper that already exists.
Nothing about how the node ingests, certifies or recovers Inbox messages changes.

RecoveryState carried a finalizedL1Block that nothing ever read. It was threaded into
startRecovery and stored on the pinned recovery, and the anchor search deliberately ignores it —
searchAnchor reads the finality marker it trusts straight from the store
(getMessagesFinalizedL1Block), precisely because a fresher in-memory height would cover messages
this node never verified. The field is therefore removed from the type, from startRecovery's
signature, and from all six startRecovery call sites.

The persisted finality marker stays exactly where it was. syncPass still receives
finalizedL1Block, still passes it to truncate, and still writes it in every
setMessageSyncState / storeMessages call. Only the copy pinned on the in-memory recovery is gone.

The second removal is the synced-status downgrade applied after continuing a recovery. It existed
for a design where recovery could finish by reaching agreement with L1 at its pinned head. Since
recovery became rollback-then-refetch, continueRecovery has two return paths: pending() when the
per-pass lookup budget runs out before an anchor is found, and rollbackTo, which returns pending()
when the head can no longer be confirmed and { status: 'pending', ... } after committing the
rollback. Neither can yield synced, so the downgrade is dead and the ternary plus the pinned-head
alias it needed are removed. Pending-after-rollback behavior is unchanged — that is what recovery
already returns.

Finally, two places computing the consumed message count from a block header
(ArchiverDataStoreUpdater.getConsumedMessageCount and the checkpoint rolling-hash check in
ArchiverL1Synchronizer) now call the existing exported blockLeafCount helper instead of restating
BigInt(block.header.state.l1ToL2MessageTree.nextAvailableLeafIndex).

Stack position

This is rung 8 of 25 in the Fast Inbox node stack, stacked on spl/fi-s02-deployment-block.

Source

Reconstructs the yarn-project/archiver/ hunks of 5397c7d61f ("refactor: drop unused streaming
Inbox plumbing") from old aztec-packages PR #25440. That commit is deliberately split across this stack; the other
three parts are not here:

  • its checkpoint_proposal_job.ts bucket-hint and fisherman-dummy hunks go to rung FI-S09;
  • its checkpoint_proposal_job.ts range-reuse hunks go to rung FI-S11;
  • its ethereum/src/contracts/chain_state_override.ts override-type hunks and its
    noir-projects/.../rollup_fixture_builder.nr fixture deletion are deferred to the override-type and Noir-fixture cleanup and must not
    enter this stack.

Verification

Red/green does not apply in its usual form: there is no behavior to redden. The evidence is a
pre-refactor passing baseline and an identical post-refactor result.

  • Full archiver suite before the change: JEST_MAX_WORKERS=1 yarn workspace @aztec-labs/archiver test
    — 23 suites, 678 tests, all passing, exit 0.
  • Same command after the change — 23 suites, 678 tests, all passing, exit 0. Unchanged count, as a
    behavior-preserving rung requires.
  • Before removing finalizedL1Block from RecoveryState, the whole repo was grepped for reads of it:
    there are none. The only survivors are the MessageSyncState.finalizedL1Block persisted marker, the
    local read in searchAnchor, and l1_synchronizer's own parameter.
  • Every return path of continueRecovery and rollbackTo was read to confirm neither can produce
    synced before the downgrade was deleted.
  • yarn build green; yarn format and yarn lint clean.

No e2e suites were run; e2e coverage is left to CI.

RecoveryState carried a finalized L1 block that nothing ever read, so it is
removed from the type, from startRecovery's signature and from its six call
sites. The finality marker itself is untouched: syncPass still takes
finalizedL1Block and still hands it to truncate and to every setMessageSyncState
call.

The synced-status downgrade after continuing a recovery is unreachable since
recovery became rollback-then-refetch: continueRecovery returns pending when the
anchor search runs out of budget and pending from rollbackTo either way, so it
can never return synced. Removed along with the pinned-head alias it needed.

Two consumed-message-count call sites now reuse blockLeafCount instead of
restating the leaf-count expression.
@spalladino
spalladino added this pull request to stack #188 September 12, 2026 04:52
@spalladino spalladino added the ci-draft Run CI on this draft PR label Sep 12, 2026
@spalladino
spalladino removed this pull request from stack #188 September 15, 2026 22:42
@spalladino
spalladino added this pull request to stack #217 September 15, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on this draft PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant