Skip to content

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

Draft
spalladino wants to merge 2 commits intomerge-train/spartanfrom
spl/decouple-calldata-blobs
Draft

feat(archiver): decouple calldata from blob fetching in L1 synchronizer#22472
spalladino wants to merge 2 commits intomerge-train/spartanfrom
spl/decouple-calldata-blobs

Conversation

@spalladino
Copy link
Copy Markdown
Contributor

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

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>
@spalladino spalladino added ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-draft Run CI on draft PRs. labels Apr 10, 2026
- 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
Copy link
Copy Markdown
Contributor Author

Got to consider race condition where a proposer pushes their proposed checkpoint to its archiver before the previous checkpoint is checkpointed on L1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. 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.

1 participant