Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rpc): storage proofs for snos and v0.8.0 #292

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- feat(v0.8.0-rc0): storage proofs for rpc version v0.8.0
- feat(confg): added chain config template and fgw example
- feat(v0.8.0-rc0): starknet_subscribeNewHeads
- fix(rocksdb): update max open files opt
Expand Down
33 changes: 22 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ version = "0.7.0"
license = "Apache-2.0"

[workspace.dependencies]
rocksdb = { version = "0.22", features = [
# "multi-threaded-cf",
] }
rocksdb = { version = "0.22", git = "https://github.com/madara-alliance/rust-rocksdb", branch = "read-options-set-raw-snapshot" }
librocksdb-sys = { version = "0.17.0", git = "https://github.com/madara-alliance/rust-rocksdb", branch = "read-options-set-raw-snapshot" }
Comment on lines +88 to +89
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using different versions of the same branch?


# Bonsai trie dependencies
bonsai-trie = { default-features = false, git = "https://github.com/cchudant/bonsai-trie.git", branch = "fix_inserts_remove_leaks", features = [
bonsai-trie = { default-features = false, git = "https://github.com/madara-alliance/bonsai-trie", branch = "trie-log", features = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base branch is oss. Is the plan to merge trie-log into oss or is oss used for something else?

"std",
] }

Expand Down Expand Up @@ -178,6 +177,7 @@ once_cell = "1.19"
log = { version = "0.4", features = [
"std",
"kv_std",
# Statically disable trace logs in release builds.
"release_max_level_debug",
] }
num-traits = "0.2"
Expand All @@ -188,7 +188,10 @@ indoc = "2"
reqwest = { version = "0.12", features = ["blocking", "json"] }
rstest = "0.18"
serde = { version = "1.0", default-features = false, features = ["std"] }
serde_with = "3.9"
serde_with = { version = "2.3.2", default-features = false, features = [
"alloc",
"macros",
] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
serde_yaml = { version = "0.9.34" }
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/client/block_import/src/pre_validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ fn compute_merkle_root<H: StarkHash + Send + Sync>(values: &[Felt]) -> Felt {
let config = bonsai_trie::BonsaiStorageConfig::default();
let bonsai_db = bonsai_trie::databases::HashMapDb::<bonsai_trie::id::BasicId>::default();
let mut bonsai_storage =
bonsai_trie::BonsaiStorage::<_, _, H>::new(bonsai_db, config).expect("Failed to create bonsai storage");
bonsai_trie::BonsaiStorage::<_, _, H>::new(bonsai_db, config, /* max tree height */ 64);

values.iter().enumerate().for_each(|(id, value)| {
let key = BitVec::from_vec(id.to_be_bytes().to_vec());
Expand Down
7 changes: 5 additions & 2 deletions crates/client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ repository.workspace = true
version.workspace = true
homepage.workspace = true

[lints]
workspace = true
[lints.clippy]
# We cannot inherit the lints because we use unsafe in this crate.
print_stdout = "warn"
print_stderr = "warn"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand All @@ -35,6 +37,7 @@ starknet_api = { workspace = true }
# Other
anyhow.workspace = true
bincode = { workspace = true }
librocksdb-sys = { workspace = true }
log = { workspace = true, default-features = true }
rayon = { workspace = true }
rocksdb.workspace = true
Expand Down
Loading
Loading