Skip to content

fix(archiver): tolerate re-included already-stored checkpoints#24513

Open
spalladino wants to merge 1 commit into
merge-train/spartan-v5from
spl/a-1350-archiver-reincluded-checkpoint
Open

fix(archiver): tolerate re-included already-stored checkpoints#24513
spalladino wants to merge 1 commit into
merge-train/spartan-v5from
spl/a-1350-archiver-reincluded-checkpoint

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Context

Reconciling checkpoints from L1 could permanently wedge the archiver. BlockStore.addCheckpoints accepts an already-stored checkpoint that an L1 reorg re-included in a different L1 block (same archive root, new L1 metadata), but it filtered the already-stored prefix only locally: ArchiverDataStoreUpdater.addCheckpoints still re-ran log and contract-data extraction for every block in the original batch. Re-presented blocks carrying a ContractClassPublished or ContractInstancePublished event then threw already exists, aborting the whole write transaction — the L1 sync point never advanced, so every retry re-fetched the same range and failed deterministically until manual DB cleanup.

Approach

  • BlockStore.addCheckpoints now returns the checkpoints it actually inserted (excluding the already-stored prefix handled by skipOrUpdateAlreadyStoredCheckpoints) instead of a boolean, and the data store updater derives the blocks for log/contract-data extraction from that suffix.
  • As defense in depth, duplicate contract class/instance inserts are now a no-op when the stored insertion block number matches the incoming one; a duplicate at a different block number still throws, since that signals genuine double-processing.
  • Regression tests cover re-including an already-stored checkpoint alone and batched with a new one, plus store-level tests for the same-block/different-block duplicate behavior.

Reported in AztecProtocol/aztec-claude#1288.

Fixes A-1350

@AztecBot

AztecBot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Flakey Tests

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

\033FLAKED\033 (8;;http://ci.aztec-labs.com/39e8d89bef20799e�39e8d89bef20799e8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/multi-node/slashing/duplicate_attestation.test.ts (73s) (code: 0) group:e2e-p2p-epoch-flakes

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