- Update dependencies
- A number of style changes have been updated, as well as the way features are enabled. Dependencies have also been updated and benches have been updated.
- BREAKING CHANGE: The optional features no longer use the "use_" prefix now that Rust supports the "dep:" syntax since 1.60. Using the features should be much more intuitive now, see the Cargo.toml for details.
- BREAKING CHANGE: Inputs to the tree when using
serde
now need to be theArray
type until Serde supports const generics - Keys can now be of any length so long as they are a fixed size array.
- Added a
decompose
method to theMerkleBIT
to allow accessing the underlying DB before it is dropped.
- Update dependencies
- Update dependencies for
digest
0.6.0 - Update dependencies for
ron
.
- Expand documentation
- Updated dependencies, notably rocksdb to 0.14
- Adjusted API for
verify_inclusion_proof
, it is now an associated function of aTree
and is now called viaTree::verify_inclusion_proof
. - Removed cases where converting to a usize might cause a panic on non 32-bit architectures.
- Removed panic when list of keys provided to internal function was empty.
- Update dependencies
- Update dependencies
- Update dependencies
- Update dependencies
- Update dependencies
- Minor style change to align with idiomatic rust
- Update API for
get
,insert
,generate_inclusion_proof
, andverify_inclusion_proof
. You can now use a single reference to an array or vector instead of needing to create a vector or array of references. - Update API to support multiple size keys up to 32 bytes in length.
- Note: This is a breaking change. Usages of inferred types will work without breaking, but custom implementations may
require some adjustment. Specifically, the API now includes a type argument for the
ArrayType
which must implement the newArray
trait. This has been done already for fixed sized arrays of type[u8; N]
up toN=32
, but must be implemented for any other type. If left unspecified, then the type[u8; 32]
will be used by default.
- Note: This is a breaking change. Usages of inferred types will work without breaking, but custom implementations may
require some adjustment. Specifically, the API now includes a type argument for the
- Remove
use_rayon
. Rayon doesn't seem well suited for the kind of parallelism required for the tree building process. - Change trait bounds on
MerkeBIT
to allow for auto derivation ofSync + Send
if implemented in the underlying data types. - Removed unsafe internal sections of code.
- Introduce new functions
MerkleBIT::generate_inclusion_proof
andMerkleBIT::verify_inclusion_proof
which allow you to generate and verify inclusion proofs of items in a given root. Verifying an inclusion proof requires the same type of tree used to generate the inclusion proof. The verifying tree may be empty. - Fix issue with missing call to batch_write for
RocksTree
. - Implement
Hasher
forDigest
. This provides the following built in supports:- MD2 via
use_md2
- MD4 via
use_md4
- MD5 via
use_md5
- RIPEMD160 via
use_ripemd160
- RIPEMD320 via
use_ripemd320
- SHA-1 via
use_sha1
- Whirlpool via
use_whirlpool
- And other alternate implementations from Rust Crypto
- Blake2b via
use_blake2b
(blake2b_rfc
implementation has been moved touse_blake2b_rfc
) - SHA256 via
use_rust_sha2
- SHA3 via
use_rust_sha3
- Keccak via
use_rust_keccak
- Blake2b via
- MD2 via
- Other hashes implementing
Digest
can be used by activating theuse_digest
feature
- Add
FxHash
support viause_fx
feature. - LTO has been enabled, giving a 10-15% performance boost across the board.
deconstruct
has been renameddecompose
.
- Add
SeaHash
support viause_seahash
feature. - Improve performance of
use_rayon
, though it is still slower than any other feature. - Improve inlining support when LTO is disabled.
- Further performance improvements across the board, this time by around 20-30%.
- Added new unstable feature
use_rayon
. It currently is much slower than any other feature, but will be receiving attention in coming updates.
- Keys must be explicity 32 bytes long, instead of slices
- NOTE: This is a breaking change. However, given that keys already had to be 32 bytes long, this change should be relatively painless.
- General performance improvements of about 30% across the board.
- Add error checking for root that is not 32 bytes long.
- Further major performance improvements. Most cases see 50-70% reduction in time for insertions into a non-empty tree.
- Add error checking for keys that are not 32 bytes long.
- Require custom branch types to provide a key via
get_key
when requested- NOTE: This is a breaking change for custom data structures. Usage of the default tree is not affected.
- Major performance upgrades, as much as 60% in some cases, though most cases see 20-30% improvements.
- Keys are now fixed to 32 bytes in size
- NOTE: This is a breaking change.
- Simplify handling of errors within the crate.
Exception
is used in place ofBox<Error>
. - Reduce the indirection in
create_tree
by compressing long pointer chains. Results in approx 5% performance improvements across the board. - Update
serde-pickle
,ron
,openssl
, androcksdb
.
- Change return type of
get
to return aHashMap<&[u8], Option<ValueType>>
instead of aVec<Option<ValueType>>
. This should resolve ambiguity of the return values when the input key list is not sorted.- NOTE: This is a breaking change.
- Improve performance on inserting into non-empty trees for larger inserts. There is a slight regression in performance for smaller inserts, but the changes allowed for roughly 20% speed increases on inserts with 1000 entries or more.
- Remove
HashResultType
from the tree in favor of using standardVec<u8>
. - Add benchmark for
remove
. - Improve performance for custom trees that don't store keys in branches.
- Require
NodeType
to have aNodeVariant
on creation. - Improve performance for default tree
- Improve performance for larger inserts
- Fix benchmarks to run on stable
- Allow
Hashtree
to accept any type implementingEncode
andDecode
.
- Significant performance improvement for reads, as much as 30% over the last version.
- Insert performance has been improved by as much as 10% in most cases.
- The code has been restructured to make using some popular databases in addition to the existing serialization schemes (or with your own) much easier.
Please see therocks_tree.rs
androcksdb.rs
files for an example on how to integrate your database with the existing tree. - Add RocksDB support via the
use_rocksdb
feature
- Many files have been split up into multiple other modules.
- From this build on, the Git structure will change. It will follow analogous to the current Rust structure, with a stable, beta, and nightly build. This should allow for more structured commits.
- Many "unit" tests were really just integration tests, and as such have been moved to the proper area. This has the bonus of allowing you to run the testing suite on more database types.
- Improve overall performance by about 10% by removing a clone.
- Added
use_hashbrown
feature to use the hashbrown crate for HashTree. This feature will be deprecated once hasbrown is included in the standard library and replaces the existing HashMap. Until then, you can expect around a 10% boost to performance by using the hashbrown feature with the HashTree (and a smaller amount on other structures). - Internal refactoring. Would-be contributors should have a much easier time parsing the existing tree structure.
- NOTE: There are a few minor breaking API changes in this release:
- Some locations have changed with respect to the code restructuring.
HashTree::new
now returns aResult
HashTree::open
has been added to fall in line with the API of the other databases. It also returns aResult
.
- Minor internal optimization
- Separate serde from
default_tree
feature, now useuse_serde
to take advantage of serde for serialization, though a number of serde schemes are implemented as their own features (see below). - Separate bincode from
default_tree
. To use bincode with the default tree, you only need to use the "use_bincode" feature ex.cargo build --features "use_bincode"
- Add JSON support through
use_json
feature - Add CBOR support through
use_cbor
feature - Add YAML support through
use_yaml
feature - Add Pickle support through
use_pickle
feature - Add RON support through
use_ron
feature
- You can now use different hashing schemes with the different serialization features.
- Add Blake2b support through
use_blake2b
feature - Add Groestl support through
use_groestl
feature (note: Groestl is much slower compared to the other hashing algorithms) - Add SHA-2 (SHA256) support through
use_sha2
feature - Add SHA-3 support through
use_sha3
feature - Add Keccak256 support through
use_keccak
feature
- Fixed issue with getting values when supplied keys were not all in the tree
- Fixed issue when using stored split index values on inserts.
- Inputs to get and insert no longer need to be sorted (sorting is done internally)
- Added benchmarking via
cargo bench
- Added fuzzing via
cargo +nightly fuzz <fuzz_target_name>
. Requires installation ofcargo-fuzz
andnightly
toolchain.
- Add serde support for default tree implementation
- You can now use the "default_tree" feature for a tree structure relying on serde and bincode for serialization prior to entering a database. This significantly reduces the boilerplate code needed to connect the tree to a database.
- Added integration test with RocksDB, to run the test you may run
cargo test --features="default_tree"
- Update to 2018 edition of Rust
- Minor code style changes
- Update dev-dependencies
- Removed Encode and Decode trait bounds for Node type
- Added usable implementation for the Merkle-BIT with a HashMap backend (HashTree)
- Added support for storing branch keys to avoid extra DB lookups
- Renamed some traits and enums to better describe their purpose