From 7f9067ee3db4240640ad1b373a3db1577978a897 Mon Sep 17 00:00:00 2001 From: runtianz Date: Thu, 15 Jun 2023 09:28:28 -0700 Subject: [PATCH] [aptos-vm] Skip converting storage error (#8674) * [aptos-vm] Skip converting storage error * fixup! [aptos-vm] Skip converting storage error --- aptos-move/aptos-vm/src/errors.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aptos-move/aptos-vm/src/errors.rs b/aptos-move/aptos-vm/src/errors.rs index 49dc6796a2329..919748dc28a14 100644 --- a/aptos-move/aptos-vm/src/errors.rs +++ b/aptos-move/aptos-vm/src/errors.rs @@ -132,6 +132,8 @@ pub fn convert_prologue_error( }; VMStatus::Error(new_major_status, None) }, + // Storage error can be a result of speculation failure so throw the error back for caller to handle. + e @ VMStatus::Error(StatusCode::STORAGE_ERROR, _) => e, status @ VMStatus::ExecutionFailure { .. } | status @ VMStatus::Error(..) => { speculative_error!( log_context, @@ -176,7 +178,8 @@ pub fn convert_epilogue_error( VMStatus::Error(StatusCode::UNEXPECTED_ERROR_FROM_KNOWN_MOVE_FUNCTION, None) }, }, - + // Storage error can be a result of speculation failure so throw the error back for caller to handle. + e @ VMStatus::Error(StatusCode::STORAGE_ERROR, _) => e, status => { speculative_error!( log_context, @@ -198,7 +201,8 @@ pub fn expect_only_successful_execution( let status = error.into_vm_status(); Err(match status { VMStatus::Executed => VMStatus::Executed, - + // Storage error can be a result of speculation failure so throw the error back for caller to handle. + e @ VMStatus::Error(StatusCode::STORAGE_ERROR, _) => e, status => { // Only trigger a warning here as some errors could be a result of the speculative parallel execution. // We will report the errors after we obtained the final transaction output in update_counters_for_processed_chunk