Skip to content

Commit

Permalink
update TOO_MANY_DELAYED_FIELDS error code (#12603)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-aptos committed Mar 20, 2024
1 parent 907a74f commit 4cecc57
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions third_party/move/move-core/types/src/vm_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ impl VMStatus {
status_code:
StatusCode::EXECUTION_LIMIT_REACHED
| StatusCode::IO_LIMIT_REACHED
| StatusCode::STORAGE_LIMIT_REACHED,
| StatusCode::STORAGE_LIMIT_REACHED
| StatusCode::TOO_MANY_DELAYED_FIELDS,
..
}
| VMStatus::Error {
status_code:
StatusCode::EXECUTION_LIMIT_REACHED
| StatusCode::IO_LIMIT_REACHED
| StatusCode::STORAGE_LIMIT_REACHED,
| StatusCode::STORAGE_LIMIT_REACHED
| StatusCode::TOO_MANY_DELAYED_FIELDS,
..
} => Ok(KeptVMStatus::MiscellaneousError),

Expand Down Expand Up @@ -742,16 +744,11 @@ pub enum StatusCode {
// be re-executed.
// Should never be committed on chain
SPECULATIVE_EXECUTION_ABORT_ERROR = 2024,
ACCESS_CONTROL_INVARIANT_VIOLATION = 2025,
// We tried to create resource with more than currently allowed number of DelayedFields
TOO_MANY_DELAYED_FIELDS = 2026,

// Reserved error code for future use
RESERVED_INVARIANT_VIOLATION_ERROR_1 = 2027,
RESERVED_INVARIANT_VIOLATION_ERROR_2 = 2028,
RESERVED_INVARIANT_VIOLATION_ERROR_3 = 2029,
RESERVED_INVARIANT_VIOLATION_ERROR_4 = 2030,
RESERVED_INVARIANT_VIOLATION_ERROR_5 = 2031,
RESERVED_INVARIANT_VIOLATION_ERROR_3 = 2025,
RESERVED_INVARIANT_VIOLATION_ERROR_4 = 2026,
RESERVED_INVARIANT_VIOLATION_ERROR_5 = 2027,

// Errors that can arise from binary decoding (deserialization)
// Deserialization Errors: 3000-3999
Expand Down Expand Up @@ -811,11 +808,19 @@ pub enum StatusCode {
IO_LIMIT_REACHED = 4031,
STORAGE_LIMIT_REACHED = 4032,
TYPE_TAG_LIMIT_EXCEEDED = 4033,
// Reserved error code for future use
RESERVED_RUNTIME_ERROR_2 = 4034,
RESERVED_RUNTIME_ERROR_3 = 4035,
RESERVED_RUNTIME_ERROR_4 = 4036,
RESERVED_RUNTIME_ERROR_5 = 4037,
// A resource was accessed in a way which is not permitted by the active access control
// specifier.
ACCESS_DENIED = 4034,
// The stack of access control specifier has overflowed.
ACCESS_STACK_LIMIT_EXCEEDED = 4035,
// We tried to create resource with more than currently allowed number of DelayedFields
TOO_MANY_DELAYED_FIELDS = 4036,

// Reserved error code for future use. Always keep this buffer of well-defined new codes.
RESERVED_RUNTIME_ERROR_1 = 4037,
RESERVED_RUNTIME_ERROR_2 = 4038,
RESERVED_RUNTIME_ERROR_3 = 4039,
RESERVED_RUNTIME_ERROR_4 = 4040,

// A reserved status to represent an unknown vm status.
// this is std::u64::MAX, but we can't pattern match on that, so put the hardcoded value in
Expand Down

0 comments on commit 4cecc57

Please sign in to comment.