2022-03-31 09:35:11 -07:00
|
|
|
# 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]
|
|
|
|
|
2022-12-14 16:17:04 -08:00
|
|
|
### Added
|
|
|
|
|
|
|
|
- `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
|
2022-12-14 16:34:52 -08:00
|
|
|
`Tree` implementations and a number of generalized example tests. 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.
|
2022-12-14 16:17:04 -08:00
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
|
|
|
- `Altitude` has been renamed to `Level`
|
|
|
|
- `Position::is_complete` has been renamed to `Position::is_complete_subtree`.
|
|
|
|
- `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`
|
|
|
|
|
2022-12-19 16:03:16 -08:00
|
|
|
### Removed
|
|
|
|
|
|
|
|
- The `bridgetree` module has been moved out a to a separate `bridgetree` crate.
|
2022-12-14 16:17:04 -08:00
|
|
|
- `Position::witness_addrs`
|
|
|
|
- `Position::altitudes_required`
|
|
|
|
- `Position::all_altitudes_required`
|
|
|
|
- `Position::auth_path`
|
|
|
|
- `Position::max_altitude`
|
|
|
|
- `Position::ommer_altitudes`
|
|
|
|
- `impl Sub<u8> for Altitude`
|
2022-12-19 16:03:16 -08:00
|
|
|
|
2022-05-10 08:05:22 -07:00
|
|
|
## [0.3.0] - 2022-05-10
|
|
|
|
|
2022-04-18 15:01:53 -07:00
|
|
|
### Added
|
|
|
|
|
|
|
|
- `incrementalmerkletree::bridgetree`:
|
|
|
|
- `Checkpoint::witnessed` returns the set of positions that have been marked with
|
|
|
|
`BridgeTree::witness` while this checkpoint was the current checkpoint.
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- `Tree::authentication_path` has been changed to take an `as_of_root` parameter.
|
|
|
|
This allows computation of the authentication path as of previous tree states, in
|
|
|
|
addition to the previous behavior which only allowed computation of the path as of the
|
|
|
|
most recent tree state. The provided `as_of_root` value must be equal to either the
|
2022-04-22 08:57:23 -07:00
|
|
|
current root of the tree, or to the root of the tree at a previous checkpoint that
|
2022-12-14 16:17:04 -08:00
|
|
|
contained a note at the given position.
|
2022-04-18 15:01:53 -07:00
|
|
|
|
|
|
|
### Removed
|
|
|
|
|
|
|
|
- `incrementalmerkletree::bridgetree`:
|
|
|
|
- `Checkpoint::rewrite_indices` was an internal utility method that had inadvertently
|
|
|
|
been made a part of the public API.
|
|
|
|
|
|
|
|
## [0.3.0-beta.2] - 2022-04-06
|
|
|
|
|
2022-03-31 09:35:11 -07:00
|
|
|
### Added
|
2022-04-06 10:11:24 -07:00
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- `Tree::get_witnessed_leaf`, to allow a user to query for the leaf value of
|
|
|
|
witnessed leaves by their position in the tree.
|
|
|
|
- `Tree::witnessed_positions`, to allow a user to query for all positions that
|
|
|
|
have been witnessed.
|
2022-12-14 16:17:04 -08:00
|
|
|
- `Tree::garbage_collect`, to prune checkpoint and removed witness information
|
2022-04-06 10:11:24 -07:00
|
|
|
that is no longer reachable by rewinds of the tree.
|
|
|
|
- `incrementalmerkletree::bridgetree`:
|
|
|
|
- `NonEmptyFrontier::current_leaf`
|
|
|
|
- `BridgeTree::from_frontier`
|
|
|
|
- `BridgeTree::check_consistency`
|
2022-03-31 09:35:11 -07:00
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
2022-04-06 10:29:47 -07:00
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- The `Tree` trait has substantial changes in this release. Hashes are no longer used
|
|
|
|
in identifying nodes when generating authentication paths and removing witnesses;
|
|
|
|
instead, these operations now use position information exclusively.
|
|
|
|
- `Tree::authentication_path` and `Tree::remove_witness` have both been changed to only
|
|
|
|
take a `position` parameter, instead of both the leaf value and the position.
|
|
|
|
- `Tree::current_leaf` and `Tree::witness` have both been changed to only return the leaf
|
|
|
|
value, instead of both the leaf value and the position.
|
|
|
|
- `incrementalmerkletree::bridgetree`:
|
2022-12-14 16:17:04 -08:00
|
|
|
- The type of `BridgeTree::saved` and `Checkpoint::forgotten` have been changed from
|
2022-04-06 10:29:47 -07:00
|
|
|
`BTreeMap<(Position, H), usize>` to `BTreeMap<Position, usize>`. This change
|
|
|
|
is also reflected in the rturn type of the `BridgeTree::witnessed_indices` method.
|
|
|
|
- The `Checkpoint` type is no longer parameterized by `H`.
|
2022-12-14 16:17:04 -08:00
|
|
|
- `BridgeTree::bridges` has been split into two parts:
|
2022-04-06 10:29:47 -07:00
|
|
|
- `BridgeTree::prior_bridges` now tracks past bridges not including the current frontier.
|
|
|
|
- `BridgeTree::current_bridge` now tracks current mutable frontier.
|
|
|
|
- The signature of `BridgeTree::from_parts` has been modified to reflect these changes.
|
2022-03-31 09:35:11 -07:00
|
|
|
|
|
|
|
### Removed
|
2022-04-06 10:11:24 -07:00
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- `Tree::is_witnessed` (use `Tree::get_witnessed_leaf(...).is_some()` instead).
|
|
|
|
- The recording / playback infrastructure, which was unused and added
|
|
|
|
unnecessary complexity:
|
|
|
|
- The `Tree::Recording` associated type.
|
|
|
|
- `Tree::{recording, play}`
|
|
|
|
- `Recording`
|
|
|
|
- `Tree::is_witnessed` has been removed (use `Tree::get_witnessed_leaf(...).is_some()`
|
|
|
|
instead).
|
|
|
|
|
|
|
|
### Fixed
|
2022-03-31 09:35:11 -07:00
|
|
|
|
2022-12-14 16:17:04 -08:00
|
|
|
- A bug in `BridgeTree::garbage_collect` that caused garbage collection to in some
|
|
|
|
cases incorrectly rewrite checkpointed bridge lengths, resulting in a condition
|
2022-04-06 10:29:47 -07:00
|
|
|
where a rewind could panic after a GC operation.
|
2022-03-31 09:35:11 -07:00
|
|
|
|
|
|
|
## [0.3.0-beta.1] - 2022-03-22
|
|
|
|
|
|
|
|
### Added
|
2022-04-06 10:11:24 -07:00
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- New trait impls
|
|
|
|
- `impl From<Position> for usize`
|
|
|
|
- `impl Add<usize> for Position`
|
|
|
|
- `impl AddAssign<usize> for Position`
|
|
|
|
- `impl TryFrom<u64> for Position`
|
|
|
|
- `impl Hash for Position`
|
|
|
|
- New trait methods:
|
|
|
|
- `Tree::current_leaf`, which returns the position of the latest note
|
|
|
|
appended to the tree along with the leaf value, if any.
|
|
|
|
- `Tree::current_position`, which returns the position of the latest note
|
|
|
|
appended to the tree, if any.
|
|
|
|
- `Tree::is_witnessed`, which returns a boolean value indicating whether a
|
|
|
|
leaf value has been marked for later construction of an authentication
|
|
|
|
path at a specified position in the tree.
|
|
|
|
- `incrementalmerkletree::bridgetree`:
|
|
|
|
- `MerkleBridge::position`, which returns the position of the tip of the
|
|
|
|
frontier.
|
|
|
|
- `MerkleBridge::current_leaf`, which returns the leaf value most recently
|
|
|
|
appended to the frontier.
|
|
|
|
- `Leaf::value`, which returns the value of the leaf by reference.
|
|
|
|
- `impl {PartialEq, Eq} for {AuthFragment, MerkleBridge, BridgeTreeError}`
|
|
|
|
- Various constructor and accessor methods for `Checkpoint` to facilitate
|
|
|
|
serialization:
|
|
|
|
- `Checkpoint::{from_parts, at_length}`
|
|
|
|
- `Checkpoint::{bridges_len, is_witnessed, forgotten}`
|
|
|
|
- `Checkpoint::rewrite_indices`
|
|
|
|
- `BridgeTree::witnessed_indices`
|
|
|
|
- `BridgeTree::garbage_collect`, which prunes data for removed witnesses and
|
|
|
|
inaccessable checkpoints beyond the max rewind depth.
|
2022-03-31 09:35:11 -07:00
|
|
|
|
|
|
|
### Changed
|
2022-04-06 10:11:24 -07:00
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- `Position` now wraps a `usize` rather than a `u64`, affecting its layout (as
|
|
|
|
exposed by `repr(transparent)`).
|
|
|
|
- The following methods now take an additional `Position` argument to support
|
|
|
|
cases where leaf values may appear at multiple positions in the tree:
|
|
|
|
- `Tree::authentication_path`
|
|
|
|
- `Tree::remove_witness`
|
|
|
|
- `Tree::witness` now returns a tuple of the witnessed position and leaf hash,
|
|
|
|
or `None` if the tree is empty, instead of a boolean value.
|
|
|
|
- `incrementalmerkletree::bridgetree`:
|
|
|
|
- Most `MerkleBridge` methods now require `H: Ord`.
|
2022-12-14 16:17:04 -08:00
|
|
|
- Changed the return type of `MerkleBridge::auth_fragments` from
|
2022-04-06 10:11:24 -07:00
|
|
|
`HashMap<usize, AuthFragment>` to `BTreeMap<Position, AuthFragment>`; the
|
|
|
|
`saved` argument to `BridgeTree::from_parts` is similarly altered.
|
|
|
|
- `MerkleBridge::successor` now takes a boolean argument for tracking the most
|
|
|
|
recently appended leaf, instead of the previous `cur_idx` argument.
|
|
|
|
- `Checkpoint` is now a struct, rather than an enum type, and contains
|
|
|
|
information about witnessed nodes that have been marked for removal since the
|
|
|
|
last checkpoint.
|
|
|
|
- `BridgeTree` now requires an `Ord` constraint for its leaf type, rather than a
|
|
|
|
`Hash` constraint.
|
2022-03-31 09:35:11 -07:00
|
|
|
|
|
|
|
### Removed
|
2022-04-06 10:29:47 -07:00
|
|
|
- `incrementalmerkletree`:
|
|
|
|
- `Position::increment`
|
|
|
|
- `impl TryFrom<Position> for usize` (use the `From` impl instead).
|
2022-04-06 10:11:24 -07:00
|
|
|
- `incrementalmerkletree::bridgetree`:
|
|
|
|
- `Leaf::into_value` (use `Leaf::value` instead).
|
|
|
|
- `MerkleBridge::leaf_value` (use `MerkleBridge::current_leaf` instead).
|
|
|
|
- `H: Clone` bound on `NonEmptyFrontier::<H>::leaf_value`.
|
|
|
|
- `BridgeTree::witnessable_leaves` (use `BridgeTree::witnessed_indices` instead).
|
2022-03-31 09:35:11 -07:00
|
|
|
|
|
|
|
## [0.2.0] - 2022-03-22
|
2022-04-06 10:11:24 -07:00
|
|
|
|
2022-04-06 10:29:47 -07:00
|
|
|
v0.2.0 is essentially a complete rewrite relative to v0.1.0, and should be considered
|
2022-12-14 16:17:04 -08:00
|
|
|
the first usable release.
|
2022-04-06 10:11:24 -07:00
|
|
|
|
|
|
|
## [0.1.0] - 2021-06-23
|
2022-03-31 09:35:11 -07:00
|
|
|
Initial release!
|