Commit Graph

18 Commits

Author SHA1 Message Date
Kris Nuttycombe 739441a892
Merge pull request #63 from nuttycom/bridgetree_checkpoint_id
Make `bridgetree` polymorphic in checkpoint identifier type.
2023-03-24 09:00:25 -06:00
Kris Nuttycombe f7931ec31f Apply suggestions from code review. 2023-03-24 08:38:11 -06:00
Kris Nuttycombe 0d1c3e6512
Merge pull request #59 from nuttycom/fix_premature_tracking
Do not eagerly track marked nodes in the current bridge.
2023-03-24 08:29:38 -06:00
Kris Nuttycombe 650edd0fc7 Make `bridgetree` polymorphic in checkpoint identifier type. 2023-03-23 16:02:40 -06:00
Kris Nuttycombe 22c2c019cc Do not eagerly track marked nodes in the current bridge.
This fixes a minor compatibility issue with respect to possible
deserialization of the `incrementalmerkletree-0.3.0` `MerkleBridge`
type. It is not necessary to track a marked leaf in the current
bridge *unless* the marked position is the bridge's starting position
and the prior bridge ended at a checkpoint.
2023-03-21 11:59:36 -06:00
Kris Nuttycombe 0697df7d95 Fix documentation errors. 2023-03-03 17:02:03 -07:00
Kris Nuttycombe 6867240e5a Remove the `current_leaf` method from `Tree`
The notion of `current` doesn't make a lot of sense in the context of
out-of-order insertion.
2023-02-16 15:01:53 -07:00
Kris Nuttycombe 14bb9c6b1b Modify test infrastructure to allow shardtree testing.
This removes the `mark` function from the `tree` interface, in favor
of always appending nodes as marked, as that's what's needed in
practice, rather than the ability to mutably mark the latest position at
arbitrary states of the tree.

This removal does mean that a few patterns of interleaved mark and
checkpoint operations are no longer being tested in the shared test
suite; however, such interleaving of operations is not something that
we should need to support anyway.
2023-02-16 15:01:53 -07:00
Kris Nuttycombe aa1d59f47a `witness` now witnesses at a checkpoint, rather than a root.
This change exposed an inconsistency in how `BridgeTree` and
`CompleteTree` were tracking `Mark` operations, which has now also been
fixed.

The behavior of the "unmark" operation has been simplified, such that it
now ensures that a marked node will be made eligible for garbage
collection when the checkpoint for the tree state in which the mark was
forgotten rolls off the back of the checkpoint queue.
2023-02-16 15:01:53 -07:00
Kris Nuttycombe 2e9043ef82 Add `Address` methods to facilitate tree traversal. 2023-02-16 14:32:54 -07:00
Kris Nuttycombe 8998f839ce Change `append` to take ownership of the value being appended.
It is now up to the caller to clone the value if necessary.
2023-01-04 14:08:11 -07:00
Kris Nuttycombe 50779d2bd5 Consolidate bridgetree tests. 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 3f88ac3af2 Move complete_tree testing module to incrementalmerkletree 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 6b4bcda423 Move shared example tests to incrementalmerkletree::testing 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 6b6d108de6 Move randomized test generators to incrementalmerkletree 2022-12-21 12:53:17 -07:00
Kris Nuttycombe eb3413837e Move `Tree` and `Frontier` traits to `incementalmerkletree::testing` 2022-12-21 12:53:17 -07:00
Kris Nuttycombe c5c6c65799 Move position & hashable types to incrementalmerkletree root. 2022-12-21 12:52:57 -07:00
Kris Nuttycombe b2a68215a0 Move the `bridgetree` crate to a workspace. 2022-12-21 11:59:43 -07:00