Skip to content

refactor(archiver): extract l1 synchronizer and factory#19553

Closed
spalladino wants to merge 1 commit intonextfrom
palla/archiver-l1-synchronizer
Closed

refactor(archiver): extract l1 synchronizer and factory#19553
spalladino wants to merge 1 commit intonextfrom
palla/archiver-l1-synchronizer

Conversation

@spalladino
Copy link
Contributor

Extracts L1 synchronization logic out of the archiver and into a separate class. Also extracts the createAndSync method into the archiver factory, and lifts some more methods to the ArchiveSourceBase.

Created Files

  • archiver/src/archiver/archiver_l1_synchronizer.ts (~800 lines): New class that extracts all L1 synchronization logic from the Archiver, including:
    • syncFromL1() - Main sync orchestration
    • handleCheckpoints() - Checkpoint retrieval and validation
    • handleL1ToL2Messages() - L1→L2 message fetching
    • handleEpochPrune() - Epoch pruning detection
    • Implements Traceable interface for distributed tracing

Modified Files

  • archiver/src/archiver/archiver.ts: Removed ~630 lines of L1 sync code; constructor now accepts synchronizer and events as injected dependencies
  • archiver/src/factory.ts: Consolidated Archiver.createAndSync() logic into createArchiver(); creates synchronizer/events and injects them
  • archiver/src/archiver/index.ts: Added export for ArchiverL1Synchronizer
  • aztec/src/cli/cmds/start_archiver.ts: Changed from Archiver.createAndSync() to createArchiver()
  • archiver/src/archiver/archiver.sync.test.ts and archiver.test.ts: Updated to create synchronizer and events before creating Archiver

Architectural Change

  • L1 sync logic is now separated from the Archiver into ArchiverL1Synchronizer
  • Factory is the single entry point for creating an archiver with all its dependencies
  • Dependency injection pattern for synchronizer and event emitter

This aligns with the plan goal of "clean separation of the archiver into syncing (L1 sync) vs datastore (storage + reads)".

Base automatically changed from palla/archiver-refactor to next January 13, 2026 17:24
@spalladino spalladino force-pushed the palla/archiver-l1-synchronizer branch from 5bde3cc to 8b8bbd1 Compare January 13, 2026 18:46
@AztecBot
Copy link
Collaborator

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/bcc703c003416985�bcc703c0034169858;;�): yarn-project/end-to-end/scripts/run_test.sh web3signer src/composed/web3signer/e2e_multi_validator_node_key_store.test.ts (36s) (code: 1) (\033Santiago Palladino\033: refactor(archiver): extract l1 synchronizer)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/b602a8d65286783b�b602a8d65286783b8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_invalidate_block.parallel.test.ts "proposer invalidates multiple blocks" (604s) (code: 124) group:e2e-p2p-epoch-flakes (\033Santiago Palladino\033: refactor(archiver): extract l1 synchronizer)

@spalladino
Copy link
Contributor Author

Closing in favor of #19564

@spalladino spalladino closed this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants