From 4cd2d72c30b8137f94edd92c63a8fdf124c0c567 Mon Sep 17 00:00:00 2001 From: Rahul Subramaniyam Date: Fri, 1 Dec 2023 13:28:26 -0800 Subject: [PATCH] Logs --- Cargo.lock | 1 + frame/evm/src/runner/stack.rs | 8 ++++++++ template/runtime/Cargo.toml | 2 ++ template/runtime/src/lib.rs | 23 +++++++++++++++++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1d722e3cb..ee9fa3041d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3297,6 +3297,7 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "log", "pallet-aura", "pallet-balances", "pallet-base-fee", diff --git a/frame/evm/src/runner/stack.rs b/frame/evm/src/runner/stack.rs index d6a9ecccc4..989e4e3f17 100644 --- a/frame/evm/src/runner/stack.rs +++ b/frame/evm/src/runner/stack.rs @@ -91,6 +91,10 @@ where ) -> (ExitReason, R), R: Default, { + log::debug!( + target: "evm", + "Runner::execute(): in", + ); let (base_fee, weight) = T::FeeCalculator::min_gas_price(); #[cfg(feature = "forbid-evm-reentrancy")] @@ -122,6 +126,10 @@ where #[cfg(feature = "forbid-evm-reentrancy")] let _ = IN_EVM.with(|in_evm| in_evm.take()); + log::debug!( + target: "evm", + "Runner::execute(): out", + ); res } diff --git a/template/runtime/Cargo.toml b/template/runtime/Cargo.toml index 5547dee3b9..e26622aad3 100644 --- a/template/runtime/Cargo.toml +++ b/template/runtime/Cargo.toml @@ -12,6 +12,7 @@ repository = { workspace = true } targets = ["x86_64-unknown-linux-gnu"] [dependencies] +log = { workspace = true } scale-codec = { package = "parity-scale-codec", workspace = true } scale-info = { workspace = true } @@ -66,6 +67,7 @@ default = ["std", "with-rocksdb-weights"] with-rocksdb-weights = [] with-paritydb-weights = [] std = [ + "log/std", "scale-codec/std", "scale-info/std", # Substrate diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index 04b4a613f4..2a9fbdf36a 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -590,7 +590,17 @@ impl_runtime_apis! { impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) + log::debug!( + target: "evm", + "sp_block_builder::BlockBuilder(): in", + ); + let ret = Executive::apply_extrinsic(extrinsic); + log::debug!( + target: "evm", + "sp_block_builder::BlockBuilder(): out = {:?}", + ret + ); + ret } fn finalize_block() -> ::Header { @@ -816,7 +826,16 @@ impl_runtime_apis! { xts: Vec<::Extrinsic>, ) -> (Option, Option>) { for ext in xts.into_iter() { - let _ = Executive::apply_extrinsic(ext); + log::debug!( + target: "evm", + "EthereumRuntimeRPCApi(): in", + ); + let ret = Executive::apply_extrinsic(ext); + log::debug!( + target: "evm", + "EthereumRuntimeRPCApi(): out = {:?}", + ret + ); } Ethereum::on_finalize(System::block_number() + 1);