Commit Graph

128 Commits

Author SHA1 Message Date
ebfull 070a7588ae
Merge pull request #39 from zcash/release-0.3.0
Release 0.3.0
2022-05-10 09:39:36 -06:00
Sean Bowe c7e3ae7283
Release 0.3.0 2022-05-10 09:05:22 -06:00
Kris Nuttycombe f23e3d8950
Merge pull request #38 from nuttycom/authpath_anchor_depth
Add as_of_root argument to Tree::authentication_path
2022-04-22 10:55:26 -06:00
Kris Nuttycombe 9d94e9d6e8
Apply suggestions from code review
Co-authored-by: ebfull <ewillbefull@gmail.com>
2022-04-22 09:57:23 -06:00
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 fef054d43a Move-only: group witness/remove_witness code together. 2022-04-15 10:00:03 -06:00
Kris Nuttycombe acbf32d077
Merge pull request #37 from zcash/release-0.3.0-beta.2
Release 0.3.0-beta.2
2022-04-06 11:47:04 -06:00
Jack Grigg 14386d14b1 incrementalmerkletree 0.3.0-beta.2 2022-04-06 17:45:17 +00:00
Kris Nuttycombe f55dafd596
Merge pull request #34 from nuttycom/add_changelog
Add changelog
2022-04-06 11:36:44 -06:00
Kris Nuttycombe 27723b395a Fix a few more changelog style consistency issues. 2022-04-06 11:35:06 -06:00
Kris Nuttycombe 7feaddd8e2 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-04-06 11:18:01 -06:00
ebfull 5d5439261f
Merge pull request #35 from nuttycom/rewind_retain_order
Fix an off-by-one error in BridgeTree garbage collection.
2022-04-05 16:31:22 -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 10e531d088 Restore forgotten witnesses before pruning to bridges length in rewind. 2022-04-05 16:15:41 -06:00
Kris Nuttycombe f9c12e37aa Add witnessed_positions and garbage_collect methods to the `Tree` trait.
* `witnessed_positions` returns the set of positions that have been
  witnessed in the tree.
* `garbage_collect` makes the garbage collection operation of
  `bridgetree::BridgeTree` publicly accessible. It is always safe to
  implement this method as a no-op.
2022-04-05 16:15:41 -06:00
Kris Nuttycombe 647ff944ad
Merge pull request #36 from nuttycom/bridgetree_from_frontier
Allow construction of incrementalmerkletree starting from a frontier.
2022-04-05 16:13:24 -06:00
Kris Nuttycombe ea258b1e8f Add CHANGELOG.md, documenting all changes since v0.2.0 2022-03-31 14:24:21 -06:00
Kris Nuttycombe f19cf9c381 Add `BridgeTree::from_frontier`
Add a constructor to allow a BridgeTree to be built starting at an
existing frontier.
2022-03-31 11:38:28 -06:00
Kris Nuttycombe 279331e4f3 Fix an error in `MerkleBridge::can_follow`
The subsequent bridge's prior position was incorrectly allowed to
be `None`.
2022-03-31 11:38:28 -06:00
Kris Nuttycombe 924db920e7
Merge pull request #32 from nuttycom/query_by_position
Always query the tree by position, not hash.
2022-03-31 11:38:06 -06:00
Kris Nuttycombe 027a98e53a Remove redundant documentation on trait impls. 2022-03-31 08:21:33 -06:00
Kris Nuttycombe 244fa7b73c Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-31 07:10:02 -06:00
Kris Nuttycombe a858de06d8 Always query the tree by position, not hash.
This modifies the `Tree::authentication_path` and `Tree::remove_witness`
methods to only operate in terms of the tree position, rather than both
the position and the hash that is expected to be the leaf at that
position.

Positions in the tree are always unique, and the tree already contains
the leaf information corresponding to each position, so the existing API
previously required the storage of redundant information. This change
streamlines the API without loss of power.

This also adds additional consistency checks to the property tests.
2022-03-30 22:16:31 -06:00
Kris Nuttycombe 413ed2e70a
Merge pull request #31 from nuttycom/bridgetree_separate_tip
Track the mutable tip of the bridgetree separate from the prior bridges.
2022-03-30 21:33:25 -06:00
Kris Nuttycombe d4d4950d31 Use existing current_leaf method rather than introducing "tip" 2022-03-30 18:09:50 -06:00
Kris Nuttycombe 12187dc0a4 Remove inaccurate test comment. 2022-03-30 17:57:18 -06:00
Kris Nuttycombe fc1d1ab9fc Avoid unnecessary clones in garbage collection. 2022-03-30 16:41:59 -06:00
Kris Nuttycombe da24923d7f Add a test that demonstrates the failure case. 2022-03-30 16:41:59 -06:00
Kris Nuttycombe 31449b350e Track the state since the last checkpoint/witness separately from prior bridges. 2022-03-30 16:41:59 -06:00
ebfull 2a2276f0eb
Merge pull request #30 from nuttycom/remove_recordings
Remove the unused recording types & logic
2022-03-30 15:31:22 -06:00
Kris Nuttycombe 34cc29dc4b Remove the unused recording types & logic 2022-03-30 15:20:11 -06:00
str4d fdbc2065b9
Merge pull request #27 from zcash/release-0.3.0-beta.1
incrementalmerkletree 0.3.0-beta.1
2022-03-22 18:56:29 +00:00
Jack Grigg 62059495de incrementalmerkletree 0.3.0-beta.1
Closes zcash/incrementalmerkletree#25.
2022-03-22 17:29:55 +00:00
Kris Nuttycombe 62c33e4480
Merge pull request #24 from zcash/fix_auth_frag_construction
Fix incorrect consistency check for auth_fragment construction.
2022-03-11 16:45:29 -07:00
Kris Nuttycombe f8703a2eab Fix incorrect consistency check for auth_fragment construction.
This was just entirely wrong; it will often be the case that we've
observed several altitudes but have an empty list of values within
a particular fragment.
2022-03-11 15:45:33 -07:00
Kris Nuttycombe 8ef73e0b29
Merge pull request #23 from zcash/fix_bridgetree_from_parts
Fix error in BridgeTree::from_parts consistency check.
2022-03-11 14:47:22 -07:00
Kris Nuttycombe 9b710286d5 Fix incorrect from_parts consistency check. 2022-03-10 18:39:51 -07:00
Kris Nuttycombe 250052489d Add a test demonstrating incorrect consistency check. 2022-03-10 18:39:36 -07:00
Kris Nuttycombe 5707d6ac09
Merge pull request #21 from zcash/always_rewind_unless_empty
Rewinds are no longer blocked by existing witnesses.
2022-03-02 11:51:49 -07: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
str4d dd57b430de
Merge pull request #20 from nuttycom/weaken_hashable_constraints
Do not force Hashable values to also be Ord and Clone
2022-02-24 18:56:47 +00:00
Kris Nuttycombe 23c0370b54 Add missing position accessor to AuthFragment 2022-02-24 09:11:46 -07:00
Kris Nuttycombe f112568d73 Do not force Hashable values to also be Ord and Clone
While these additional bounds are often used with hashable
types, they are not necessary for the construction of `Frontier`
values, and so should not be required everywhere.
2022-02-24 09:01:23 -07:00
Kris Nuttycombe 9b76231a08
Merge pull request #19 from nuttycom/bridgetree_serialization
Add public accessors and constructors for Checkpoint.
2022-02-24 08:25:28 -07:00
Kris Nuttycombe 36b26cf0bb Add public accessors and constructors for Checkpoint. 2022-02-24 08:17:21 -07:00
Kris Nuttycombe 6f722b39e7
Merge pull request #18 from nuttycom/rustfmt
Fix formatting & linting errors.
2022-02-23 22:51:38 -07:00
Kris Nuttycombe 42b9608e43 Fix linting errors. 2022-02-23 21:44:36 -07:00
Kris Nuttycombe 7dc9f91468 Fix naming of beta lints. 2022-02-23 21:44:36 -07:00
Kris Nuttycombe 61a06de241 Fix formatting. 2022-02-23 21:30:52 -07:00
Kris Nuttycombe 40bc2a06da Add CI configuration 2022-02-23 21:29:25 -07:00