Skip to content

fix: archive nodes bootstrap via block sync, not state sync#84

Merged
bdchatham merged 2 commits intomainfrom
fix/archive-block-sync
Apr 14, 2026
Merged

fix: archive nodes bootstrap via block sync, not state sync#84
bdchatham merged 2 commits intomainfrom
fix/archive-block-sync

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

Summary

  • Removes hardcoded state-sync SnapshotSource from the archive planner
  • Archive nodes now use the genesis/block-sync base progression, matching their intended role as full-history nodes
  • Adds test coverage for archive planner task progression, peer handling, and snapshot generation overrides

Context

The archive planner's snapshotSource() method hardcoded &SnapshotSource{StateSync: &StateSyncSource{}}, which meant archive nodes bootstrapped via state sync and only had pruned state from a recent height. This caused two problems:

  1. Archive nodes produced small (~500MB) Tendermint snapshots instead of full (~48GB) ones, because they only had pruned state
  2. snapshotGeneration was configured on syncer nodes instead of archive nodes, since archive snapshots were too small to be useful

With this fix, archive nodes block sync from peers (the "genesis" progression), retaining full history. Combined with moving snapshotGeneration to the archive SeiNodeDeployment, this restores the correct snapshot pipeline.

Test plan

  • TestArchivePlanner_BlockSyncProgression — no snapshot-restore or state-sync tasks
  • TestArchivePlanner_WithPeers — discover-peers included when peers configured
  • TestArchivePlanner_SnapshotGenerationOverrides — snapshot-interval and keep-recent set
  • TestArchivePlanner_NoSnapshotGenerationOverrides — nil when not configured
  • TestArchivePlanner_Mode — returns "archive"

🤖 Generated with Claude Code

bdchatham and others added 2 commits April 14, 2026 09:26
The archive planner hardcoded a state-sync SnapshotSource, causing
archive nodes to state-sync from a recent height instead of block
syncing from genesis. This meant archive nodes had pruned state and
produced small (~500MB) snapshots instead of full (~48GB) ones.

Removes the hardcoded state-sync source so archive nodes use the
genesis/block-sync base progression. Adds test coverage for the
archive planner's task progression, peer handling, and snapshot
generation overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update TestBuildPlan_Archive to expect genesis/block-sync progression
(no configure-state-sync). Preallocate slice in archive_test.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit f230b60 into main Apr 14, 2026
2 checks passed
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.

1 participant