Skip to content

Commit 61c6261

Browse files
authored
switch to single subtrie crate dep (#1)
Maintain a single 'subtrie' crate.
1 parent 2af70c2 commit 61c6261

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+5213
-4601
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout Sources
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Install Rust Toolchain
2222
uses: actions-rs/toolchain@v1
@@ -37,29 +37,23 @@ jobs:
3737
command: test
3838
args: --workspace
3939

40-
- name: Check trie-db Without Std
40+
- name: Check subtrie Without Std
4141
uses: actions-rs/cargo@v1
4242
with:
4343
command: check
44-
args: --manifest-path trie-db/Cargo.toml --no-default-features
44+
args: --manifest-path subtrie/Cargo.toml --no-default-features
4545

46-
- name: Check memory-db Without Std
46+
- name: Check subtrie-test With bench
4747
uses: actions-rs/cargo@v1
4848
with:
4949
command: check
50-
args: --manifest-path memory-db/Cargo.toml --no-default-features
51-
52-
- name: Check trie-root Without Std
53-
uses: actions-rs/cargo@v1
54-
with:
55-
command: check
56-
args: --manifest-path trie-root/Cargo.toml --no-default-features
50+
args: --manifest-path test/Cargo.toml --benches
5751

5852
fmt:
5953
name: Rustfmt
6054
runs-on: ubuntu-latest
6155
steps:
62-
- uses: actions/checkout@v3
56+
- uses: actions/checkout@v4
6357
- uses: actions-rs/toolchain@v1
6458
with:
6559
profile: minimal

Cargo.toml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
[workspace]
22
members = [
3-
"hash-db",
4-
"memory-db",
53
"hash256-std-hasher",
6-
"test-support/keccak-hasher",
7-
"test-support/reference-trie",
8-
"test-support/trie-standardmap",
9-
"test-support/trie-bench",
10-
"trie-db",
11-
"trie-db/test",
12-
"trie-eip1186",
13-
"trie-eip1186/test",
14-
"trie-root",
15-
"trie-root/test"
4+
"subtrie",
5+
"test",
6+
"reference-trie",
167
]

README.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,11 @@
44
A generic implementation of the Base-16 Modified Merkle Tree ("Trie") data structure,
55
provided under the Apache2 license.
66

7-
The implementation comes in two formats:
8-
9-
- Trie DB (`trie-db` crate) which can be combined with a backend database to provide
10-
a persistent trie structure whose contents can be modified and whose root hash
11-
is recalculated efficiently.
12-
- Trie Root (`trie-root` crate) which provides a closed-form function that accepts a
13-
enumeration of keys and values and provides a root calculated entirely in-memory and
14-
closed form.
15-
167
Trie Hash alone is able to be used in `no_std` builds by disabling its (default)
178
`std` feature.
9+
Implementation is in `subtrie` crate.
1810

19-
In addition to these, several support crates are provided:
20-
21-
- `hash-db` crate, used to provide `Hasher` (trait for all things that
22-
can make cryptographic hashes) and `HashDB` (trait for databases that can have byte
23-
slices pushed into them and allow for them to be retrieved based on their hash).
24-
Suitable for `no_std`, though in this case will only provide `Hasher`.
25-
- `memory-db` crate, contains `MemoryDB`, an implementation of a `HashDB` using only
26-
in in-memory map.
27-
- `hash256-std-hasher` crate, an implementation of a `std::hash::Hasher` for 32-byte
28-
keys that have already been hashed. Useful to build the backing `HashMap` for `MemoryDB`.
29-
30-
There are also three crates used only for testing:
31-
32-
- `keccak-hasher` crate, an implementation of `Hasher` based on the Keccak-256 algorithm.
33-
- `reference-trie` crate, an implementation of a simple trie format; this provides both
34-
a `NodeCodec` and `TrieStream` implementation making it suitable for both Trie DB and
35-
Trie Root.
36-
- `trie-standardmap` crate, a key/value generation tool for creating large test datasets
37-
to specific qualities.
38-
- `trie-bench` crate, a comprehensive standard benchmarking tool for trie format
39-
implementations. Works using the `criterion` project so benchmarking can be done with
40-
the stable rustc branch.
11+
Testing in `reference-trie` crate and `trie-db-test`.
4112

4213
In the spirit of all things Rust, this aims to be reliable, secure, and high performance.
4314

hash-db/CHANGELOG.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

hash-db/Cargo.toml

Lines changed: 0 additions & 14 deletions
This file was deleted.

hash-db/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

hash-db/src/lib.rs

Lines changed: 0 additions & 216 deletions
This file was deleted.

hash256-std-hasher/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ harness = false
1616
crunchy = "0.2.1"
1717

1818
[dev-dependencies]
19-
criterion = "0.4.0"
19+
criterion = "0.5.1"
2020

2121
[features]
2222
default = ["std"]

0 commit comments

Comments
 (0)