diff --git a/client/service/src/client/call_executor.rs b/client/service/src/client/call_executor.rs index a93f094c77802..ce72647fbb510 100644 --- a/client/service/src/client/call_executor.rs +++ b/client/service/src/client/call_executor.rs @@ -340,6 +340,7 @@ where let runtime_code = self.check_override(runtime_code, at)?; let mut overlay = overlay; + overlay.set_collect_extrinsics(true); sp_state_machine::prove_execution_on_trie_backend( &trie_backend, &mut overlay, diff --git a/frame/support/src/storage/mod.rs b/frame/support/src/storage/mod.rs index e50577697a60a..fe068a283d21d 100644 --- a/frame/support/src/storage/mod.rs +++ b/frame/support/src/storage/mod.rs @@ -1409,6 +1409,14 @@ pub fn storage_prefix(pallet_name: &[u8], storage_name: &[u8]) -> [u8; 32] { final_key[..16].copy_from_slice(&pallet_hash); final_key[16..].copy_from_slice(&storage_hash); + #[cfg(feature = "std")] + println!( + "pallet_name: {}, storage_name: {}, final_key: {:?}", + String::from_utf8_lossy(pallet_name), + String::from_utf8_lossy(storage_name), + final_key + ); + final_key } diff --git a/primitives/state-machine/src/ext.rs b/primitives/state-machine/src/ext.rs index 9009590e99171..34d1826e2119c 100644 --- a/primitives/state-machine/src/ext.rs +++ b/primitives/state-machine/src/ext.rs @@ -181,8 +181,8 @@ where } fn storage(&self, key: &[u8]) -> Option { - #[cfg(feature = "std")] - println!("[Ext::storage] key: {:?}, {:?}", HexDisplay::from(&key), key); + // #[cfg(feature = "std")] + // println!("[Ext::storage] key: {:?}, {:?}", HexDisplay::from(&key), key); let _guard = guard(); /* @@ -198,10 +198,10 @@ where * */ let result = self.overlay.storage(key).map(|x| x.map(|x| x.to_vec())).unwrap_or_else(|| { - #[cfg(feature = "std")] - println!( - "[Ext::storage] overlay does not have this storage, retrieving from backend..." - ); + // #[cfg(feature = "std")] + // println!( + // "[Ext::storage] overlay does not have this storage, retrieving from backend..." + // ); self.backend.storage(key).expect(EXT_NOT_ALLOWED_TO_FAIL) }); diff --git a/primitives/state-machine/src/lib.rs b/primitives/state-machine/src/lib.rs index 4230bde753525..f36a6fa2aa9e1 100644 --- a/primitives/state-machine/src/lib.rs +++ b/primitives/state-machine/src/lib.rs @@ -635,6 +635,9 @@ mod execution { always_wasm(), None, )?; + #[cfg(feature = "std")] + println!( + "========================= after execute_using_consensus_failure_handler: overlay: {:#?}", sm.overlay); let proof = sm.backend.extract_proof(); Ok((result.into_encoded(), proof)) } diff --git a/primitives/state-machine/src/overlayed_changes/mod.rs b/primitives/state-machine/src/overlayed_changes/mod.rs index ca40ec5e27937..9ca0f05247ff4 100644 --- a/primitives/state-machine/src/overlayed_changes/mod.rs +++ b/primitives/state-machine/src/overlayed_changes/mod.rs @@ -228,6 +228,8 @@ impl OverlayedChanges { pub fn storage(&self, key: &[u8]) -> Option> { #[cfg(feature = "std")] println!("[OverlayedChanges::storage] top: {:?}", self.top); + #[cfg(feature = "std")] + println!("[OverlayedChanges::storage] key: {:?}", sp_core::hexdisplay::HexDisplay::from(&key)); self.top.get(key).map(|x| { let value = x.value(); let size_read = value.map(|x| x.len() as u64).unwrap_or(0); diff --git a/primitives/state-machine/src/proving_backend.rs b/primitives/state-machine/src/proving_backend.rs index 32c2b677d06f1..1159cd36e534a 100644 --- a/primitives/state-machine/src/proving_backend.rs +++ b/primitives/state-machine/src/proving_backend.rs @@ -136,7 +136,7 @@ impl Debug for ProofRecorder { impl ProofRecorder { /// Record the given `key` => `val` combination. pub fn record(&self, key: Hash, val: Option) { - println!("[record] key: {:?}, val: {:?}", key, val); + // println!("[record] key: {:?}, val: {:?}", key, val); let mut inner = self.inner.write(); let encoded_size = if let Entry::Vacant(entry) = inner.records.entry(key) { let encoded_size = val.as_ref().map(Encode::encoded_size).unwrap_or(0); @@ -152,7 +152,7 @@ impl ProofRecorder { /// Returns the value at the given `key`. pub fn get(&self, key: &Hash) -> Option> { - println!("[get] key: {:?}", key); + // println!("[get] key: {:?}", key); self.inner.read().records.get(key).cloned() } @@ -245,17 +245,17 @@ impl<'a, S: 'a + TrieBackendStorage, H: 'a + Hasher> TrieBackendStorage type Overlay = S::Overlay; fn get(&self, key: &H::Out, prefix: Prefix) -> Result, String> { - #[cfg(feature = "std")] - println!("[ProofRecorderBackend::get] key: {:?}", key); + // #[cfg(feature = "std")] + // println!("[ProofRecorderBackend::get] key: {:?}", key); if let Some(v) = self.proof_recorder.get(key) { return Ok(v); } - #[cfg(feature = "std")] - println!( - "[ProofRecorderBackend::get] key not found in proof_recorder, retrieving from the backend: {:?}", - key - ); + // #[cfg(feature = "std")] + // println!( + // "[ProofRecorderBackend::get] key not found in proof_recorder, retrieving from the backend: {:?}", + // key + // ); let backend_value = self.backend.get(key, prefix)?; self.proof_recorder.record(key.clone(), backend_value.clone()); Ok(backend_value)