From 547911ac19c68b750f7920a6cd613fa691328ce7 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 17 Jun 2023 16:07:05 +0200 Subject: [PATCH] fix: set call trace gas limit with call inputs gas limit (#3214) --- crates/revm/revm-inspectors/src/tracing/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/revm/revm-inspectors/src/tracing/mod.rs b/crates/revm/revm-inspectors/src/tracing/mod.rs index c9b727ea1..ccbc26563 100644 --- a/crates/revm/revm-inspectors/src/tracing/mod.rs +++ b/crates/revm/revm-inspectors/src/tracing/mod.rs @@ -130,6 +130,7 @@ impl TracingInspector { value: U256, kind: CallKind, caller: Address, + gas_limit: u64, maybe_precompile: Option, ) { // This will only be true if the inspector is configured to exclude precompiles and the call @@ -154,6 +155,7 @@ impl TracingInspector { caller, last_call_return_value: self.last_call_return_data.clone(), maybe_precompile, + gas_limit, ..Default::default() }, )); @@ -178,7 +180,6 @@ impl TracingInspector { let trace = &mut self.traces.arena[trace_idx].trace; trace.gas_used = gas.spend(); - trace.gas_limit = gas.limit(); trace.status = status; trace.success = matches!(status, return_ok!()); trace.output = output.clone(); @@ -383,6 +384,7 @@ where value, inputs.context.scheme.into(), from, + inputs.gas_limit, maybe_precompile, ); @@ -421,6 +423,7 @@ where inputs.value, inputs.scheme.into(), inputs.caller, + inputs.gas_limit, Some(false), );