Skip to content

Commit

Permalink
fix: missing exit errors (#815)
Browse files Browse the repository at this point in the history
## Description

The EVM errors haven't been updated to include the latest EVM errors
provided by Sputnik EVM. This simply adds them back in.

## Additional information

This is related to a non-security releated on-chain incident:
https://explorer.near.org/transactions/DwNRjGnZack99i8QtZ877i1MEsSzGMNWY3jpPDPxWvpb
  • Loading branch information
joshuajbouw authored Aug 7, 2023
1 parent 0cfda46 commit ce14890
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ impl EngineErrorKind {
Self::EvmError(ExitError::CallTooDeep) => errors::ERR_CALL_TOO_DEEP,
Self::EvmError(ExitError::CreateCollision) => errors::ERR_CREATE_COLLISION,
Self::EvmError(ExitError::CreateContractLimit) => errors::ERR_CREATE_CONTRACT_LIMIT,
Self::EvmError(ExitError::InvalidCode(_)) => errors::ERR_INVALID_OPCODE,
Self::EvmError(ExitError::OutOfOffset) => errors::ERR_OUT_OF_OFFSET,
Self::EvmError(ExitError::OutOfGas) => errors::ERR_OUT_OF_GAS,
Self::EvmError(ExitError::OutOfFund) => errors::ERR_OUT_OF_FUND,
Self::EvmError(ExitError::CreateEmpty) => errors::ERR_CREATE_EMPTY,
Self::EvmError(ExitError::MaxNonce) => errors::ERR_MAX_NONCE,
Self::EvmFatal(ExitFatal::NotSupported) => errors::ERR_NOT_SUPPORTED,
Self::EvmFatal(ExitFatal::UnhandledInterrupt) => errors::ERR_UNHANDLED_INTERRUPT,
Self::EvmError(ExitError::Other(m)) | Self::EvmFatal(ExitFatal::Other(m)) => {
Expand Down
3 changes: 3 additions & 0 deletions engine/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ pub const ERR_INVALID_RANGE: &[u8; 17] = b"ERR_INVALID_RANGE";
pub const ERR_DESIGNATED_INVALID: &[u8; 22] = b"ERR_DESIGNATED_INVALID";
pub const ERR_CREATE_COLLISION: &[u8; 20] = b"ERR_CREATE_COLLISION";
pub const ERR_CREATE_CONTRACT_LIMIT: &[u8; 25] = b"ERR_CREATE_CONTRACT_LIMIT";
pub const ERR_INVALID_OPCODE: &[u8; 18] = b"ERR_INVALID_OPCODE";
pub const ERR_OUT_OF_FUND: &[u8; 15] = b"ERR_OUT_OF_FUND";
pub const ERR_CREATE_EMPTY: &[u8; 16] = b"ERR_CREATE_EMPTY";
pub const ERR_MAX_NONCE: &[u8; 13] = b"ERR_MAX_NONCE";
pub const ERR_NOT_SUPPORTED: &[u8; 17] = b"ERR_NOT_SUPPORTED";
pub const ERR_UNHANDLED_INTERRUPT: &[u8; 23] = b"ERR_UNHANDLED_INTERRUPT";
pub const ERR_INCORRECT_NONCE: &[u8; 19] = b"ERR_INCORRECT_NONCE";
Expand Down

0 comments on commit ce14890

Please sign in to comment.