-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from zcash/pre-release-cleanups
Pre-release cleanups
- Loading branch information
Showing
10 changed files
with
140 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 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.1.0/), | ||
and this project adheres to Rust's notion of | ||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased | ||
Initial release! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,28 @@ version = "0.0.0" | |
authors = [ | ||
"Kris Nuttycombe <[email protected]>", | ||
] | ||
edition = "2018" | ||
edition = "2021" | ||
rust-version = "1.60" | ||
license = "MIT OR Apache-2.0" | ||
description = "A space-efficient Merkle tree with witnessing of marked leaves, checkpointing & state restoration." | ||
homepage = "https://github.com/zcash/incrementalmerkletree" | ||
repository = "https://github.com/zcash/incrementalmerkletree" | ||
categories = ["algorithms", "data-structures"] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
|
||
[dependencies] | ||
assert_matches = { version = "1.5", optional = true } | ||
bitflags = "1.3" | ||
bitflags = "2" | ||
either = "1.8" | ||
incrementalmerkletree = { version = "0.4", path = "../incrementalmerkletree" } | ||
proptest = { version = "1.0.0", optional = true } | ||
tracing = "0.1" | ||
|
||
[dev-dependencies] | ||
assert_matches = "1.5" | ||
criterion = "0.3" | ||
incrementalmerkletree = { version = "0.4", path = "../incrementalmerkletree", features = ["test-dependencies"] } | ||
proptest = "1.0.0" | ||
|
||
|
@@ -35,7 +39,4 @@ legacy-api = ["incrementalmerkletree/legacy-api"] | |
test-dependencies = ["proptest", "assert_matches"] | ||
|
||
[target.'cfg(unix)'.dev-dependencies] | ||
pprof = { version = "0.9", features = ["criterion", "flamegraph"] } # MSRV 1.56 | ||
dashmap = ">=5, <5.5.0" # 5.5 has MSRV > 1.60 | ||
inferno = ">=0.11, <0.11.5" # MSRV 1.59 | ||
tempfile = ">=3, <3.7.0" # 3.7 has MSRV 1.63 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# `shardtree` | ||
|
||
This is a Rust crate that provides an implementation of a fixed-depth Merkle | ||
tree structure that is densely filled from the left. It supports: | ||
|
||
- *Out-of-order insertion*: leaves and nodes may be inserted into the tree in | ||
arbitrary order. The structure will keep track of the right-most filled | ||
position as the frontier of the tree; any unfilled leaves to the left of this | ||
position are considered "missing", while any unfilled leaves to the right of | ||
this position are considered "empty". | ||
- *Witnessing*: Individual leaves of the Merkle tree may be marked such that | ||
witnesses will be maintained for the marked leaves as additional nodes are | ||
inserted into the tree, but leaf and node data not specifically required to | ||
maintain these witnesses is not retained, for space efficiency. | ||
- *Checkpointing*: the tree may be reset to a previously checkpointed state, up | ||
to a fixed number of checkpoints. | ||
|
||
The tree is represented as an ordered collection of fixed-depth subtrees, or | ||
"shards". The roots of the shards form the leaves in the "cap". | ||
|
||
``` | ||
Level | ||
3 root \ | ||
/ \ | | ||
/ \ | | ||
2 / \ } cap | ||
/ \ / \ | | ||
/ \ / \ | | ||
1 A B C D / \ | ||
/ \ / \ / \ / \ } shards | ||
0 /\ /\ /\ /\ /\ /\ /\ /\ / | ||
``` | ||
|
||
This structure enables witnesses for marked leaves to be advanced up to recent | ||
checkpoints or the latest state of the tree, without having to insert each | ||
intermediate leaf individually. Instead, only the roots of all complete shards | ||
between the one containing the marked leaf and the tree frontier need to be | ||
inserted, along with the necessary nodes to build a path from the marked leaf to | ||
the root of the shard containing it. | ||
|
||
## [`Documentation`](https://docs.rs/shardtree) | ||
|
||
## License | ||
|
||
Licensed under either of | ||
|
||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or | ||
http://www.apache.org/licenses/LICENSE-2.0) | ||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) | ||
|
||
at your option. | ||
|
||
### Contribution | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted | ||
for inclusion in the work by you, as defined in the Apache-2.0 license, shall | ||
be dual licensed as above, without any additional terms or conditions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters