Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aptos-vm] Skip converting storage error #8674

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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