From 2280899300c59e4d45df6fdd015b5aad4781fc77 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Thu, 25 Jul 2024 09:25:34 +0200 Subject: [PATCH] fix evm tracing for older runtimes (#1307) --- vendor/rpc/debug/src/lib.rs | 7 ++++--- vendor/rpc/trace/src/lib.rs | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/vendor/rpc/debug/src/lib.rs b/vendor/rpc/debug/src/lib.rs index 65fb2c1d00..7bd5777522 100644 --- a/vendor/rpc/debug/src/lib.rs +++ b/vendor/rpc/debug/src/lib.rs @@ -381,7 +381,8 @@ where } else { // Old "trace_block" api did not initialize block before applying transactions, // so we need to do it here before calling "trace_block". - api.initialize_block(parent_block_hash, &header) + #[allow(deprecated)] + api.initialize_block_before_version_5(parent_block_hash, &header) .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?; #[allow(deprecated)] @@ -529,13 +530,13 @@ where } else { // Old "trace_transaction" api did not initialize block before applying transactions, // so we need to do it here before calling "trace_transaction". - api.initialize_block(parent_block_hash, &header) + #[allow(deprecated)] + api.initialize_block_before_version_5(parent_block_hash, &header) .map_err(|e| { internal_err(format!("Runtime api access error: {:?}", e)) })?; if trace_api_version == 4 { - // Pre pallet-message-queue #[allow(deprecated)] api.trace_transaction_before_version_5( parent_block_hash, diff --git a/vendor/rpc/trace/src/lib.rs b/vendor/rpc/trace/src/lib.rs index d15224d7d6..d44dd569c3 100644 --- a/vendor/rpc/trace/src/lib.rs +++ b/vendor/rpc/trace/src/lib.rs @@ -859,7 +859,7 @@ where // Trace the block. let f = || -> Result<_, String> { let result = if trace_api_version >= 5 { - // The block is initialized inside "trace_transaction" + // The block is initialized inside "trace_block" api.trace_block( substrate_parent_hash, extrinsics, @@ -869,7 +869,8 @@ where } else { // Old "trace_block" api did not initialize block before applying transactions, // so we need to do it here before calling "trace_block". - api.initialize_block(substrate_parent_hash, &block_header) + #[allow(deprecated)] + api.initialize_block_before_version_5(substrate_parent_hash, &block_header) .map_err(|e| format!("Runtime api access error: {:?}", e))?; #[allow(deprecated)]