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 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: storage proofs for rpc version v0.8.0
- fix(rocksdb): update max open files opt
- code: refactor to use otel tracing instead of prometheus (removed mc-metrics, added mc-analytics)
- fix(version constants): 0.13.2 was mapped to wrong constants
Expand Down
34 changes: 23 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" }
shamsasari marked this conversation as resolved.
Show resolved Hide resolved

# 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 = [
shamsasari marked this conversation as resolved.
Show resolved Hide resolved
"std",
] }

Expand Down Expand Up @@ -176,6 +175,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 @@ -186,7 +186,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);

Choose a reason for hiding this comment

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

Im interested about this tree (specifically about the height). What is for?

Copy link
Member Author

Choose a reason for hiding this comment

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

https://docs.starknet.io/architecture-and-concepts/network-architecture/block-structure/#transactions_events_receipts_commitments

in-memory merkle tree within every block
max tree height is 64 since the indices are u64s.
will add a comment about that


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