diff --git a/crates/phactory/src/contracts/pink.rs b/crates/phactory/src/contracts/pink.rs index 6ab358580b..1f9cd320f2 100644 --- a/crates/phactory/src/contracts/pink.rs +++ b/crates/phactory/src/contracts/pink.rs @@ -391,7 +391,7 @@ impl OCalls for RuntimeHandleMut<'_> { if !context::get().mode.is_transaction() { return; } - warn!("commit state root: {:?}", root); + info!("commit state root: {:?}", root); self.cluster.storage.commit(root, changes); } diff --git a/crates/phala-trie-storage/src/kvdb/database.rs b/crates/phala-trie-storage/src/kvdb/database.rs index ea1606f1b7..2aba0fbb09 100644 --- a/crates/phala-trie-storage/src/kvdb/database.rs +++ b/crates/phala-trie-storage/src/kvdb/database.rs @@ -128,6 +128,7 @@ pub(crate) fn with_cache_dir(cache_dir: &str, f: impl FnOnce() -> T) -> T { pub(crate) fn create_db() -> (TransactionDB, usize) { let test_path = test_cached_path::with(|path| path.clone()); + // The PRUNTIME_TRIE_CACHE_PATH would be hardcoded in the manifest when running in gramine. let cache_path = &test_path .or_else(|| std::env::var("PRUNTIME_TRIE_CACHE_PATH").ok()) .unwrap_or_else(|| "data/protected_files/caches".to_string()); diff --git a/crates/phala-trie-storage/src/lib.rs b/crates/phala-trie-storage/src/lib.rs index e806899770..b4e6d8fed2 100644 --- a/crates/phala-trie-storage/src/lib.rs +++ b/crates/phala-trie-storage/src/lib.rs @@ -173,7 +173,9 @@ where /// Apply storage changes calculated from `calc_root_if_changes`. pub fn apply_changes(&mut self, root: H::Out, transaction: MemoryDB) { - let mut storage = core::mem::take(self).0.into_storage(); + let mut storage = core::mem::replace(self, Self::default_memdb()) + .0 + .into_storage(); storage.consolidate_mdb(transaction); let _ = core::mem::replace(&mut self.0, TrieBackendBuilder::new(storage, root).build()); }