diff --git a/light-base/src/runtime_service.rs b/light-base/src/runtime_service.rs index 272d48d21d..72d5b3192d 100644 --- a/light-base/src/runtime_service.rs +++ b/light-base/src/runtime_service.rs @@ -3063,6 +3063,18 @@ async fn runtime_call_single_attempt( SingleRuntimeCallTiming, Result, SingleRuntimeCallAttemptError>, ) { + if function_name == "DryRunApi_dry_run_call" { + log!(platform, Info, "debug", "call proof", ?call_proof); + log!(platform, Info, "debug", "params", ?parameters_vectored); + log!( + platform, + Info, + "debug", + "block_state_trie_root_hash", + ?block_state_trie_root_hash + ); + } + // Try to decode the proof. Succeed just means that the proof has the correct // encoding, and doesn't guarantee that the proof has all the necessary // entries. @@ -3189,23 +3201,37 @@ async fn runtime_call_single_attempt( key.extend_from_slice(child_trie.as_ref()); match call_proof.storage_value(block_state_trie_root_hash, &key) { Err(_) => { + log!( + platform, + Info, + "debug", + "trie root storage value failed", + ?key + ); return ( timing, Err(SingleRuntimeCallAttemptError::Inaccessible( RuntimeCallInaccessibleError::MissingProofEntry, )), - ) + ); } Ok(None) => None, Ok(Some((value, _))) => match <&[u8; 32]>::try_from(value) { Ok(hash) => Some(hash), Err(_) => { + log!( + platform, + Info, + "debug", + "trie root storage value failed bad hash", + ?key + ); return ( timing, Err(SingleRuntimeCallAttemptError::Inaccessible( RuntimeCallInaccessibleError::MissingProofEntry, )), - ) + ); } }, } @@ -3221,6 +3247,7 @@ async fn runtime_call_single_attempt( Ok(None) }; let Ok(storage_value) = storage_value else { + log!(platform, Info, "debug", "storage value failed", ?trie_root, key = ?get.key().as_ref()); return ( timing, Err(SingleRuntimeCallAttemptError::Inaccessible( @@ -3242,6 +3269,7 @@ async fn runtime_call_single_attempt( Ok(None) }; let Ok(merkle_value) = merkle_value else { + log!(platform, Info, "debug", "cdmv failed", ?trie_root, key = ?mv.key().collect::>()); return ( timing, Err(SingleRuntimeCallAttemptError::Inaccessible( @@ -3269,6 +3297,7 @@ async fn runtime_call_single_attempt( Ok(None) }; let Ok(next_key) = next_key else { + log!(platform, Info, "debug", "next key failed", ?trie_root, key = ?nk.key().collect::>(), or_equal = ?nk.or_equal(), prefix = ?nk.prefix().collect::>(), branches = ?nk.branch_nodes()); return ( timing, Err(SingleRuntimeCallAttemptError::Inaccessible(