From 1e9eb88ad712dfad37200ab7f2a9022bf91c01a7 Mon Sep 17 00:00:00 2001 From: AvivYossef-starkware <141143145+AvivYossef-starkware@users.noreply.github.com> Date: Sun, 21 Apr 2024 16:16:51 +0300 Subject: [PATCH] refactor: move updated skeleton and original skeleton to sub directories (#57) --- crates/committer/src/patricia_merkle_tree.rs | 3 - .../patricia_merkle_tree/filled_tree/node.rs | 3 - .../filled_tree/node_serde.rs | 2 +- .../original_skeleton_tree.rs | 32 +--- .../node.rs} | 0 .../original_skeleton_calc.rs | 10 +- .../original_skeleton_calc_test.rs | 6 +- .../original_skeleton_tree/tree.rs | 29 +++ .../updated_skeleton_tree.rs | 174 +----------------- .../node.rs} | 0 .../updated_skeleton_tree/tree.rs | 172 +++++++++++++++++ .../tree_test.rs} | 4 +- 12 files changed, 218 insertions(+), 217 deletions(-) rename crates/committer/src/patricia_merkle_tree/{original_skeleton_node.rs => original_skeleton_tree/node.rs} (100%) rename crates/committer/src/patricia_merkle_tree/{ => original_skeleton_tree}/original_skeleton_calc.rs (95%) rename crates/committer/src/patricia_merkle_tree/{ => original_skeleton_tree}/original_skeleton_calc_test.rs (97%) create mode 100644 crates/committer/src/patricia_merkle_tree/original_skeleton_tree/tree.rs rename crates/committer/src/patricia_merkle_tree/{updated_skeleton_node.rs => updated_skeleton_tree/node.rs} (100%) create mode 100644 crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree.rs rename crates/committer/src/patricia_merkle_tree/{updated_skeleton_tree_test.rs => updated_skeleton_tree/tree_test.rs} (98%) diff --git a/crates/committer/src/patricia_merkle_tree.rs b/crates/committer/src/patricia_merkle_tree.rs index ae7894de..e6db1cf5 100644 --- a/crates/committer/src/patricia_merkle_tree.rs +++ b/crates/committer/src/patricia_merkle_tree.rs @@ -1,8 +1,5 @@ pub mod errors; pub mod filled_tree; -pub mod original_skeleton_calc; -pub mod original_skeleton_node; pub mod original_skeleton_tree; pub mod types; -pub mod updated_skeleton_node; pub mod updated_skeleton_tree; diff --git a/crates/committer/src/patricia_merkle_tree/filled_tree/node.rs b/crates/committer/src/patricia_merkle_tree/filled_tree/node.rs index 1f947c08..08534c77 100644 --- a/crates/committer/src/patricia_merkle_tree/filled_tree/node.rs +++ b/crates/committer/src/patricia_merkle_tree/filled_tree/node.rs @@ -70,9 +70,6 @@ impl LeafDataTrait for LeafData { } } -#[allow(dead_code)] -impl FilledNode {} - impl LeafData { /// Serializes the leaf data into a byte vector. /// The serialization is done as follows: diff --git a/crates/committer/src/patricia_merkle_tree/filled_tree/node_serde.rs b/crates/committer/src/patricia_merkle_tree/filled_tree/node_serde.rs index 2e6b43e8..c08d3e35 100644 --- a/crates/committer/src/patricia_merkle_tree/filled_tree/node_serde.rs +++ b/crates/committer/src/patricia_merkle_tree/filled_tree/node_serde.rs @@ -1,7 +1,7 @@ use crate::hash::hash_trait::HashOutput; use crate::patricia_merkle_tree::filled_tree::node::{BinaryData, FilledNode, LeafData, NodeData}; use crate::patricia_merkle_tree::filled_tree::tree::FilledTreeResult; -use crate::patricia_merkle_tree::original_skeleton_tree::OriginalSkeletonTreeResult; +use crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTreeResult; use crate::patricia_merkle_tree::types::{EdgeData, EdgePath, EdgePathLength, PathToBottom}; use crate::storage::storage_trait::{create_db_key, StorageKey, StorageValue}; use crate::types::Felt; diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs index 777ee481..00b01487 100644 --- a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree.rs @@ -1,29 +1,3 @@ -use std::collections::HashMap; - -use crate::hash::hash_trait::HashOutput; -use crate::patricia_merkle_tree::errors::OriginalSkeletonTreeError; -use crate::patricia_merkle_tree::types::{LeafDataTrait, NodeIndex, TreeHeight}; -use crate::patricia_merkle_tree::updated_skeleton_tree::UpdatedSkeletonTree; -use crate::storage::storage_trait::Storage; - -#[allow(dead_code)] -pub(crate) type OriginalSkeletonTreeResult = Result; - -/// Consider a Patricia-Merkle Tree which should be updated with new leaves. -/// This trait represents the structure of the subtree which will be modified in the -/// update. It also contains the hashes (for edge siblings - also the edge data) of the Sibling -/// nodes on the Merkle paths from the updated leaves to the root. -pub(crate) trait OriginalSkeletonTree { - fn create_tree( - storage: &impl Storage, - leaf_indices: &[NodeIndex], - root_hash: HashOutput, - tree_height: TreeHeight, - ) -> OriginalSkeletonTreeResult>; - - /// Computes and returns updated skeleton tree. - fn compute_updated_skeleton_tree( - &self, - index_to_updated_leaf: HashMap, - ) -> OriginalSkeletonTreeResult>; -} +pub mod node; +pub mod original_skeleton_calc; +pub mod tree; diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_node.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/node.rs similarity index 100% rename from crates/committer/src/patricia_merkle_tree/original_skeleton_node.rs rename to crates/committer/src/patricia_merkle_tree/original_skeleton_tree/node.rs diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_calc.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/original_skeleton_calc.rs similarity index 95% rename from crates/committer/src/patricia_merkle_tree/original_skeleton_calc.rs rename to crates/committer/src/patricia_merkle_tree/original_skeleton_tree/original_skeleton_calc.rs index 910e9dea..c20c7513 100644 --- a/crates/committer/src/patricia_merkle_tree/original_skeleton_calc.rs +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/original_skeleton_calc.rs @@ -3,13 +3,15 @@ use crate::patricia_merkle_tree::filled_tree::node::BinaryData; use crate::patricia_merkle_tree::filled_tree::node::FilledNode; use crate::patricia_merkle_tree::filled_tree::node::LeafData; use crate::patricia_merkle_tree::filled_tree::node::NodeData; -use crate::patricia_merkle_tree::original_skeleton_tree::OriginalSkeletonTree; -use crate::patricia_merkle_tree::original_skeleton_tree::OriginalSkeletonTreeResult; +use crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTree; +use crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTreeResult; use crate::patricia_merkle_tree::types::EdgeData; use crate::patricia_merkle_tree::types::PathToBottom; use crate::patricia_merkle_tree::types::TreeHeight; -use crate::patricia_merkle_tree::updated_skeleton_tree::UpdatedSkeletonTreeImpl; -use crate::patricia_merkle_tree::{original_skeleton_node::OriginalSkeletonNode, types::NodeIndex}; +use crate::patricia_merkle_tree::updated_skeleton_tree::tree::UpdatedSkeletonTreeImpl; +use crate::patricia_merkle_tree::{ + original_skeleton_tree::node::OriginalSkeletonNode, types::NodeIndex, +}; use crate::storage::errors::StorageError; use crate::storage::storage_trait::Storage; use crate::storage::storage_trait::StorageKey; diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_calc_test.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/original_skeleton_calc_test.rs similarity index 97% rename from crates/committer/src/patricia_merkle_tree/original_skeleton_calc_test.rs rename to crates/committer/src/patricia_merkle_tree/original_skeleton_tree/original_skeleton_calc_test.rs index 6843d9ce..5c079b14 100644 --- a/crates/committer/src/patricia_merkle_tree/original_skeleton_calc_test.rs +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/original_skeleton_calc_test.rs @@ -1,7 +1,7 @@ use crate::hash::hash_trait::HashOutput; -use crate::patricia_merkle_tree::original_skeleton_calc::LeafData; -use crate::patricia_merkle_tree::original_skeleton_node::OriginalSkeletonNode; -use crate::patricia_merkle_tree::original_skeleton_tree::OriginalSkeletonTree; +use crate::patricia_merkle_tree::original_skeleton_tree::node::OriginalSkeletonNode; +use crate::patricia_merkle_tree::original_skeleton_tree::original_skeleton_calc::LeafData; +use crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTree; use crate::patricia_merkle_tree::types::{EdgePath, EdgePathLength, NodeIndex, PathToBottom}; use crate::storage::map_storage::MapStorage; use crate::types::Felt; diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/tree.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/tree.rs new file mode 100644 index 00000000..ff129797 --- /dev/null +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/tree.rs @@ -0,0 +1,29 @@ +use std::collections::HashMap; + +use crate::hash::hash_trait::HashOutput; +use crate::patricia_merkle_tree::errors::OriginalSkeletonTreeError; +use crate::patricia_merkle_tree::types::{LeafDataTrait, NodeIndex, TreeHeight}; +use crate::patricia_merkle_tree::updated_skeleton_tree::tree::UpdatedSkeletonTree; +use crate::storage::storage_trait::Storage; + +#[allow(dead_code)] +pub(crate) type OriginalSkeletonTreeResult = Result; + +/// Consider a Patricia-Merkle Tree which should be updated with new leaves. +/// This trait represents the structure of the subtree which will be modified in the +/// update. It also contains the hashes (for edge siblings - also the edge data) of the Sibling +/// nodes on the Merkle paths from the updated leaves to the root. +pub(crate) trait OriginalSkeletonTree { + fn create_tree( + storage: &impl Storage, + leaf_indices: &[NodeIndex], + root_hash: HashOutput, + tree_height: TreeHeight, + ) -> OriginalSkeletonTreeResult>; + + /// Computes and returns updated skeleton tree. + fn compute_updated_skeleton_tree( + &self, + index_to_updated_leaf: HashMap, + ) -> OriginalSkeletonTreeResult>; +} diff --git a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree.rs b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree.rs index 1a8988ad..1ccbf850 100644 --- a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree.rs +++ b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree.rs @@ -1,172 +1,2 @@ -use std::collections::HashMap; -use std::sync::{Arc, Mutex}; - -use crate::hash::hash_trait::{HashFunction, HashOutput}; -use crate::patricia_merkle_tree::errors::UpdatedSkeletonTreeError; -use crate::patricia_merkle_tree::filled_tree::tree::FilledTree; -use crate::patricia_merkle_tree::types::{LeafDataTrait, NodeIndex, TreeHashFunction}; -use crate::patricia_merkle_tree::updated_skeleton_node::UpdatedSkeletonNode; -use crate::types::Felt; - -use crate::patricia_merkle_tree::filled_tree::node::{BinaryData, FilledNode, NodeData}; -use crate::patricia_merkle_tree::filled_tree::tree::FilledTreeImpl; -use crate::patricia_merkle_tree::types::EdgeData; - -#[cfg(test)] -#[path = "updated_skeleton_tree_test.rs"] -pub mod updated_skeleton_tree_test; - -/// Consider a Patricia-Merkle Tree which has been updated with new leaves. -/// This trait represents the structure of the subtree which was modified in the update. -/// It also contains the hashes of the Sibling nodes on the Merkle paths from the updated leaves -/// to the root. -pub(crate) trait UpdatedSkeletonTree { - /// Computes and returns the filled tree. - fn compute_filled_tree>( - &self, - ) -> Result, UpdatedSkeletonTreeError>; -} - -pub(crate) struct UpdatedSkeletonTreeImpl { - skeleton_tree: HashMap>, -} - -impl - UpdatedSkeletonTreeImpl -{ - fn get_node( - &self, - index: NodeIndex, - ) -> Result<&UpdatedSkeletonNode, UpdatedSkeletonTreeError> { - match self.skeleton_tree.get(&index) { - Some(node) => Ok(node), - None => Err(UpdatedSkeletonTreeError::MissingNode(index)), - } - } - - /// Writes the hash and data to the output map. The writing is done in a thread-safe manner with - /// interior mutability to avoid thread contention. - fn write_to_output_map( - output_map: Arc>>>>, - index: NodeIndex, - hash: HashOutput, - data: NodeData, - ) -> Result<(), UpdatedSkeletonTreeError> { - match output_map.get(&index) { - Some(node) => { - let mut node = node.lock().map_err(|_| { - UpdatedSkeletonTreeError::PoisonedLock("Cannot lock node.".to_owned()) - })?; - match node.take() { - Some(existing_node) => Err(UpdatedSkeletonTreeError::DoubleUpdate { - index, - existing_value: Box::new(existing_node), - }), - None => { - *node = Some(FilledNode { hash, data }); - Ok(()) - } - } - } - None => Err(UpdatedSkeletonTreeError::MissingNode(index)), - } - } - - fn initialize_with_placeholders(&self) -> HashMap>>> { - let mut filled_tree_map = HashMap::new(); - for (index, node) in &self.skeleton_tree { - if !matches!(node, UpdatedSkeletonNode::Sibling(_)) { - filled_tree_map.insert(*index, Mutex::new(None)); - } - } - filled_tree_map - } - - fn remove_arc_mutex_and_option( - hash_map_in: Arc>>>>, - ) -> Result>, UpdatedSkeletonTreeError> { - let mut hash_map_out = HashMap::new(); - for (key, value) in hash_map_in.iter() { - let mut value = value.lock().map_err(|_| { - UpdatedSkeletonTreeError::PoisonedLock("Cannot lock node.".to_owned()) - })?; - match value.take() { - Some(value) => { - hash_map_out.insert(*key, value); - } - None => return Err(UpdatedSkeletonTreeError::MissingNode(*key)), - } - } - Ok(hash_map_out) - } - - fn compute_filled_tree_rec>( - &self, - index: NodeIndex, - output_map: Arc>>>>, - ) -> Result> { - let node = self.get_node(index)?; - match node { - UpdatedSkeletonNode::Binary => { - let left_index = NodeIndex(index.0 * Felt::TWO); - let right_index = NodeIndex(left_index.0 + Felt::ONE); - - let (left_hash, right_hash) = rayon::join( - || self.compute_filled_tree_rec::(left_index, Arc::clone(&output_map)), - || self.compute_filled_tree_rec::(right_index, Arc::clone(&output_map)), - ); - - let data = NodeData::Binary(BinaryData { - left_hash: left_hash?, - right_hash: right_hash?, - }); - - let hash_value = TH::compute_node_hash(&data); - Self::write_to_output_map(output_map, index, hash_value, data)?; - Ok(hash_value) - } - UpdatedSkeletonNode::Edge { path_to_bottom } => { - let bottom_node_index = NodeIndex::compute_bottom_index(index, path_to_bottom); - let bottom_hash = self - .compute_filled_tree_rec::(bottom_node_index, Arc::clone(&output_map))?; - let data = NodeData::Edge(EdgeData { - path_to_bottom: *path_to_bottom, - bottom_hash, - }); - let hash_value = TH::compute_node_hash(&data); - Self::write_to_output_map(output_map, index, hash_value, data)?; - Ok(hash_value) - } - UpdatedSkeletonNode::Sibling(hash_result) => Ok(*hash_result), - UpdatedSkeletonNode::Leaf(node_data) => { - let data = NodeData::Leaf(node_data.clone()); - let hash_value = TH::compute_node_hash(&data); - Self::write_to_output_map(output_map, index, hash_value, data)?; - Ok(hash_value) - } - } - } -} - -impl - UpdatedSkeletonTree for UpdatedSkeletonTreeImpl -{ - fn compute_filled_tree>( - &self, - ) -> Result, UpdatedSkeletonTreeError> { - // Compute the filled tree in two steps: - // 1. Create a map containing the tree structure without hash values. - // 2. Fill in the hash values. - let filled_tree_map = Arc::new(self.initialize_with_placeholders()); - - self.compute_filled_tree_rec::( - NodeIndex::root_index(), - Arc::clone(&filled_tree_map), - )?; - - // Create and return a new FilledTreeImpl from the hashmap. - Ok(FilledTreeImpl::new(Self::remove_arc_mutex_and_option( - filled_tree_map, - )?)) - } -} +pub mod node; +pub mod tree; diff --git a/crates/committer/src/patricia_merkle_tree/updated_skeleton_node.rs b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/node.rs similarity index 100% rename from crates/committer/src/patricia_merkle_tree/updated_skeleton_node.rs rename to crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/node.rs diff --git a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree.rs b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree.rs new file mode 100644 index 00000000..c5f258a4 --- /dev/null +++ b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree.rs @@ -0,0 +1,172 @@ +use std::collections::HashMap; +use std::sync::{Arc, Mutex}; + +use crate::hash::hash_trait::{HashFunction, HashOutput}; +use crate::patricia_merkle_tree::errors::UpdatedSkeletonTreeError; +use crate::patricia_merkle_tree::filled_tree::tree::FilledTree; +use crate::patricia_merkle_tree::types::{LeafDataTrait, NodeIndex, TreeHashFunction}; +use crate::patricia_merkle_tree::updated_skeleton_tree::node::UpdatedSkeletonNode; +use crate::types::Felt; + +use crate::patricia_merkle_tree::filled_tree::node::{BinaryData, FilledNode, NodeData}; +use crate::patricia_merkle_tree::filled_tree::tree::FilledTreeImpl; +use crate::patricia_merkle_tree::types::EdgeData; + +#[cfg(test)] +#[path = "tree_test.rs"] +pub mod tree_test; + +/// Consider a Patricia-Merkle Tree which has been updated with new leaves. +/// This trait represents the structure of the subtree which was modified in the update. +/// It also contains the hashes of the Sibling nodes on the Merkle paths from the updated leaves +/// to the root. +pub(crate) trait UpdatedSkeletonTree { + /// Computes and returns the filled tree. + fn compute_filled_tree>( + &self, + ) -> Result, UpdatedSkeletonTreeError>; +} + +pub(crate) struct UpdatedSkeletonTreeImpl { + skeleton_tree: HashMap>, +} + +impl + UpdatedSkeletonTreeImpl +{ + fn get_node( + &self, + index: NodeIndex, + ) -> Result<&UpdatedSkeletonNode, UpdatedSkeletonTreeError> { + match self.skeleton_tree.get(&index) { + Some(node) => Ok(node), + None => Err(UpdatedSkeletonTreeError::MissingNode(index)), + } + } + + /// Writes the hash and data to the output map. The writing is done in a thread-safe manner with + /// interior mutability to avoid thread contention. + fn write_to_output_map( + output_map: Arc>>>>, + index: NodeIndex, + hash: HashOutput, + data: NodeData, + ) -> Result<(), UpdatedSkeletonTreeError> { + match output_map.get(&index) { + Some(node) => { + let mut node = node.lock().map_err(|_| { + UpdatedSkeletonTreeError::PoisonedLock("Cannot lock node.".to_owned()) + })?; + match node.take() { + Some(existing_node) => Err(UpdatedSkeletonTreeError::DoubleUpdate { + index, + existing_value: Box::new(existing_node), + }), + None => { + *node = Some(FilledNode { hash, data }); + Ok(()) + } + } + } + None => Err(UpdatedSkeletonTreeError::MissingNode(index)), + } + } + + fn initialize_with_placeholders(&self) -> HashMap>>> { + let mut filled_tree_map = HashMap::new(); + for (index, node) in &self.skeleton_tree { + if !matches!(node, UpdatedSkeletonNode::Sibling(_)) { + filled_tree_map.insert(*index, Mutex::new(None)); + } + } + filled_tree_map + } + + fn remove_arc_mutex_and_option( + hash_map_in: Arc>>>>, + ) -> Result>, UpdatedSkeletonTreeError> { + let mut hash_map_out = HashMap::new(); + for (key, value) in hash_map_in.iter() { + let mut value = value.lock().map_err(|_| { + UpdatedSkeletonTreeError::PoisonedLock("Cannot lock node.".to_owned()) + })?; + match value.take() { + Some(value) => { + hash_map_out.insert(*key, value); + } + None => return Err(UpdatedSkeletonTreeError::MissingNode(*key)), + } + } + Ok(hash_map_out) + } + + fn compute_filled_tree_rec>( + &self, + index: NodeIndex, + output_map: Arc>>>>, + ) -> Result> { + let node = self.get_node(index)?; + match node { + UpdatedSkeletonNode::Binary => { + let left_index = NodeIndex(index.0 * Felt::TWO); + let right_index = NodeIndex(left_index.0 + Felt::ONE); + + let (left_hash, right_hash) = rayon::join( + || self.compute_filled_tree_rec::(left_index, Arc::clone(&output_map)), + || self.compute_filled_tree_rec::(right_index, Arc::clone(&output_map)), + ); + + let data = NodeData::Binary(BinaryData { + left_hash: left_hash?, + right_hash: right_hash?, + }); + + let hash_value = TH::compute_node_hash(&data); + Self::write_to_output_map(output_map, index, hash_value, data)?; + Ok(hash_value) + } + UpdatedSkeletonNode::Edge { path_to_bottom } => { + let bottom_node_index = NodeIndex::compute_bottom_index(index, path_to_bottom); + let bottom_hash = self + .compute_filled_tree_rec::(bottom_node_index, Arc::clone(&output_map))?; + let data = NodeData::Edge(EdgeData { + path_to_bottom: *path_to_bottom, + bottom_hash, + }); + let hash_value = TH::compute_node_hash(&data); + Self::write_to_output_map(output_map, index, hash_value, data)?; + Ok(hash_value) + } + UpdatedSkeletonNode::Sibling(hash_result) => Ok(*hash_result), + UpdatedSkeletonNode::Leaf(node_data) => { + let data = NodeData::Leaf(node_data.clone()); + let hash_value = TH::compute_node_hash(&data); + Self::write_to_output_map(output_map, index, hash_value, data)?; + Ok(hash_value) + } + } + } +} + +impl + UpdatedSkeletonTree for UpdatedSkeletonTreeImpl +{ + fn compute_filled_tree>( + &self, + ) -> Result, UpdatedSkeletonTreeError> { + // Compute the filled tree in two steps: + // 1. Create a map containing the tree structure without hash values. + // 2. Fill in the hash values. + let filled_tree_map = Arc::new(self.initialize_with_placeholders()); + + self.compute_filled_tree_rec::( + NodeIndex::root_index(), + Arc::clone(&filled_tree_map), + )?; + + // Create and return a new FilledTreeImpl from the hashmap. + Ok(FilledTreeImpl::new(Self::remove_arc_mutex_and_option( + filled_tree_map, + )?)) + } +} diff --git a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree_test.rs b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree_test.rs similarity index 98% rename from crates/committer/src/patricia_merkle_tree/updated_skeleton_tree_test.rs rename to crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree_test.rs index c5518bcf..ebc1c950 100644 --- a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree_test.rs +++ b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/tree_test.rs @@ -9,8 +9,8 @@ use crate::patricia_merkle_tree::filled_tree::tree::FilledTree; use crate::patricia_merkle_tree::types::{ EdgeData, EdgePath, EdgePathLength, NodeIndex, PathToBottom, TreeHashFunctionImpl, }; -use crate::patricia_merkle_tree::updated_skeleton_node::UpdatedSkeletonNode; -use crate::patricia_merkle_tree::updated_skeleton_tree::{ +use crate::patricia_merkle_tree::updated_skeleton_tree::node::UpdatedSkeletonNode; +use crate::patricia_merkle_tree::updated_skeleton_tree::tree::{ UpdatedSkeletonTree, UpdatedSkeletonTreeImpl, }; use crate::types::Felt;