fix: sync old_top_node after PersistentBatchAVLProver::rollback() - #19
Closed
mwaddip wants to merge 1 commit into
Closed
fix: sync old_top_node after PersistentBatchAVLProver::rollback()#19mwaddip wants to merge 1 commit into
mwaddip wants to merge 1 commit into
Conversation
When rollback() restores a stored tree root, old_top_node was left pointing at the dummy-tree root from BatchAVLProver::new(). The first generate_proof() call after rollback would produce a wrong proof by walking the stale snapshot; subsequent calls self-corrected. Triggered in ergo-node-rust when at-tip memory tuning fires synced() → recreates the validator → PersistentBatchAVLProver::new() → rollback(). The first block validated after reopen fails with an AD proofs digest mismatch.
mwaddip
force-pushed
the
fix/sync-old-top-node-after-rollback
branch
from
July 28, 2026 14:16
8d0ff8c to
1c91817
Compare
Author
|
Superseded by #27, which does not carry this commit. There, PersistentBatchAVLProver::rollback delegates to BatchAVLProver::restore_root, which performs the old_top_node rebase this PR added along with the rest of the rewind state. Same behaviour, one rewind implementation rather than two that have to agree by hand. |
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.
When rollback() restores a stored tree root, old_top_node was left pointing at the dummy-tree root from BatchAVLProver::new(). The first generate_proof() call after rollback would produce a wrong proof by walking the stale snapshot; subsequent calls self-corrected.
Triggered in ergo-node-rust when at-tip memory tuning fires synced() → recreates the validator → PersistentBatchAVLProver::new() → rollback(). The first block validated after reopen fails with an AD proofs digest mismatch.