From 3ff3d0562215bca620e07c5c4c154eec8da0f04b Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:05:58 +0530 Subject: [PATCH] chore: bump alloy-core deps + revm (#8988) * chore: bump alloy-core deps + revm * bump alloy to 0.4.0 * bump revm-inspectors + type casting to u128 * fix * Revert "fix" This reverts commit 5e0e0d1128b6819acf600b42372156738e666247. * Revert "bump revm-inspectors + type casting to u128" This reverts commit 25aa23cffaadef1d047ce7b359b4d7ad5018704a. * Revert "bump alloy to 0.4.0" This reverts commit f9721e00f5ba726c4fea6651839d65b45faae488. * replace std HashMap with alloy_primitives maps * bump compilers * replace remaining HashMaps * fmt * nit * replace HashSets * fmt --- Cargo.lock | 8 ++-- Cargo.toml | 16 ++++---- crates/anvil/src/config.rs | 3 +- crates/anvil/src/eth/backend/cheats.rs | 8 ++-- crates/anvil/src/eth/backend/fork.rs | 19 ++++++---- crates/anvil/src/eth/backend/mem/storage.rs | 37 +++++++++++-------- crates/anvil/src/eth/sign.rs | 5 +-- crates/anvil/src/filter.rs | 3 +- crates/anvil/tests/it/logs.rs | 4 +- crates/anvil/tests/it/transaction.rs | 6 +-- crates/cheatcodes/src/config.rs | 5 +-- crates/cheatcodes/src/evm/mapping.rs | 17 +++++---- crates/cheatcodes/src/inspector.rs | 12 ++++-- crates/cheatcodes/src/utils.rs | 3 +- crates/chisel/src/runner.rs | 5 +-- crates/chisel/src/session_source.rs | 3 +- crates/common/src/selectors.rs | 3 +- crates/config/src/error.rs | 4 +- crates/config/src/inline/mod.rs | 4 +- crates/config/src/lib.rs | 7 ++-- crates/debugger/src/tui/builder.rs | 6 +-- crates/debugger/src/tui/mod.rs | 7 ++-- crates/doc/src/builder.rs | 2 +- crates/doc/src/document.rs | 2 +- crates/doc/src/parser/comment.rs | 2 +- .../src/preprocessor/contract_inheritance.rs | 3 +- crates/doc/src/preprocessor/inheritdoc.rs | 2 +- crates/doc/src/preprocessor/mod.rs | 3 +- crates/evm/core/src/backend/diagnostic.rs | 5 +-- crates/evm/core/src/fork/multi.rs | 3 +- crates/evm/core/src/state_snapshot.rs | 4 +- crates/evm/evm/src/executors/fuzz/mod.rs | 4 +- crates/evm/evm/src/executors/fuzz/types.rs | 3 +- .../evm/evm/src/executors/invariant/replay.rs | 4 +- crates/evm/evm/src/executors/mod.rs | 9 +++-- crates/evm/evm/src/inspectors/stack.rs | 5 +-- crates/evm/fuzz/src/lib.rs | 9 +++-- crates/evm/fuzz/src/strategies/calldata.rs | 3 +- crates/evm/traces/src/lib.rs | 4 +- crates/forge/bin/cmd/bind.rs | 3 +- crates/forge/bin/cmd/snapshot.rs | 3 +- crates/forge/bin/cmd/watch.rs | 4 +- crates/forge/src/progress.rs | 4 +- crates/forge/src/result.rs | 17 +++++---- crates/linking/src/lib.rs | 3 +- crates/script/src/broadcast.rs | 17 +++++---- crates/script/src/execute.rs | 6 ++- crates/script/src/lib.rs | 9 +++-- crates/script/src/progress.rs | 9 +++-- crates/script/src/sequence.rs | 4 +- crates/verify/src/sourcify.rs | 7 +++- crates/wallets/src/multi_wallet.rs | 10 ++--- 52 files changed, 187 insertions(+), 161 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd4e2e0c62fb..7308606c9e3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7029,9 +7029,9 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -7622,9 +7622,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.17" +version = "2.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c947adb109a8afce5fc9c7bf951f87f146e9147b3a6a58413105628fb1d1e66" +checksum = "215b1103f73e23e9cb6883072c1fb26ae55c09d42054654955c739e5418a7c96" dependencies = [ "sdd", ] diff --git a/Cargo.toml b/Cargo.toml index 228bac2909fc..ae6ee18250fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -172,7 +172,7 @@ foundry-fork-db = "0.3.2" solang-parser = "=0.3.3" ## revm -revm = { version = "14.0.2", default-features = false } +revm = { version = "14.0.3", default-features = false } revm-primitives = { version = "10.0.0", default-features = false } revm-inspectors = { version = "0.7.7", features = ["serde"] } @@ -203,17 +203,17 @@ alloy-transport-ipc = { version = "0.3.6", default-features = false } alloy-transport-ws = { version = "0.3.6", default-features = false } ## alloy-core -alloy-dyn-abi = "0.8.1" -alloy-json-abi = "0.8.1" -alloy-primitives = { version = "0.8.1", features = [ +alloy-dyn-abi = "0.8.5" +alloy-json-abi = "0.8.5" +alloy-primitives = { version = "0.8.5", features = [ "getrandom", "rand", "map-fxhash", ] } -alloy-sol-macro-expander = "0.8.1" -alloy-sol-macro-input = "0.8.1" -alloy-sol-types = "0.8.1" -syn-solidity = "0.8.1" +alloy-sol-macro-expander = "0.8.5" +alloy-sol-macro-input = "0.8.5" +alloy-sol-types = "0.8.5" +syn-solidity = "0.8.5" alloy-chains = "0.1" alloy-rlp = "0.3" diff --git a/crates/anvil/src/config.rs b/crates/anvil/src/config.rs index d907fc200f53..f3dbf21f6013 100644 --- a/crates/anvil/src/config.rs +++ b/crates/anvil/src/config.rs @@ -17,7 +17,7 @@ use crate::{ }; use alloy_genesis::Genesis; use alloy_network::AnyNetwork; -use alloy_primitives::{hex, utils::Unit, BlockNumber, TxHash, U256}; +use alloy_primitives::{hex, map::HashMap, utils::Unit, BlockNumber, TxHash, U256}; use alloy_provider::Provider; use alloy_rpc_types::{Block, BlockNumberOrTag, Transaction}; use alloy_serde::WithOtherFields; @@ -46,7 +46,6 @@ use rand::thread_rng; use revm::primitives::BlobExcessGasAndPrice; use serde_json::{json, to_writer, Value}; use std::{ - collections::HashMap, fmt::Write as FmtWrite, fs::File, net::{IpAddr, Ipv4Addr}, diff --git a/crates/anvil/src/eth/backend/cheats.rs b/crates/anvil/src/eth/backend/cheats.rs index 5e941d004643..32115cf41c13 100644 --- a/crates/anvil/src/eth/backend/cheats.rs +++ b/crates/anvil/src/eth/backend/cheats.rs @@ -1,8 +1,8 @@ //! Support for "cheat codes" / bypass functions -use alloy_primitives::Address; +use alloy_primitives::{map::AddressHashSet, Address}; use parking_lot::RwLock; -use std::{collections::HashSet, sync::Arc}; +use std::sync::Arc; /// Manages user modifications that may affect the node's behavior /// @@ -55,7 +55,7 @@ impl CheatsManager { } /// Returns all accounts that are currently being impersonated. - pub fn impersonated_accounts(&self) -> HashSet
{ + pub fn impersonated_accounts(&self) -> AddressHashSet { self.state.read().impersonated_accounts.clone() } } @@ -64,7 +64,7 @@ impl CheatsManager { #[derive(Clone, Debug, Default)] pub struct CheatsState { /// All accounts that are currently impersonated - pub impersonated_accounts: HashSet, + pub impersonated_accounts: AddressHashSet, /// If set to true will make the `is_impersonated` function always return true pub auto_impersonate_accounts: bool, } diff --git a/crates/anvil/src/eth/backend/fork.rs b/crates/anvil/src/eth/backend/fork.rs index c661eeaa89b8..ea41b85a954c 100644 --- a/crates/anvil/src/eth/backend/fork.rs +++ b/crates/anvil/src/eth/backend/fork.rs @@ -4,7 +4,10 @@ use crate::eth::{backend::db::Db, error::BlockchainError, pool::transactions::Po use alloy_consensus::Account; use alloy_eips::eip2930::AccessListResult; use alloy_network::BlockResponse; -use alloy_primitives::{Address, Bytes, StorageValue, B256, U256}; +use alloy_primitives::{ + map::{FbHashMap, HashMap}, + Address, Bytes, StorageValue, B256, U256, +}; use alloy_provider::{ ext::{DebugApi, TraceApi}, Provider, @@ -27,7 +30,7 @@ use parking_lot::{ RawRwLock, RwLock, }; use revm::primitives::BlobExcessGasAndPrice; -use std::{collections::HashMap, sync::Arc, time::Duration}; +use std::{sync::Arc, time::Duration}; use tokio::sync::RwLock as AsyncRwLock; /// Represents a fork of a remote client @@ -675,14 +678,14 @@ impl ClientForkConfig { /// This is used as a cache so repeated requests to the same data are not sent to the remote client #[derive(Clone, Debug, Default)] pub struct ForkedStorage { - pub uncles: HashMap(
tx: &mut WithOtherFields