diff --git a/Cargo.lock b/Cargo.lock index 6961e77d9..21281bf1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1318,8 +1318,8 @@ dependencies = [ [[package]] name = "evm" -version = "0.35.0" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +version = "0.36.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.0-aurora#5468ef7c18899823ff6423a4d8ac3969d551bfd5" dependencies = [ "auto_impl", "environmental", @@ -1338,8 +1338,8 @@ dependencies = [ [[package]] name = "evm-core" -version = "0.35.0" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +version = "0.36.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.0-aurora#5468ef7c18899823ff6423a4d8ac3969d551bfd5" dependencies = [ "parity-scale-codec", "primitive-types 0.11.1", @@ -1349,8 +1349,8 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.35.0" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +version = "0.36.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.0-aurora#5468ef7c18899823ff6423a4d8ac3969d551bfd5" dependencies = [ "environmental", "evm-core", @@ -1360,8 +1360,8 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.35.0" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +version = "0.36.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.0-aurora#5468ef7c18899823ff6423a4d8ac3969d551bfd5" dependencies = [ "auto_impl", "environmental", diff --git a/engine-precompiles/Cargo.toml b/engine-precompiles/Cargo.toml index 226dec51b..688cd1165 100644 --- a/engine-precompiles/Cargo.toml +++ b/engine-precompiles/Cargo.toml @@ -17,7 +17,7 @@ aurora-engine-types = { path = "../engine-types", default-features = false } aurora-engine-sdk = { path = "../engine-sdk", default-features = false } borsh = { version = "0.9.3", default-features = false } bn = { version = "0.5.11", package = "zeropool-bn", default-features = false } -evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false } libsecp256k1 = { version = "0.7.0", default-features = false, features = ["static-context", "hmac"] } num = { version = "0.4.0", default-features = false, features = ["alloc"] } ripemd = { version = "0.1.1", default-features = false } diff --git a/engine-precompiles/src/promise_result.rs b/engine-precompiles/src/promise_result.rs index 1899f66a6..223536c65 100644 --- a/engine-precompiles/src/promise_result.rs +++ b/engine-precompiles/src/promise_result.rs @@ -16,7 +16,7 @@ pub mod costs { use crate::prelude::types::EthGas; /// This cost is always charged for calling this precompile. - pub const PROMISE_RESULT_BASE_COST: EthGas = EthGas::new(125); + pub const PROMISE_RESULT_BASE_COST: EthGas = EthGas::new(105); /// This is the cost per byte of promise result data. pub const PROMISE_RESULT_BYTE_COST: EthGas = EthGas::new(1); } diff --git a/engine-standalone-storage/Cargo.toml b/engine-standalone-storage/Cargo.toml index 3f622e36e..74df0eeed 100644 --- a/engine-standalone-storage/Cargo.toml +++ b/engine-standalone-storage/Cargo.toml @@ -20,7 +20,7 @@ aurora-engine-sdk = { path = "../engine-sdk", default-features = false, features aurora-engine-transactions = { path = "../engine-transactions", default-features = false, features = ["std"] } aurora-engine-precompiles = { path = "../engine-precompiles", default-features = false, features = ["std"] } borsh = { version = "0.9.3" } -evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false } +evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false } hex = "0.4.3" rocksdb = { version = "0.19.0", default-features = false } postgres = "0.19.2" diff --git a/engine-standalone-tracing/Cargo.toml b/engine-standalone-tracing/Cargo.toml index 99aaa2416..f0af9bfe4 100644 --- a/engine-standalone-tracing/Cargo.toml +++ b/engine-standalone-tracing/Cargo.toml @@ -15,10 +15,10 @@ crate-type = ["lib"] [dependencies] aurora-engine-types = { path = "../engine-types", default-features = false, features = ["std"] } -evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std"] } -evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } -evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } -evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std"] } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } hex = { version = "0.4", default-features = false, features = ["std"] } serde = { version = "1", features = ["derive"], optional = true } diff --git a/engine-test-doubles/Cargo.toml b/engine-test-doubles/Cargo.toml index 702e25313..f5a8cce0a 100644 --- a/engine-test-doubles/Cargo.toml +++ b/engine-test-doubles/Cargo.toml @@ -15,8 +15,8 @@ autobenches = false [dependencies] aurora-engine-types = { path = "../engine-types", default-features = false, features = ["std"] } aurora-engine-sdk = { path = "../engine-sdk" } -evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } -evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } -evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } [dev-dependencies] diff --git a/engine-tests/Cargo.toml b/engine-tests/Cargo.toml index 5db67efe6..d7a28a2ba 100644 --- a/engine-tests/Cargo.toml +++ b/engine-tests/Cargo.toml @@ -25,9 +25,9 @@ engine-standalone-storage = { path = "../engine-standalone-storage" } engine-standalone-tracing = { path = "../engine-standalone-tracing" } borsh = { version = "0.9.3", default-features = false } sha3 = { version = "0.10.2", default-features = false } -evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } -evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } -evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false, features = ["std", "tracing"] } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false, features = ["std", "tracing"] } rlp = { version = "0.5.0", default-features = false } base64 = "0.13.0" bstr = "1.0.1" diff --git a/engine-tests/src/tests/repro.rs b/engine-tests/src/tests/repro.rs index eab9301d6..fc4be898f 100644 --- a/engine-tests/src/tests/repro.rs +++ b/engine-tests/src/tests/repro.rs @@ -27,7 +27,7 @@ fn repro_GdASJ3KESs() { block_timestamp: 1645717564644206730, input_path: "src/tests/res/input_GdASJ3KESs.hex", evm_gas_used: 706713, - near_gas_used: 130, + near_gas_used: 131, }); } @@ -52,7 +52,7 @@ fn repro_8ru7VEA() { block_timestamp: 1648829935343349589, input_path: "src/tests/res/input_8ru7VEA.hex", evm_gas_used: 1732181, - near_gas_used: 237, + near_gas_used: 239, }); } @@ -72,7 +72,7 @@ fn repro_FRcorNv() { block_timestamp: 1650960438774745116, input_path: "src/tests/res/input_FRcorNv.hex", evm_gas_used: 1239721, - near_gas_used: 192, + near_gas_used: 194, }); } @@ -89,7 +89,7 @@ fn repro_5bEgfRQ() { block_timestamp: 1651073772931594646, input_path: "src/tests/res/input_5bEgfRQ.hex", evm_gas_used: 6_414_105, - near_gas_used: 698, + near_gas_used: 701, }); } @@ -107,7 +107,7 @@ fn repro_D98vwmi() { block_timestamp: 1651753443421003245, input_path: "src/tests/res/input_D98vwmi.hex", evm_gas_used: 1_035_348, - near_gas_used: 193, + near_gas_used: 195, }); } diff --git a/engine-tests/src/tests/res/CallTooDeep.sol b/engine-tests/src/tests/res/CallTooDeep.sol new file mode 100644 index 000000000..416c08169 --- /dev/null +++ b/engine-tests/src/tests/res/CallTooDeep.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: CC0-1.0 +pragma solidity ^0.8.0; + +interface ICallTooDeep { + function test() external; +} + +contract CallTooDeep { + function test() external { + ICallTooDeep(address(this)).test(); + } +} diff --git a/engine-tests/src/tests/sanity.rs b/engine-tests/src/tests/sanity.rs index c09830dff..eae9b9a00 100644 --- a/engine-tests/src/tests/sanity.rs +++ b/engine-tests/src/tests/sanity.rs @@ -418,6 +418,41 @@ fn test_revert_during_contract_deploy() { assert_eq!(revert_message.as_str(), "Revert message"); } +#[test] +fn test_call_too_deep_error() { + let (mut runner, mut signer, _) = initialize_transfer(); + + let constructor = test_utils::solidity::ContractConstructor::compile_from_source( + "src/tests/res", + "target/solidity_build", + "CallTooDeep.sol", + "CallTooDeep", + ); + + let nonce = signer.use_nonce(); + let contract = runner.deploy_contract( + &signer.secret_key, + |c| c.deploy_without_constructor(nonce.into()), + constructor, + ); + + let result = runner + .submit_with_signer(&mut signer, |nonce| { + contract.call_method_without_args("test", nonce) + }) + .unwrap(); + + // It is counter-intuitive that this returns a `Revert` instead of `CallTooDeep`. + // The reason this is the case is because it is only the last call that triggers the + // `CallTooDeep` exit status, while the one before only sees that the call it made failed + // and therefore reverts. As a result, the `CallTooDeep` exit status is not actually + // visible to users. + match result.status { + TransactionStatus::Revert(_) => (), + other => panic!("Unexpected status {:?}", other), + } +} + #[test] fn test_timestamp() { let (mut runner, mut signer, _) = initialize_transfer(); diff --git a/engine-tests/src/tests/uniswap.rs b/engine-tests/src/tests/uniswap.rs index 777b4b661..c200b416c 100644 --- a/engine-tests/src/tests/uniswap.rs +++ b/engine-tests/src/tests/uniswap.rs @@ -38,7 +38,7 @@ fn test_uniswap_input_multihop() { let (_amount_out, _evm_gas, profile) = context.exact_input(&tokens, INPUT_AMOUNT.into()); - assert_eq!(121, profile.all_gas() / 1_000_000_000_000); + assert_eq!(122, profile.all_gas() / 1_000_000_000_000); } #[test] diff --git a/engine-transactions/Cargo.toml b/engine-transactions/Cargo.toml index 04a71c14c..0f6f02d4d 100644 --- a/engine-transactions/Cargo.toml +++ b/engine-transactions/Cargo.toml @@ -16,7 +16,7 @@ autobenches = false aurora-engine-types = { path = "../engine-types", default-features = false } aurora-engine-sdk = { path = "../engine-sdk", default-features = false } aurora-engine-precompiles = { path = "../engine-precompiles", default-features = false } -evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false } rlp = { version = "0.5.0", default-features = false } serde = { version = "1", features = ["derive"], optional = true } diff --git a/engine/Cargo.toml b/engine/Cargo.toml index a52ee8444..d2772adac 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -25,7 +25,7 @@ bitflags = { version = "1.3", default-features = false } borsh = { version = "0.9.3", default-features = false } byte-slice-cast = { version = "1.0", default-features = false } ethabi = { version = "17.1", default-features = false } -evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.0-aurora", default-features = false } hex = { version = "0.4", default-features = false, features = ["alloc"] } rjson = { git = "https://github.com/aurora-is-near/rjson", rev = "cc3da949", default-features = false, features = ["integer"] } rlp = { version = "0.5.0", default-features = false }