From ae75af55b31cfadcb7a94ea34b1b0e60c44b9893 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 19 Dec 2022 17:03:16 -0700 Subject: [PATCH 1/3] Release bridgetree v0.2.0. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 11ca152..ce8070c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bridgetree" -version = "0.1.0" +version = "0.2.0" authors = [ "Kris Nuttycombe ", "Sean Bowe ", From e78fb14a43197608d417f70db6d9a335c0c571bc Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 19 Dec 2022 17:03:16 -0700 Subject: [PATCH 2/3] Update changelogs for bridgetree v0.2.0. --- CHANGELOG-bridgetree.md | 95 +++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 4 ++ 2 files changed, 99 insertions(+) create mode 100644 CHANGELOG-bridgetree.md diff --git a/CHANGELOG-bridgetree.md b/CHANGELOG-bridgetree.md new file mode 100644 index 0000000..a6898f5 --- /dev/null +++ b/CHANGELOG-bridgetree.md @@ -0,0 +1,95 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to Rust's notion of +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [bridgetree-v0.2.0] - 2022-05-10 + +The `bridgetree` crate is a fork of `incrementalmerkletree`, with the contents +of the `bridgetree` module moved to the crate root. As such, a number of things +have been significantly refactored and/or reorganized. In the following +documentation, types and operations that have been removed are referred to by +their original paths; types that have been moved to the root module are +referred to by their new location. + +### Changed relative to `incrementalmerkletree-v0.3.0` + +- The `MerkleBridge` type has been substantially refactored to avoid storing duplicate + ommer values. + +- `Position::is_complete` has been renamed to `Position::is_complete_subtree`. +- The return type of `NonEmptyFrontier::leaf` has changed. +- The arguments to `NonEmptyFrontier::new` have changed. +- `NonEmptyFrontier::root` now takes an optional `root_level` argument. +- `NonEmptyFrontier::leaf` now always returns the leaf hash. +- `NonEmptyFrontier::ommers`' return values now include the sibling of the leaf, + if the frontier's leaf position is odd. That is, the leaf is now always a leaf, + instead of a potentially-half-full subtree. +- The arguments to `Frontier::from_parts` have changed. +- The `Ord` bound on the `H` type parameter to `MerkleBridge` has been removed. +- `Altitude` has been renamed to `Level` +- `witness` is now used as the name of the operation to construct the witness for a leaf. + We now use `mark` to refer to the process of marking a node for which we may later wish + to construct a witness. + - `Tree::witness` has been renamed to `Tree::mark` + - `Tree::witnessed_positions` has been renamed to `Tree::marked_positions` + - `Tree::get_witnessed_leaf` has been renamed to `Tree::get_marked_leaf` + - `Tree::remove_witness` has been renamed to `Tree::remove_mark` + - `Tree::authentication_path` has been renamed to `Tree::witness` + - `BridgeTree::witnessed` has been renamed to `BridgeTree::marked` + - `BridgeTree::witnessed_indices` has been renamed to `BridgeTree::marked_indices` + +The following types have been moved from the `bridgetree` module of +`incrementalmerkletree` to the crate root: + +- `NonEmptyFrontier` +- `Frontier` +- `MerkleBridge` +- `BridgeTree` + +### Added relative to `incrementalmerkletree-v0.3.0` + +- `NonEmptyFrontier::value_at` +- `NonEmptyFrontier::authentication_path` +- `ContinuityError` and `WitnessingError` error types for reporting errors in + constructing witnesses. +- `MerkleBridge::position_range` +- `MerkleBridge::tracking` +- `MerkleBridge::ommers` +- `MerkleBridge::current_leaf` +- `Position::is_odd` +- `Position::ommer_index` +- `Position::root_level` +- `Position::past_ommer_count` +- `Address` A type used to uniquely identify node locations within a binary tree. + +A `test-dependencies` feature has been added. This makes available a `testing` +module to users of this crate, which contains `proptest` generators for types +from this crate as well as a number of tools for comparison testing between +`Tree` implementations. The `Frontier` and `Tree` traits have been moved to +the `testing` module, as there is not another good use case for polymorphism +over tree implementations; the API of `Tree` is excessively specialized to the +`BridgeTree` use patterns case. + +### Removed relative to `incrementalmerkletree-0.3.0` + +- `bridgetree::Leaf` +- `bridgetree::AuthFragment` +- `NonEmptyFrontier::size` +- `NonEmptyFrontier::max_altitude` +- `NonEmptyFrontier::current_leaf` +- `NonEmptyFrontier::witness` +- `MerkleBridge::root` +- `MerkleBridge::root_at_altitude` +- `MerkleBridge::auth_fragments` +- `BridgeTree::check_consistency` +- `Position::altitudes_required` +- `Position::all_altitudes_required` +- `Position::auth_path` +- `Position::max_altitude` +- `Position::ommer_altitudes` +- `impl Sub for Altitude` diff --git a/CHANGELOG.md b/CHANGELOG.md index 0801c80..5b8a0d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to Rust's notion of ## [Unreleased] +### Removed + +- The `bridgetree` module has been moved out a to a separate `bridgetree` crate. + ## [0.3.0] - 2022-05-10 ### Added From 61a34e5ec5c994d8cb07889860edfc2380d4d327 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Tue, 20 Dec 2022 17:05:01 -0700 Subject: [PATCH 3/3] Clarify the witnees->mark renaming in the `Tree` interface. --- CHANGELOG-bridgetree.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG-bridgetree.md b/CHANGELOG-bridgetree.md index a6898f5..e30cf7f 100644 --- a/CHANGELOG-bridgetree.md +++ b/CHANGELOG-bridgetree.md @@ -35,11 +35,11 @@ referred to by their new location. - `witness` is now used as the name of the operation to construct the witness for a leaf. We now use `mark` to refer to the process of marking a node for which we may later wish to construct a witness. - - `Tree::witness` has been renamed to `Tree::mark` - - `Tree::witnessed_positions` has been renamed to `Tree::marked_positions` - - `Tree::get_witnessed_leaf` has been renamed to `Tree::get_marked_leaf` - - `Tree::remove_witness` has been renamed to `Tree::remove_mark` - - `Tree::authentication_path` has been renamed to `Tree::witness` + - `BridgeTree::witness` has been renamed to `BridgeTree::mark` + - `BridgeTree::witnessed_positions` has been renamed to `BridgeTree::marked_positions` + - `BridgeTree::get_witnessed_leaf` has been renamed to `BridgeTree::get_marked_leaf` + - `BridgeTree::remove_witness` has been renamed to `BridgeTree::remove_mark` + - `BridgeTree::authentication_path` has been renamed to `BridgeTree::witness` - `BridgeTree::witnessed` has been renamed to `BridgeTree::marked` - `BridgeTree::witnessed_indices` has been renamed to `BridgeTree::marked_indices` @@ -75,6 +75,13 @@ the `testing` module, as there is not another good use case for polymorphism over tree implementations; the API of `Tree` is excessively specialized to the `BridgeTree` use patterns case. +The `Tree` interface reflects the renaming of `witness` to `mark` described above: + - `Tree::witness` has been renamed to `Tree::mark` + - `Tree::witnessed_positions` has been renamed to `Tree::marked_positions` + - `Tree::get_witnessed_leaf` has been renamed to `Tree::get_marked_leaf` + - `Tree::remove_witness` has been renamed to `Tree::remove_mark` + - `Tree::authentication_path` has been renamed to `Tree::witness` + ### Removed relative to `incrementalmerkletree-0.3.0` - `bridgetree::Leaf`