Repository navigation
Fix cached reorg misses and restore exact replay state - #34
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.