Skip to content

Fix cached reorg misses and restore exact replay state - #34

Merged
droplister merged 1 commit into
mainfrom
fix/reorg-recovery-20261004
Oct 4, 2026
Merged

droplister merged 1 commit into
mainfrom
fix/reorg-recovery-20261004

Conversation

@droplister

Copy link
Copy Markdown
Member

A cached block lookup could hide a fork while event replay advanced onto a different branch. Replay now uses fresh Counterparty URLs for all attempts/pages, checks hashes during catch-up, fails closed on missing hashes, validates each NEW_BLOCK's parent linkage, and rechecks the applied parent after fetching events.

Migration 0100 adds transactional, bounded before-images for mutable protocol rows. Rollback restores partial order quantities and dispenser status exactly, alongside the existing balance-delta reversal. Undo and journal consumption commit together so interrupted recovery resumes safely.

Validation: all API tests passed (455 passed, 34 pre-existing skips), migration rehearsals, full typecheck, lint, formatting and structure checks. Added regressions for a retained URL cache, stale parent probe, catch-up window, unavailable hashes, exact mutable state and interrupted rollback.

Apply migration 0100 before deployment. Undo history begins at the deployment checkpoint and retains 24 blocks; older forks require a verified rebuild. Administrative imports require a paused writer and refreshed baseline. The configured Counterparty node remains the source of canonical headers; historical imports and all asynchronous projections are not independently certified by this change. See docs/reorg-recovery.md.

@droplister
droplister merged commit 4c871a7 into main Oct 4, 2026
3 of 4 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