Skip to content

Commit

Permalink
Chore: Update SputnikVM to v0.45.4-aurora (#947)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleksandr Anyshchenko <oleksandr.anyshchenko@aurora.dev>
  • Loading branch information
mrLSD and aleksuss authored Sep 19, 2024
1 parent 5d3c217 commit 2ae61d7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ byte-slice-cast = { version = "1", default-features = false }
criterion = "0.5"
digest = "0.10"
ethabi = { version = "18", default-features = false }
evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.0-aurora", default-features = false }
evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.0-aurora", default-features = false, features = ["std"] }
evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.0-aurora", default-features = false, features = ["std", "tracing"] }
evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.0-aurora", default-features = false, features = ["std", "tracing"] }
evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.4-aurora", default-features = false }
evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.4-aurora", default-features = false, features = ["std"] }
evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.4-aurora", default-features = false, features = ["std", "tracing"] }
evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.45.4-aurora", default-features = false, features = ["std", "tracing"] }
fixed-hash = { version = "0.8", default-features = false }
function_name = "0.3"
git2 = "0.19"
Expand Down
Binary file modified engine-tests/src/tests/res/transaction_status.borsh
Binary file not shown.
2 changes: 1 addition & 1 deletion engine-tests/src/tests/xcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ pub mod workspace {
.unwrap();
anyhow::bail!("TX has been reverted with message: {revert_message}");
}
_ => anyhow::bail!("Wrong status of the transaction"),
other => anyhow::bail!("Wrong status of the transaction {other:?}"),
}
}

Expand Down
5 changes: 5 additions & 0 deletions engine-types/src/parameters/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ pub enum TransactionStatus {
UsizeOverflow,
/// Other normal errors.
Other(crate::Cow<'static, str>),
/// Contract contains forbidden opcode 0xEF
CreateContractStartingWithEF,
}

impl TransactionStatus {
Expand Down Expand Up @@ -262,6 +264,7 @@ impl AsRef<[u8]> for TransactionStatus {
Self::CreateEmpty => errors::ERR_CREATE_EMPTY,
Self::MaxNonce => errors::ERR_MAX_NONCE,
Self::UsizeOverflow => errors::ERR_USIZE_OVERFLOW,
Self::CreateContractStartingWithEF => errors::ERR_CREATE_CONTRACT_STARTING_WITH_EF,
Self::Other(e) => e.as_bytes(),
}
}
Expand Down Expand Up @@ -435,6 +438,7 @@ pub mod errors {
pub const ERR_CREATE_EMPTY: &[u8] = b"CREATE_EMPTY";
pub const ERR_MAX_NONCE: &[u8] = b"MAX_NONCE";
pub const ERR_USIZE_OVERFLOW: &[u8] = b"USIZE_OVERFLOW";
pub const ERR_CREATE_CONTRACT_STARTING_WITH_EF: &[u8] = b"ERR_CREATE_CONTRACT_STARTING_WITH_EF";

#[derive(Debug)]
pub enum ParseArgsError {
Expand Down Expand Up @@ -611,6 +615,7 @@ mod tests {
TransactionStatus::MaxNonce,
TransactionStatus::UsizeOverflow,
TransactionStatus::Other("error".into()),
TransactionStatus::CreateContractStartingWithEF,
]
}
}
7 changes: 7 additions & 0 deletions engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ impl ExitIntoResult for ExitReason {
Self::Error(ExitError::CreateEmpty) => Ok(TransactionStatus::CreateEmpty),
Self::Error(ExitError::MaxNonce) => Ok(TransactionStatus::MaxNonce),
Self::Error(ExitError::UsizeOverflow) => Ok(TransactionStatus::UsizeOverflow),
Self::Error(ExitError::CreateContractStartingWithEF) => {
Ok(TransactionStatus::CreateContractStartingWithEF)
}
Self::Error(ExitError::Other(msg)) => Ok(TransactionStatus::Other(msg)),
Self::Fatal(e) => Err(e.into()),
}
Expand Down Expand Up @@ -2148,6 +2151,10 @@ fn submit_result_or_err(submit_result: SubmitResult) -> Result<SubmitResult, Eng
ExitError::UsizeOverflow,
submit_result.gas_used,
)),
TransactionStatus::CreateContractStartingWithEF => Err(engine_error(
ExitError::CreateContractStartingWithEF,
submit_result.gas_used,
)),
TransactionStatus::Other(e) => {
Err(engine_error(ExitError::Other(e), submit_result.gas_used))
}
Expand Down

0 comments on commit 2ae61d7

Please sign in to comment.