Skip to content

feat(archiver): decouple calldata from blob fetching in L1 synchronizer#22716

Merged
spalladino merged 6 commits into
merge-train/spartanfrom
spl/decouple-calldata-blobs
Apr 22, 2026
Merged

feat(archiver): decouple calldata from blob fetching in L1 synchronizer#22716
spalladino merged 6 commits into
merge-train/spartanfrom
spl/decouple-calldata-blobs

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Reopening #22472 which was accidentally merged

Motivation

When the node is a validator that already built a checkpoint locally (via addProposedBlock + setProposedCheckpoint), the blocks are already in the archiver store. Fetching blobs from the beacon chain is redundant and expensive, especially during sync. This decouples calldata and blob retrieval so we can skip blob fetching when the proposed checkpoint matches.

Approach

Split retrieveCheckpointsFromRollup into two phases: (1) fetch calldata only (header, attestations, archive root), (2) check the archiver store for a proposed checkpoint with matching header. If found, promote it to confirmed via a fast path. Otherwise, fetch blobs in parallel (same asyncPool(10, ...) concurrency as before) and store as normal.

Changes

  • archiver (l1/data_retrieval.ts): New CalldataOnlyCheckpoint type, retrieveCheckpointCalldataFromRollup (calldata-only fetch), and fetchBlobsAndBuildPublishedCheckpoint (deferred blob fetch). Existing functions left intact.
  • archiver (store/block_store.ts): New promoteProposedToCheckpointed method that reads existing blocks from store, writes a confirmed checkpoint entry with L1 metadata + attestations, and clears the proposed singleton.
  • archiver (store/kv_archiver_store.ts): Pass-through for promoteProposedToCheckpointed.
  • archiver (modules/data_store_updater.ts): New promoteProposedCheckpoint wrapper that handles validation status and tips cache refresh.
  • archiver (modules/l1_synchronizer.ts): handleCheckpoints now partitions calldata checkpoints into promote-vs-fetch-blobs, fetches blobs in parallel for non-matching ones, promotes the matched one, then merges results for validation.

Fixes A-877

@spalladino spalladino added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Apr 21, 2026
Base automatically changed from spl/fix-genesis-world-state-again to merge-train/spartan April 22, 2026 08:43
spalladino and others added 6 commits April 22, 2026 11:15
Splits checkpoint retrieval into two phases: first fetch calldata only
(header, attestations, archive root), then check if a proposed checkpoint
with matching header already exists in the store. If so, skip blob fetching
and promote the proposed checkpoint to confirmed. Otherwise, fetch blobs in
parallel as before.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move promote to after attestation validation to avoid persisting
  invalid checkpoints (split into build + persist steps)
- Add validateCheckpoint call in promote path
- Add archive root comparison to proposed checkpoint match condition
- Remove dead retrieveCheckpointsFromRollup and processCheckpointProposedLogs
- Pass pendingChainValidationStatus to promote path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@spalladino spalladino force-pushed the spl/decouple-calldata-blobs branch from 40bf06d to 42da07a Compare April 22, 2026 14:15
@spalladino spalladino enabled auto-merge (squash) April 22, 2026 14:15
@spalladino spalladino merged commit f25c4d4 into merge-train/spartan Apr 22, 2026
12 checks passed
@spalladino spalladino deleted the spl/decouple-calldata-blobs branch April 22, 2026 14:34
chrismarino pushed a commit to chrismarino/aztec-packages that referenced this pull request May 5, 2026
BEGIN_COMMIT_OVERRIDE
fix(kv-store): ensure LMDB cursor is closed on iteration abort (AztecProtocol#22509)
fix(telemetry-client): use appropriate histogram buckets for L1 gas
prices (AztecProtocol#22512)
fix(telemetry-client): log warning when BatchSpanProcessor drops spans
(AztecProtocol#22511)
fix(stdlib): wrap HA signer databaseUrl in SecretValue (AztecProtocol#22510)
fix(prover-client): don't mark in-progress epoch N jobs as stale when
epoch N+1 starts (AztecProtocol#22508)
chore: (A-730) graceful shutdown for services in node startup failure
path (AztecProtocol#22112)
fix(prover-client): reject stale job promises and count timeouts toward
retry limit (AztecProtocol#21842)
feat(archiver): validate historical L1 log availability at startup
(AztecProtocol#22644)
fix(archiver): do not query MessageSent events by blockhash (AztecProtocol#22641)
refactor(e2e): skip initial sequencer in p2p and epochs tests (AztecProtocol#22535)
fix: handle missing L1 finalized block on devnets (AztecProtocol#22663)
fix(world-state): treat historical block 0 queries as historical, not
latest (AztecProtocol#22679)
fix(sequencer): re-check parent checkpoint validity before pipelined L1
submission (AztecProtocol#22586)
fix(world-state): make block 0 a first-class historical block (AztecProtocol#22711)
chore: show all running versions (AztecProtocol#22376)
chore: fix prettier inside worktrees (AztecProtocol#22557)
feat: use optimized verifier for rollup (AztecProtocol#21840)
fix(kv-store): skip pool creation on ephemeral deleteDb to unstick
browser tests (AztecProtocol#22693)
chore: rm claude lockfile (AztecProtocol#22718)
fix(e2e): wait for first checkpoint in fee_asset_price_oracle_gossip
test (AztecProtocol#22719)
chore(prover-node): track estimated L1 fee when proof publishing is
disabled (AztecProtocol#22691)
fix(ci): rerun squashed PR check on base branch change (AztecProtocol#22713)
feat(archiver): decouple calldata from blob fetching in L1 synchronizer
(AztecProtocol#22716)
refactor(e2e): enable pipelining in e2e_epochs tests (AztecProtocol#22544)
feat(p2p): reject and evict txs with insufficient max fee per gas
(AztecProtocol#22118)
refactor(world-state): always index block 0 regardless of initial tree
size (AztecProtocol#22724)
fix(e2e): fix redistribution test (AztecProtocol#22729)
END_COMMIT_OVERRIDE
alexghr added a commit that referenced this pull request May 7, 2026
…22994)

## Motivation

The `aztec.archiver.block_height` series with no status attribute
(rendered as the "Pending chain" line on the network, prover, and
fisherman Grafana dashboards) stopped being published a couple of weeks
ago. With pipelining enabled every checkpoint arriving from L1 already
has its blocks in the proposed store, so the L1 synchronizer always took
the new promotion fast path introduced in #22716, leaving
`checkpointsToAdd` empty and skipping the metric call.

## Approach

Record the checkpointed block-height metrics across all valid
checkpoints in the batch instead of only the ones routed through
`addCheckpoints`, so the promoted checkpoint contributes too. The
duration is averaged over the full batch since `addCheckpoints` performs
the work for both paths in a single transaction.

## Changes

- **archiver (`l1_synchronizer.ts`)**: Move the
`processNewCheckpointedBlocks` call to use `validCheckpoints` rather
than `checkpointsToAdd`, restoring the empty-status `block_height`,
`checkpoint_height`, `sync_block_count`, and `sync_per_checkpoint`
series under pipelining.

---------

Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants