From 4c79a7d0658a0daf1843d014bda64708e6fb496e Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 5 Jun 2023 17:05:59 -0600 Subject: [PATCH] Release incrementalmerkletree-v0.4.0 and bridgetree-v0.3.0 --- bridgetree/CHANGELOG.md | 15 +++++++++++ bridgetree/Cargo.toml | 6 ++--- incrementalmerkletree/CHANGELOG.md | 40 +++++++++++++++++++++++------- incrementalmerkletree/Cargo.toml | 2 +- shardtree/Cargo.toml | 4 +-- 5 files changed, 52 insertions(+), 15 deletions(-) diff --git a/bridgetree/CHANGELOG.md b/bridgetree/CHANGELOG.md index f7f4408..f139247 100644 --- a/bridgetree/CHANGELOG.md +++ b/bridgetree/CHANGELOG.md @@ -11,11 +11,26 @@ and this project adheres to Rust's notion of - `BridgeTree::witness` now takes a checkpoint depth rather than a root hash to identify the tree state with respect to which the witness should be constructed. +- `bridgetree::Checkpoint` has been substantially modified to reflect the addition + of checkpoint identifiers and a new approach to tracking when marked nodes are + removed. +- `BridgeTree` is now parameterized by a checkpoint identifier type in addition to + the leaf value type and tree depth. +- `BridgeTree::checkpoint` now takes a checkpoint identifier argument. +- `BridgeTree::checkpoints` now returns a `VecDeque>` rather than + a slice. +- `BridgeTree::append` now takes its argument as an owned value, rather than by + reference. +- `BridgeTree::witness` now takes a checkpoint depth rather than a root to match + for identifying the state of the tree for which the witness is to be computed. ### Removed - The `NonEmptyFrontier`, `Frontier`, and `FrontierError` types have been moved to the `incrementalmerkletree` crate. +- `bridgetree::FrontierError` +- `bridgetree::hashing::Hashable` has been moved to the `incrementalmerkletree` + crate and `bridgetree::hashing` has been removed. - The `testing` module has been removed in favor of depending on `incrementalmerkletree::testing`. - `serde` serialization and parsing are no longer supported. diff --git a/bridgetree/Cargo.toml b/bridgetree/Cargo.toml index 6743ce7..febf990 100644 --- a/bridgetree/Cargo.toml +++ b/bridgetree/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bridgetree" -version = "0.2.1" +version = "0.3.0" authors = [ "Kris Nuttycombe ", "Sean Bowe ", @@ -14,11 +14,11 @@ categories = ["algorithms", "data-structures"] rust-version = "1.60" [dependencies] -incrementalmerkletree = { version = "0.3", path = "../incrementalmerkletree" } +incrementalmerkletree = { version = "0.4", path = "../incrementalmerkletree" } proptest = { version = "1.0.0", optional = true } [dev-dependencies] -incrementalmerkletree = { version = "0.3", path = "../incrementalmerkletree", features = ["test-dependencies"] } +incrementalmerkletree = { version = "0.4", path = "../incrementalmerkletree", features = ["test-dependencies"] } proptest = "1.0.0" [features] diff --git a/incrementalmerkletree/CHANGELOG.md b/incrementalmerkletree/CHANGELOG.md index d44c85f..5715087 100644 --- a/incrementalmerkletree/CHANGELOG.md +++ b/incrementalmerkletree/CHANGELOG.md @@ -5,34 +5,56 @@ 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] +## [0.4.0] - 2023-06-05 + +Release 0.4.0 represents a substantial rewrite of the `incrementalmerkletree` +crate. The contents of the `bridgetree` module has been moved out to a new +`bridgetree` crate, and most of the types in this crate have undergone +substantial changes. The following changelog is not necessarily comprehensive, +but identifies many of the most notable changes. ### Added - `incrementalmerkletree::frontier` Types that model the state at the rightmost node of a Merkle tree that is filled sequentially from the left. These have - been migrated here from the `bridgetree` crate as they are useful outside - of the context of the `bridgetree` data structures. Additional legacy types - used for this modeling have been moved here from the `librustzcash` crate; - these migrated types are available under a `legacy-api` feature flag. -- `incrementalmerkletree::witness` Types migrated from `librustzcash` under + been migrated here from the (removed) `bridgetree` module as they are useful + outside of the context of the `bridgetree` data structures. Additional legacy + types used for this modeling have also been moved here from the + `zcash_primitives` crate; these migrated types are available under a + `legacy-api` feature flag. +- `incrementalmerkletree::witness` Types migrated from `zcash_primitives` under the `legacy-api` feature flag related to constructing witnesses for leaves of a Merkle tree. +- `incrementalmerkletree::Address` +- `incrementalmerkletree::Level` replaces `incrementalmerkletree::Altitude` +- `incrementalmerkletree::Retention` +- `incrementalmerkletree::Source` +- A new `test-dependencies` feature flag, which makes available utilities + and types for testing incremental merkle tree implementations. ### Changed - `Position` has been made isomorphic to `u64` via introduction of `From` implementations between these types. -- `Address::index` now returns `u64` instead of `usize` - The `expected_ommers` field of `FrontierError::PositionMismatch` now has type `u8` instead of `usize`. -- `Address::context` now also uses `u64` instead of `usize` for when it returns +- `Address::context` now also uses `u64` instead of `usize` for when it returns a range of index values. ### Removed -- The `From` impl for `Position` has been removed, as has +- The `bridgetree` module has been removed, and its contents are now available + from the `bridgetree` crate. +- The `sample` module has been removed. Replacement functionality has been + made available under a new `test-dependencies` feature flag in the + `incrementalmerkletree::testing::complete_tree` module. +- The `Frontier` and `Tree` traits have been removed as they did not represent + sufficiently flexible abstractions. Heavily modified versions of these traits + are still availalbe under the `test-dependencies` feature flag in the + `incrementalmerkletree::testing` module. +- The `From` impl for `Position` has been removed, as has `From for usize`. In addition, `Add` and `Sub` impls that previously allowed numeric operations between `usize` and `Position` values have been removed in favor of similar operations that instead allow computing with `u64`. +- The `incrementalmerkletree::Altitude` type has been removed ## [0.3.1] - 2023-02-28 diff --git a/incrementalmerkletree/Cargo.toml b/incrementalmerkletree/Cargo.toml index 45a7c39..48080a9 100644 --- a/incrementalmerkletree/Cargo.toml +++ b/incrementalmerkletree/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "incrementalmerkletree" description = "Common types, interfaces, and utilities for Merkle tree data structures" -version = "0.3.1" +version = "0.4.0" authors = [ "Sean Bowe ", "Kris Nuttycombe ", diff --git a/shardtree/Cargo.toml b/shardtree/Cargo.toml index d0c4bba..6a224b1 100644 --- a/shardtree/Cargo.toml +++ b/shardtree/Cargo.toml @@ -14,13 +14,13 @@ categories = ["algorithms", "data-structures"] [dependencies] bitflags = "1.3" either = "1.8" -incrementalmerkletree = { version = "0.3", path = "../incrementalmerkletree" } +incrementalmerkletree = { version = "0.4", path = "../incrementalmerkletree" } proptest = { version = "1.0.0", optional = true } [dev-dependencies] assert_matches = "1.5" criterion = "0.3" -incrementalmerkletree = { version = "0.3", path = "../incrementalmerkletree", features = ["test-dependencies"] } +incrementalmerkletree = { version = "0.4", path = "../incrementalmerkletree", features = ["test-dependencies"] } proptest = "1.0.0" [features]