From 5382ce5f928b706d1ae530cf238cfa3f1da1d7b8 Mon Sep 17 00:00:00 2001 From: Pepper Lebeck-Jobe Date: Thu, 18 Jul 2024 08:50:42 +0200 Subject: [PATCH] Print backtraces when out of gas or ink This makes is clearer at exactly what point in the code the transaction execution ran out of gas or ink. --- arbitrator/prover/src/programs/meter.rs | 2 +- arbitrator/stylus/tests/multicall/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arbitrator/prover/src/programs/meter.rs b/arbitrator/prover/src/programs/meter.rs index 4abcbcad40..61c4f132d8 100644 --- a/arbitrator/prover/src/programs/meter.rs +++ b/arbitrator/prover/src/programs/meter.rs @@ -247,7 +247,7 @@ pub trait MeteredMachine { fn out_of_ink(&mut self) -> Result { println!( - "Got out of ink in rust at:\n{}", + "Got out of ink in rust at:\n{:?}", std::backtrace::Backtrace::force_capture() ); self.set_meter(MachineMeter::Exhausted); diff --git a/arbitrator/stylus/tests/multicall/Cargo.toml b/arbitrator/stylus/tests/multicall/Cargo.toml index ec84ace7b4..a053c89f9d 100644 --- a/arbitrator/stylus/tests/multicall/Cargo.toml +++ b/arbitrator/stylus/tests/multicall/Cargo.toml @@ -13,7 +13,7 @@ wee_alloc = "0.4.5" [profile.release] codegen-units = 1 -strip = true +debug = true lto = true panic = "abort"