Commit Graph

7 Commits

Author SHA1 Message Date
Kris Nuttycombe 06728b9499 Add an as_of_root argument to Tree::authentication_path
This requires a user of this API to specify a root of the tree
that identifies the state of the tree at which the user wishes
to construct an authentication path. This must be equal to either
the current root of the tree, or to the root of the tree at a
previous checkpoint.
2022-04-20 14:13:12 -06:00
Kris Nuttycombe a4aa2bf204 Fix an off-by-one error in BridgeTree garbage collection. 2022-04-05 16:16:41 -06:00
Kris Nuttycombe da24923d7f Add a test that demonstrates the failure case. 2022-03-30 16:41:59 -06:00
Kris Nuttycombe e01885f6e2 Rewinds are no longer blocked by existing witnesses.
In practice, when performing a rewind we don't want to have to
do the additional bookkeeping keeping the leaf position and
value around just to be able to remove the witnesses. After
this change, `rewind` will always succeed unless there are
no checkpoints.
2022-03-02 11:32:31 -07:00
Kris Nuttycombe 993dd64650 Fix bridgetree checkpoint/rewind logic to fully restore the tree state.
Removal of witnesses is now recorded on a per-checkpoint
level, so that rewinding the tree state now restores any
witnesses that were removed since the checkpoint.

A number of internal consistency checks previously enforced
by the property tests have been removed as they did not
correctly implement this semantic, and reimplementing these
consistency checks would be equivalent to reimplementing the
sample tree, so these checks are now performed simply by
comparison against the reference implentation.
2022-02-22 09:44:32 -07:00
Kris Nuttycombe ba4fe68eb2 Update bridgetree checkpoint/rewind tests to demonstrate the rewind error. 2022-02-20 10:21:58 -07:00
Kris Nuttycombe c1fcd83329 Implement efficient incremental merkle tree. 2021-06-17 19:32:50 -06:00