fix: store a sub-handle's final cert over a stale temp - #88
Merged
Conversation
A sub-handle's own commitment is Unknown (finality is proven through the parent space's handle tree, not its own on-chain commitment), so is_better_than has no commitment height to compare between a temp and its finalization. A finalize carries a fresher anchor but usually EMPTY owner records, so is_better_than falls through to the records comparison and rejects it before reaching the anchor tiebreaker — leaving the relay serving a stale temp that no longer verifies against the tip. Accept a strictly fresher proof from the same key that doesn't downgrade finality (anchor advances and sovereignty rank does not regress), even when is_better_than is false; the existing merge preserves the owner's records onto the fresh final. Incoming certs are already verified against current anchors, so a higher anchor is genuine fresher chain truth. Adds test_finalize_without_commitment_upgrade_replaces_temp covering the Unknown- commitment sub-handle case (the existing test only covered the Exists-commitment one).
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.
No description provided.