diff --git a/Cargo.lock b/Cargo.lock index 6dd95228f..c07d36eb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1723,9 +1723,9 @@ dependencies = [ [[package]] name = "ethereum" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" +checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" dependencies = [ "bytes", "ethereum-types", @@ -1736,7 +1736,7 @@ dependencies = [ "scale-info", "serde", "sha3", - "triehash", + "trie-root", ] [[package]] @@ -1757,8 +1757,8 @@ dependencies = [ [[package]] name = "evm" -version = "0.39.1" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +version = "0.42.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.42.0-aurora#58f7b84e8c7e5decacb1a85baa8bbf0042c56666" dependencies = [ "auto_impl", "environmental", @@ -1777,8 +1777,8 @@ dependencies = [ [[package]] name = "evm-core" -version = "0.39.1" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +version = "0.42.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.42.0-aurora#58f7b84e8c7e5decacb1a85baa8bbf0042c56666" dependencies = [ "parity-scale-codec", "primitive-types 0.12.2", @@ -1788,8 +1788,8 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.39.1" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +version = "0.42.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.42.0-aurora#58f7b84e8c7e5decacb1a85baa8bbf0042c56666" dependencies = [ "environmental", "evm-core", @@ -1799,8 +1799,8 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.39.1" -source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +version = "0.42.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.42.0-aurora#58f7b84e8c7e5decacb1a85baa8bbf0042c56666" dependencies = [ "auto_impl", "environmental", @@ -2192,9 +2192,9 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" [[package]] name = "hash256-std-hasher" @@ -4014,16 +4014,6 @@ dependencies = [ "toml", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "2.0.0" @@ -4630,9 +4620,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -4643,11 +4633,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -5551,17 +5541,6 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.3", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.20.7" @@ -5778,13 +5757,12 @@ dependencies = [ ] [[package]] -name = "triehash" -version = "0.8.4" +name = "trie-root" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ "hash-db", - "rlp", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fca0f0c85..e133ad055 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.39.1", default-features = false } -evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.39.1", default-features = false, features = ["std"] } -evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.39.1", default-features = false, features = ["std", "tracing"] } -evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.39.1", default-features = false, features = ["std", "tracing"] } +evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.42.0-aurora", default-features = false } +evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.42.0-aurora", default-features = false, features = ["std"] } +evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.42.0-aurora", default-features = false, features = ["std", "tracing"] } +evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.42.0-aurora", default-features = false, features = ["std", "tracing"] } fixed-hash = { version = "0.8", default-features = false } function_name = "0.3" git2 = "0.18" diff --git a/engine-tests/src/tests/repro.rs b/engine-tests/src/tests/repro.rs index ef3fffc5e..5a04e2371 100644 --- a/engine-tests/src/tests/repro.rs +++ b/engine-tests/src/tests/repro.rs @@ -26,7 +26,7 @@ fn repro_GdASJ3KESs() { block_timestamp: 1_645_717_564_644_206_730, input_path: "src/tests/res/input_GdASJ3KESs.hex", evm_gas_used: 706_713, - near_gas_used: 116, + near_gas_used: 117, }); } @@ -51,7 +51,7 @@ fn repro_8ru7VEA() { block_timestamp: 1_648_829_935_343_349_589, input_path: "src/tests/res/input_8ru7VEA.hex", evm_gas_used: 1_732_181, - near_gas_used: 210, + near_gas_used: 211, }); } @@ -88,7 +88,7 @@ fn repro_5bEgfRQ() { block_timestamp: 1_651_073_772_931_594_646, input_path: "src/tests/res/input_5bEgfRQ.hex", evm_gas_used: 6_414_105, - near_gas_used: 656, + near_gas_used: 655, }); } @@ -106,7 +106,7 @@ fn repro_D98vwmi() { block_timestamp: 1_651_753_443_421_003_245, input_path: "src/tests/res/input_D98vwmi.hex", evm_gas_used: 1_035_348, - near_gas_used: 172, + near_gas_used: 173, }); } diff --git a/engine-tests/src/tests/sanity.rs b/engine-tests/src/tests/sanity.rs index 7f8f2149e..b500f5ff4 100644 --- a/engine-tests/src/tests/sanity.rs +++ b/engine-tests/src/tests/sanity.rs @@ -180,10 +180,8 @@ fn test_total_supply_accounting() { }) .unwrap(); #[cfg(not(feature = "ext-connector"))] - assert_eq!( - get_total_supply(&mut runner), - INITIAL_BALANCE - TRANSFER_AMOUNT - ); + // For CANCUN hard fork `total_supply` can't change + assert_eq!(get_total_supply(&mut runner), INITIAL_BALANCE); } #[test] diff --git a/engine-tests/src/tests/self_destruct_state.rs b/engine-tests/src/tests/self_destruct_state.rs index 480f51f62..df2972fc3 100644 --- a/engine-tests/src/tests/self_destruct_state.rs +++ b/engine-tests/src/tests/self_destruct_state.rs @@ -5,6 +5,8 @@ use crate::utils::solidity::self_destruct::{ /// Check that account state should be properly removed after calling selfdestruct #[test] +// For CANCUN hard fork SELFDESCTRUCT disabled +#[ignore] fn test_self_destruct_reset_state() { let mut signer = utils::Signer::random(); let mut runner = utils::deploy_runner(); @@ -29,7 +31,7 @@ fn test_self_destruct_reset_state() { assert_eq!(counter_value, Some(1)); sd.finish(&mut runner); let counter_value = sd.counter(&mut runner, &mut signer); - assert!(counter_value.is_none()); + assert!(counter_value.is_some()); let sd_contract_addr1 = sd_factory.deploy(&mut runner, &mut signer); assert_eq!(sd_contract_addr, sd_contract_addr1); diff --git a/engine-tests/src/utils/solidity/mod.rs b/engine-tests/src/utils/solidity/mod.rs index ebcd0ee2d..11d5d3586 100644 --- a/engine-tests/src/utils/solidity/mod.rs +++ b/engine-tests/src/utils/solidity/mod.rs @@ -191,7 +191,7 @@ where &source_mount_arg, "-v", &output_mount_arg, - "ethereum/solc:0.8.24", // TODO: 0.8.25 introduces support of the Dencun hard fork. + "ethereum/solc:stable", "--allow-paths", "/contracts/", "-o", diff --git a/engine-transactions/src/eip_4844.rs b/engine-transactions/src/eip_4844.rs new file mode 100644 index 000000000..687f82a3e --- /dev/null +++ b/engine-transactions/src/eip_4844.rs @@ -0,0 +1,3 @@ +/// Type indicator (per EIP-4844) for shard blob transactions +/// [EIP-4844 Specification](https://eips.ethereum.org/EIPS/eip-4844#specification) +pub const TYPE_BYTE: u8 = 0x03; diff --git a/engine-transactions/src/lib.rs b/engine-transactions/src/lib.rs index 690b930c1..6ebd93286 100644 --- a/engine-transactions/src/lib.rs +++ b/engine-transactions/src/lib.rs @@ -16,6 +16,7 @@ use rlp::{Decodable, DecoderError, Rlp}; pub mod backwards_compatibility; pub mod eip_1559; pub mod eip_2930; +pub mod eip_4844; pub mod legacy; /// Typed Transaction Envelope (see `https://eips.ethereum.org/EIPS/eip-2718`) @@ -40,6 +41,8 @@ impl TryFrom<&[u8]> for EthTransactionKind { Ok(Self::Eip1559(eip_1559::SignedTransaction1559::decode( &Rlp::new(&bytes[1..]), )?)) + } else if bytes[0] == eip_4844::TYPE_BYTE { + Err(Error::UnsupportedTransactionEip4844) } else if bytes[0] <= 0x7f { Err(Error::UnknownTransactionType) } else if bytes[0] == 0xff { @@ -212,6 +215,7 @@ pub enum Error { IntegerConversion, #[cfg_attr(feature = "serde", serde(serialize_with = "decoder_err_to_str"))] RlpDecodeError(DecoderError), + UnsupportedTransactionEip4844, } #[cfg(feature = "serde")] @@ -231,6 +235,7 @@ impl Error { Self::GasOverflow => "ERR_GAS_OVERFLOW", Self::IntegerConversion => "ERR_INTEGER_CONVERSION", Self::RlpDecodeError(_) => "ERR_TX_RLP_DECODE", + Self::UnsupportedTransactionEip4844 => "ERR_UNSUPPORTED_TX_EIP4844", } } } diff --git a/engine/src/engine.rs b/engine/src/engine.rs index 52526f7a1..3f4409cf8 100644 --- a/engine/src/engine.rs +++ b/engine/src/engine.rs @@ -398,7 +398,7 @@ pub struct Engine<'env, I: IO, E: Env, M = AuroraModExp> { modexp_algorithm: PhantomData, } -pub(crate) const CONFIG: &Config = &Config::shanghai(); +pub(crate) const CONFIG: &Config = &Config::cancun(); impl<'env, I: IO + Copy, E: Env, M: ModExpAlgorithm> Engine<'env, I, E, M> { pub fn new( @@ -1923,6 +1923,14 @@ impl<'env, I: IO + Copy, E: Env, M: ModExpAlgorithm> Backend for Engine<'env, I, fn original_storage(&self, address: H160, index: H256) -> Option { Some(self.storage(address, index)) } + + fn get_blob_hash(&self, _index: usize) -> Option { + None + } + + fn blob_gas_price(&self) -> Option { + None + } } impl<'env, J: IO + Copy, E: Env, M: ModExpAlgorithm> ApplyBackend for Engine<'env, J, E, M> {