Skip to content

Commit

Permalink
propagate speculative error in prologue and epilogue (#14512)
Browse files Browse the repository at this point in the history
(cherry picked from commit b2e101a)
  • Loading branch information
igor-aptos authored and zekun000 committed Sep 5, 2024
1 parent 63deb5c commit 609eba6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions aptos-move/aptos-vm/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ pub fn convert_prologue_error(
};
VMStatus::error(new_major_status, None)
},
// Speculative errors are returned for caller to handle.
e @ VMStatus::Error {
status_code:
StatusCode::SPECULATIVE_EXECUTION_ABORT_ERROR
| StatusCode::DELAYED_MATERIALIZATION_CODE_INVARIANT_ERROR,
..
} => e,
status @ VMStatus::ExecutionFailure { .. } | status @ VMStatus::Error { .. } => {
speculative_error!(
log_context,
Expand Down Expand Up @@ -196,6 +203,13 @@ pub fn convert_epilogue_error(
)
},
},
// Speculative errors are returned for caller to handle.
e @ VMStatus::Error {
status_code:
StatusCode::SPECULATIVE_EXECUTION_ABORT_ERROR
| StatusCode::DELAYED_MATERIALIZATION_CODE_INVARIANT_ERROR,
..
} => e,
status => {
let err_msg = format!("[aptos_vm] Unexpected success epilogue error: {:?}", status);
speculative_error!(log_context, err_msg.clone());
Expand Down

0 comments on commit 609eba6

Please sign in to comment.