-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial sealable trie implementation (#1)
As per the documentation, the sealable trie data structure is a Merkle Patricia Trie with an additional feature where values can be sealed such that they can no longer be changed but also can no longer be accessed. The second property allows the trie to remove nodes keeping sealed values thus reducing storage requirements for the trie. As often is the case, there’s room to add more tests to the code, but for the large part the trie is functional.
- Loading branch information
Showing
19 changed files
with
4,238 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
name: PR Checks | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
misc: | ||
name: Miscellaneous checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- name: Check formatting | ||
run: cargo fmt --all --check | ||
|
||
- name: Install cargo-deny | ||
run: cargo install cargo-deny | ||
|
||
- name: Check bans | ||
run: cargo-deny --all-features check bans | ||
|
||
stable: | ||
name: Rust stable | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
|
||
- name: Run tests | ||
run: cargo test | ||
|
||
nightly: | ||
name: Rust nightly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: miri | ||
|
||
- name: Run tests | ||
run: cargo test | ||
|
||
- name: Run tests with Miri | ||
run: cargo miri test -- --skip ::stress_test |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# binop_separator = "Back" | ||
# blank_lines_lower_bound = 0 | ||
# blank_lines_upper_bound = 3 | ||
# brace_style = "PreferSameLine" | ||
# color = "Auto" | ||
# condense_wildcard_suffixes = true | ||
# fn_single_line = true | ||
# format_macro_matchers = true | ||
# format_strings = true | ||
# group_imports = "StdExternalCrate" | ||
# normalize_doc_attributes = true | ||
# overflow_delimited_expr = true | ||
|
||
binop_separator = "Back" | ||
blank_lines_lower_bound = 0 | ||
blank_lines_upper_bound = 3 | ||
color = "Auto" | ||
condense_wildcard_suffixes = true | ||
fn_single_line = true | ||
format_macro_matchers = true | ||
format_strings = true | ||
group_imports = "StdExternalCrate" | ||
imports_granularity = "Module" | ||
max_width = 80 | ||
newline_style = "Unix" | ||
normalize_doc_attributes = true | ||
overflow_delimited_expr = true | ||
reorder_imports = true | ||
reorder_modules = true | ||
use_field_init_shorthand = true | ||
use_small_heuristics = "Max" | ||
use_try_shorthand = true |
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,19 @@ | ||
[workspace.package] | ||
version = "0.0.0" | ||
authors = ["Michal Nazarewicz <[email protected]>"] | ||
edition = "2021" | ||
rust-version = "1.71.0" | ||
|
||
[workspace] | ||
members = [ | ||
"sealable-trie", | ||
] | ||
resolver = "2" | ||
|
||
[workspace.dependencies] | ||
base64 = { version = "0.21", default-features = false, features = ["alloc"] } | ||
derive_more = "0.99.17" | ||
pretty_assertions = "1.4.0" | ||
rand = { version = "0.8.5" } | ||
sha2 = { version = "0.10.7", default-features = false } | ||
strum = { version = "0.25.0", default-features = false, features = ["derive"] } |
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,12 @@ | ||
[sources] | ||
unknown-registry = "deny" | ||
unknown-git = "deny" | ||
allow-registry = ["https://github.com/rust-lang/crates.io-index"] | ||
allow-git = [] | ||
|
||
[bans] | ||
multiple-versions = "deny" | ||
skip = [ | ||
# derive_more still uses old syn | ||
{ name = "syn", version = "1.0.*" }, | ||
] |
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,14 @@ | ||
[package] | ||
name = "sealable-trie" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
base64.workspace = true | ||
derive_more.workspace = true | ||
sha2.workspace = true | ||
strum.workspace = true | ||
|
||
[dev-dependencies] | ||
pretty_assertions.workspace = true | ||
rand.workspace = true |
Oops, something went wrong.