Skip to content

Commit

Permalink
refactor: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
polydez committed Oct 30, 2024
1 parent 66f66a7 commit 7fd8cf5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion crates/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ deadpool-sqlite = { version = "0.8", features = ["rt_tokio_1"] }
directories = { version = "5.0" }
figment = { version = "0.10", features = ["toml", "env"] }
hex = { version = "0.4" }
miden-crypto = { version = "0.11", default-features = false }
miden-lib = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-utils = { workspace = true }
Expand Down
3 changes: 1 addition & 2 deletions crates/store/src/nullifier_tree.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use miden_crypto::merkle::SMT_DEPTH;
use miden_objects::{
crypto::{
hash::rpo::RpoDigest,
merkle::{MutationSet, Smt, SmtProof},
merkle::{MutationSet, Smt, SmtProof, SMT_DEPTH},
},
notes::Nullifier,
Felt, FieldElement, Word,
Expand Down
7 changes: 4 additions & 3 deletions crates/store/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ impl State {
let block_save_task =
tokio::spawn(async move { store.save_block(block_num, &block_data).await });

// scope to read in-memory data, validate the request, and compute intermediary values
let (account_tree_update, nullifier_tree_update, account_tree_old_root) = {
// scope to read in-memory data, compute mutations required for updating account
// and nullifier trees, and validate the request
let (account_tree_old_root, account_tree_update, nullifier_tree_update) = {
let inner = self.inner.read().await;

let _span = info_span!(target: COMPONENT, "update_in_memory_structs").entered();
Expand Down Expand Up @@ -255,7 +256,7 @@ impl State {
return Err(ApplyBlockError::NewBlockInvalidAccountRoot);
}

(account_tree_update, nullifier_tree_update, inner.account_tree.root())
(inner.account_tree.root(), account_tree_update, nullifier_tree_update)
};

// build note tree
Expand Down

0 comments on commit 7fd8cf5

Please sign in to comment.