Repository navigation
fix(tiles): sign a checkpoint only over a tree extending the published one - #3
Merged
Merged
Conversation
…hed one Writer::checkpoint promises never to sign a checkpoint inconsistent with one it signed, but publish refuses only when the published checkpoint under the origin is for a larger size. A store whose entries were replaced gets a second checkpoint at the published size with another root, or a larger one that does not extend it. The test publishes at 300 entries, puts that checkpoint beside other entries and expects both signatures refused with the checkpoint left alone, while the log grown from the published tree is signed.
…d one publish now checks the tree against the checkpoint published under the same origin before signing: the empty tree's root at size 0, the log's own root at the log's size, and otherwise a consistency proof read from the tiles through TileHashReader and checked with rfc9162::verify_consistency. A tree that is not an extension is Error::Corrupt naming both heads, and the published checkpoint stays. A larger published size is still OutOfRange. The doc says which trees replace a published checkpoint.
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.
Writer::checkpointnow signs only a tree that extends the checkpoint already published under its origin.publishrefused only when the published checkpoint under the origin was for a larger size. A store whose entries were replaced got a second checkpoint at the published size with another root, or a larger one that does not extend it.publishnow checks the tree against the checkpoint published under the same origin before signing: the empty tree's root at size 0, the log's own root at the log's size, and otherwise a consistency proof read from the tiles and checked withrfc9162::verify_consistency. A tree that is not an extension isError::Corruptnaming both heads, and the published checkpoint stays.The branch has a towncrier fragment.