Skip to content

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

Merged
PhilWindle merged 1 commit into
merge-train/spartan-v5from
spl/a-1350-archiver-reincluded-checkpoint
Jul 5, 2026
Merged

fix(archiver): tolerate re-included already-stored checkpoints#24513
PhilWindle merged 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

@PhilWindle
PhilWindle merged commit 54a08fd into merge-train/spartan-v5 Jul 5, 2026
12 checks passed
@PhilWindle
PhilWindle deleted the spl/a-1350-archiver-reincluded-checkpoint branch July 5, 2026 18:01
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
Clean forward-port of AztecProtocol#24524 (merge-train
spartan-v5, merge commit f397aa5, parents aba2a2e..7e7d8d0) onto
cb/private-port-next-7. Cherry-pick -m 1 applied with zero conflicts;
resulting tree touches exactly the 152 files of the source merge diff.

Pure TS/docs/CI (117 e2e-consolidation test files + sequencer-client,
archiver, stdlib TS, p2p, ethereum, validator-client, foundation, docs,
.test_patterns.yml). No noir/circuit/pinned-artifact surfaces → no
standard-contracts regen. Bundles sub-PRs AztecProtocol#24504 AztecProtocol#24506 AztecProtocol#24507 AztecProtocol#24509
AztecProtocol#24513 AztecProtocol#24515 AztecProtocol#24474 AztecProtocol#24489 AztecProtocol#24490 AztecProtocol#24491 AztecProtocol#24492 AztecProtocol#24494 AztecProtocol#24495 AztecProtocol#24498
AztecProtocol#24500 AztecProtocol#24503 AztecProtocol#24475.

Tracker: AztecProtocol/aztec-packages-private#570
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.

3 participants