Skip to content

Commit

Permalink
Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulksnv committed Dec 1, 2023
1 parent a9cf5de commit 4cd2d72
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions frame/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down Expand Up @@ -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
Expand Down
23 changes: 21 additions & 2 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,17 @@ impl_runtime_apis! {

impl sp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::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() -> <Block as BlockT>::Header {
Expand Down Expand Up @@ -816,7 +826,16 @@ impl_runtime_apis! {
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> (Option<pallet_ethereum::Block>, Option<Vec<TransactionStatus>>) {
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);
Expand Down

0 comments on commit 4cd2d72

Please sign in to comment.