Skip to content

Commit

Permalink
[aptos-vm] Skip converting storage error (#8674)
Browse files Browse the repository at this point in the history
* [aptos-vm] Skip converting storage error

* fixup! [aptos-vm] Skip converting storage error
  • Loading branch information
runtian-zhou authored and banool committed Jul 7, 2023
1 parent 5e51560 commit c945569
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aptos-move/aptos-vm/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit c945569

Please sign in to comment.