From 69205999d718333af04a53795bba6359bca37bdc Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Wed, 30 Oct 2024 20:47:21 +0100 Subject: [PATCH 1/3] remove unnecessary check --- .../multivm/src/versions/vm_latest/tracers/result_tracer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs index 6ba00f4a099..adb427f027c 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs @@ -306,9 +306,9 @@ impl ResultTracer { }, }); } else { - self.result = Some(self.result.clone().unwrap_or(Result::Success { + self.result = Some(Result::Success { return_data: vec![], - })); + }); } } } From ac6851167e3f6c3d3e1564970f579968f0d78935 Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Wed, 30 Oct 2024 20:58:51 +0100 Subject: [PATCH 2/3] hacky fix --- .../src/versions/vm_latest/tracers/default_tracers.rs | 5 ++++- .../multivm/src/versions/vm_latest/tracers/result_tracer.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs index 2ae5e81a328..ac15c7f384b 100755 --- a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs @@ -228,7 +228,10 @@ impl Tracer for DefaultExecutionTracer { ); match hook { - VmHook::TxHasEnded => self.tx_has_been_processed = true, + VmHook::TxHasEnded if matches!(self.execution_mode, VmExecutionMode::OneTx) => { + self.result_tracer.tx_finished_in_one_tx_mode = true; + self.tx_has_been_processed = true + } VmHook::NoValidationEntered => self.in_account_validation = false, VmHook::AccountValidationEntered => self.in_account_validation = true, VmHook::FinalBatchInfo => self.final_batch_info_requested = true, diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs index adb427f027c..0687c8393c6 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/result_tracer.rs @@ -104,6 +104,8 @@ pub(crate) struct ResultTracer { far_call_tracker: FarCallTracker, subversion: MultiVMSubversion, + pub(crate) tx_finished_in_one_tx_mode: bool, + _phantom: PhantomData, } @@ -115,6 +117,7 @@ impl ResultTracer { execution_mode, far_call_tracker: Default::default(), subversion, + tx_finished_in_one_tx_mode: false, _phantom: PhantomData, } } @@ -297,7 +300,7 @@ impl ResultTracer { let has_failed = tx_has_failed(state, bootloader_state.current_tx() as u32, self.subversion); - if has_failed { + if self.tx_finished_in_one_tx_mode && has_failed { self.result = Some(Result::Error { error_reason: VmRevertReason::General { msg: "Transaction reverted with empty reason. Possibly out of gas" From 42c02202d1879d5821eb40d37b41b346f539aab2 Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Thu, 31 Oct 2024 13:05:25 +0100 Subject: [PATCH 3/3] missing semicolon --- .../multivm/src/versions/vm_latest/tracers/default_tracers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs index ac15c7f384b..7156acce152 100755 --- a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs @@ -230,7 +230,7 @@ impl Tracer for DefaultExecutionTracer { match hook { VmHook::TxHasEnded if matches!(self.execution_mode, VmExecutionMode::OneTx) => { self.result_tracer.tx_finished_in_one_tx_mode = true; - self.tx_has_been_processed = true + self.tx_has_been_processed = true; } VmHook::NoValidationEntered => self.in_account_validation = false, VmHook::AccountValidationEntered => self.in_account_validation = true,