diff --git a/Cargo.toml b/Cargo.toml index 51426a6e..a23ef938 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ [workspace.package] authors = ["Aurora Labs "] edition = "2021" -version = "2.1.3" +version = "2.1.4" description = "Aurora Ethereum Virtual Machine implementation written in pure Rust" categories = ["no-std", "compilers", "cryptography::cryptocurrencies"] keywords = ["aurora-evm", "evm", "ethereum", "blockchain", "no_std"] @@ -22,4 +22,4 @@ auto_impl = "1.0" primitive-types = { version = "0.13", default-features = false } rlp = { version = "0.6", default-features = false, features = ["derive"] } sha3 = { version = "0.10", default-features = false } -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1.0", default-features = false, features = ["derive"] } diff --git a/evm/src/executor/stack/executor.rs b/evm/src/executor/stack/executor.rs index b4c3bb15..a469dc00 100644 --- a/evm/src/executor/stack/executor.rs +++ b/evm/src/executor/stack/executor.rs @@ -713,7 +713,8 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> } } - let code_hash = H256::from_slice(Keccak256::digest(&init_code).as_slice()); + let code_hash = + H256::from_slice(<[u8; 32]>::from(Keccak256::digest(&init_code)).as_slice()); let address = self.create_address(CreateScheme::Create2 { caller, code_hash, @@ -887,14 +888,15 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> hasher.update(&caller[..]); hasher.update(&salt[..]); hasher.update(&code_hash[..]); - H256::from_slice(hasher.finalize().as_slice()).into() + H256::from_slice(<[u8; 32]>::from(hasher.finalize()).as_slice()).into() } CreateScheme::Legacy { caller } => { let nonce = self.nonce(caller); let mut stream = rlp::RlpStream::new_list(2); stream.append(&caller); stream.append(&nonce); - H256::from_slice(Keccak256::digest(stream.out()).as_slice()).into() + H256::from_slice(<[u8; 32]>::from(Keccak256::digest(stream.out())).as_slice()) + .into() } CreateScheme::Fixed(address) => address, } @@ -1492,7 +1494,7 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> Handler return H256::default(); } let code = self.code(address); - H256::from_slice(Keccak256::digest(code).as_slice()) + H256::from_slice(<[u8; 32]>::from(Keccak256::digest(code)).as_slice()) } /// Get account code diff --git a/evm/src/runtime/eval/system.rs b/evm/src/runtime/eval/system.rs index e303e207..23064df8 100644 --- a/evm/src/runtime/eval/system.rs +++ b/evm/src/runtime/eval/system.rs @@ -27,7 +27,7 @@ pub fn sha3(runtime: &mut Runtime) -> Control { }; let ret = Keccak256::digest(data.as_slice()); - push_h256!(runtime, H256::from_slice(ret.as_slice())); + push_h256!(runtime, H256::from_slice(<[u8; 32]>::from(ret).as_slice())); Control::Continue } @@ -432,7 +432,7 @@ pub fn create(runtime: &mut Runtime, is_create2: bool, handler: &mut let scheme = if is_create2 { pop_h256!(runtime, salt); - let code_hash = H256::from_slice(Keccak256::digest(&code).as_slice()); + let code_hash = H256::from_slice(<[u8; 32]>::from(Keccak256::digest(&code)).as_slice()); CreateScheme::Create2 { caller: runtime.context.address, salt, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f19c7df4..3d572e0d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.81.0" +channel = "1.82.0" components = ["rustfmt", "clippy"]