From 509238c4135676078a7146257bd0a95725879635 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 1 Jul 2023 21:36:29 +0200 Subject: [PATCH] extract deep call --- crates/revm/revm-inspectors/src/tracing/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/revm/revm-inspectors/src/tracing/mod.rs b/crates/revm/revm-inspectors/src/tracing/mod.rs index 5e5296f39b85..0dfee063a492 100644 --- a/crates/revm/revm-inspectors/src/tracing/mod.rs +++ b/crates/revm/revm-inspectors/src/tracing/mod.rs @@ -85,6 +85,12 @@ impl TracingInspector { GethTraceBuilder::new(self.traces.arena, self.config) } + /// Returns true if we're no longer in the context of the root call. + fn is_deep(&self) -> bool { + // the root call will always be the first entry in the trace stack + !self.trace_stack.is_empty() + } + /// Returns true if this a call to a precompile contract. /// /// Returns true if the `to` address is a precompile contract and the value is zero. @@ -97,7 +103,7 @@ impl TracingInspector { ) -> bool { if data.precompiles.contains(to) { // only if this is _not_ the root call - return !self.trace_stack.is_empty() && value == U256::ZERO + return self.is_deep() && value == U256::ZERO } false }