Commit Graph

36 Commits

Author SHA1 Message Date
Kris Nuttycombe 4c79a7d065 Release incrementalmerkletree-v0.4.0 and bridgetree-v0.3.0 2023-06-05 19:39:49 -06:00
Kris Nuttycombe 66cf091b97 Merge branch 'release-bridgetree-v0.2.1' into HEAD 2023-06-05 19:39:43 -06:00
Kris Nuttycombe a1dec495de Release of `bridgetree` v0.2.1
The `bridgetree-v0.2.0` tag was created with respect to an invalid
repository state, which did not actually contain the `bridgetree`
sources after they were factored out from the `incrementalmerkletree`
crate.
2023-06-05 17:14:09 -06:00
Kris Nuttycombe 87007ec69b Remove the `Debug` bound from `Hashable`
The `Debug` bound here is handy but not required for the operations
on the trait.
2023-06-05 16:52:54 -06:00
Kris Nuttycombe 4efe39eaa6 Remove initial checkpoints.
The choice to use an initial checkpoint as an anchor for removals in
`unmark` operations produced an awkward situation where it was necessary
to choose a checkpoint identifier just to construct an empty tree. This
removes that decision in favor of eagerly removing data if there is no
checkpoint to tie the removal to.
2023-05-22 12:11:34 -06:00
Kris Nuttycombe f292a271ac Return owned types from `ShardStore` getter methods.
The primary implementations of `ShardStore` will be constructing
owned values from an underlying persistence layer, and it is not
possible to return a reference to an owned value.
2023-05-19 15:43:06 -06:00
Kris Nuttycombe 34d9aa25bc Use `u64` for the internal state of `Position` and `Address::index` 2023-05-10 16:46:23 -06:00
Kris Nuttycombe ebbd2e3d2d Apply suggestions from code review.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2023-03-31 19:43:25 -06:00
Kris Nuttycombe 9c0c9aa245 Merge remote-tracking branch 'upstream/master' into add_librustzcash_types 2023-03-31 16:02:59 -06:00
Kris Nuttycombe 02341ece26 Ensure that `BridgeTree` state is checkpointed when constructing from a frontier. 2023-03-27 09:54:21 -06:00
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 978da59c67 Merge branch 'bridgetree_checkpoint_id' into add_librustzcash_types 2023-03-23 16:18:32 -06:00
Kris Nuttycombe 650edd0fc7 Make `bridgetree` polymorphic in checkpoint identifier type. 2023-03-23 16:02:40 -06:00
Kris Nuttycombe 4e3c6a6378 Move frontier types from `bridgetree` to `incrementalmerkletree`
These types are reusable outside of the context of the `bridgetree`
crate.
2023-03-21 12:15:22 -06:00
Kris Nuttycombe ff8095b7ed Remove `serde` serialization & deserialization
The structure of the `incrementalmerkletree` and `bridgetree` types has
not historically been stable, and as such it is not appropriate to
automatically derive serialization for these types.
2023-03-21 12:15:22 -06:00
Kris Nuttycombe 3077e94301 Merge branch 'fix_premature_tracking' 2023-03-21 12:14:54 -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 dff6be7221 Update MSRV to 1.60
The transitive dependency we have on `unarray` is forcing this update.
Also, update CI actions to eliminate dependencies on the unmaintained
`actions-rs` Rust CI tools.
2023-02-16 10:51:41 -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 4e2883c707 Move CombinedTree to incrementalmerkletree::testing 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 a8c5ce1c98 Move `check_operations` to `incrementalmerkletree::testing` 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 02a33c5c32 Refactor check_operations to generalize usage. 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