diff --git a/grovedb/src/replication.rs b/grovedb/src/replication.rs index b1a3e02f..1cd50519 100644 --- a/grovedb/src/replication.rs +++ b/grovedb/src/replication.rs @@ -236,8 +236,6 @@ impl GroveDb { )); } - println!(" starting:{:?}...", utils::path_to_string(&[])); - let root_prefix = [0u8; 32]; let mut session = self.start_syncing_session(app_hash); diff --git a/grovedb/src/replication/state_sync_session.rs b/grovedb/src/replication/state_sync_session.rs index d4c1c9af..59d93316 100644 --- a/grovedb/src/replication/state_sync_session.rs +++ b/grovedb/src/replication/state_sync_session.rs @@ -48,10 +48,6 @@ struct SubtreeStateSyncInfo<'db> { } impl SubtreeStateSyncInfo<'_> { - pub fn get_current_path(&self) -> Vec> { - self.current_path.clone() - } - /// Applies a chunk using the given `SubtreeStateSyncInfo`. /// /// # Parameters @@ -382,7 +378,7 @@ impl<'db> MultiStateSyncSession<'db> { return Ok(vec![]); } - let completed_path = subtree_state_sync.get_current_path(); + let completed_path = subtree_state_sync.current_path.clone(); // Subtree is finished. We can save it. if subtree_state_sync.num_processed_chunks > 0 { @@ -403,12 +399,8 @@ impl<'db> MultiStateSyncSession<'db> { self.as_mut().processed_prefixes().insert(chunk_prefix); - println!( - " finished tree: {:?}", - path_to_string(completed_path.as_slice()) - ); let new_subtrees_metadata = - self.discover_new_subtrees_metadata(db, completed_path.to_vec(), grove_version)?; + self.discover_new_subtrees_metadata(db, &completed_path, grove_version)?; if let Ok(res) = self.prepare_sync_state_sessions(db, new_subtrees_metadata, grove_version) @@ -456,7 +448,7 @@ impl<'db> MultiStateSyncSession<'db> { fn discover_new_subtrees_metadata( self: &mut Pin>>, db: &'db GroveDb, - path_vec: Vec>, + path_vec: &[Vec], grove_version: &GroveVersion, ) -> Result { let transaction_ref: &'db Transaction<'db> = unsafe { @@ -500,12 +492,6 @@ impl<'db> MultiStateSyncSession<'db> { let path: &[&[u8]] = &subtree_path; let prefix = RocksDbStorage::build_prefix(path.as_ref().into()).unwrap(); - println!( - " discovered {:?} prefix:{}", - path_to_string(&new_path), - hex::encode(prefix) - ); - subtrees_metadata.data.insert( prefix, (new_path.to_vec(), actual_value_hash, elem_value_hash), @@ -566,10 +552,6 @@ impl<'db> MultiStateSyncSession<'db> { let subtree_path: Vec<&[u8]> = current_path.iter().map(|vec| vec.as_slice()).collect(); let path: &[&[u8]] = &subtree_path; - println!( - " path:{:?} starting...", - path_to_string(&prefix_metadata.0) - ); let next_chunks_ids = self.add_subtree_sync_info( db,