-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Milestone
Description
Summary
Implement the current-state migration subcommand that builds protocol current state from deployment ledger forward, converging with live ingestion via the shared current-state CAS cursor.
Scope
- CLI:
./wallet-backend protocol-migrate current-state --protocol-id SEP50 --start-ledger 50000000 - Phase 1 — Validate: Verify protocol exists,
classification_status = 'success'. Setcurrent_state_migration_status = 'in_progress'. Initializeprotocol_{ID}_current_state_cursor = start_ledger - 1. - Phase 2 — Process batches to tip (loop): Same structure as history migration, but: CAS-advances
current_state_cursorinstead. Writes only current state (no state changes). Batches must be committed in order (current state is additive — state at ledger N depends on N-1). - Phase 3 — Complete: Set
current_state_migration_status = 'success'. Clean up. - Error handling: same pattern as history — set status to
'failed', resume from cursor + 1 on retry. - Processes ALL ledgers from
--start-ledgerto tip (not just retention window).
Dependencies
- State Production: CompareAndSwap Method on IngestStoreModel #512 (CompareAndSwap Method on IngestStoreModel)
- State Production: Protocol State Processor Interface #513 (Protocol State Processor Interface)
Reference
docs/feature-design/data-migrations.md (State Production section, line 619+)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels