From 7f21538d9532d0a2131899fe63e4f21b159783f2 Mon Sep 17 00:00:00 2001 From: Wodann Date: Tue, 31 Dec 2024 17:09:52 -0600 Subject: [PATCH] build: upgrade to Rust 1.83.0 (#757) This version of Rust resolves a bug that was introduced in 1.81 that broke our usage of native Node modules, inhibiting prior upgrades. --- crates/edr_eth/src/filter.rs | 2 +- crates/edr_eth/src/transaction/pooled/eip4844.rs | 4 ++-- crates/edr_evm/src/block/builder/l1.rs | 8 ++++---- crates/edr_evm/src/state/overrides.rs | 2 +- crates/edr_evm/src/state/trie/account.rs | 2 +- crates/edr_evm/src/state/trie/state_trie.rs | 4 ++-- crates/edr_evm/src/state/trie/storage_trie.rs | 4 ++-- crates/edr_provider/src/pending.rs | 11 ++++------- crates/edr_rpc_client/src/cache/block_spec.rs | 2 +- crates/edr_rpc_client/src/cache/filter.rs | 2 +- crates/edr_rpc_client/src/client.rs | 10 +++++----- crates/edr_rpc_client/src/jsonrpc.rs | 2 +- crates/edr_rpc_eth/src/cacheable_method_invocation.rs | 6 +++--- crates/edr_solidity/src/compiler.rs | 7 +++---- rust-toolchain | 2 +- 15 files changed, 32 insertions(+), 36 deletions(-) diff --git a/crates/edr_eth/src/filter.rs b/crates/edr_eth/src/filter.rs index d49fb32dc..28f81ac4e 100644 --- a/crates/edr_eth/src/filter.rs +++ b/crates/edr_eth/src/filter.rs @@ -157,7 +157,7 @@ impl<'a> serde::Deserialize<'a> for SubscriptionType { D: serde::Deserializer<'a>, { struct SubscriptionTypeVisitor; - impl<'a> serde::de::Visitor<'a> for SubscriptionTypeVisitor { + impl serde::de::Visitor<'_> for SubscriptionTypeVisitor { type Value = SubscriptionType; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { diff --git a/crates/edr_eth/src/transaction/pooled/eip4844.rs b/crates/edr_eth/src/transaction/pooled/eip4844.rs index de1895742..b33c3b879 100644 --- a/crates/edr_eth/src/transaction/pooled/eip4844.rs +++ b/crates/edr_eth/src/transaction/pooled/eip4844.rs @@ -271,7 +271,7 @@ impl Transaction for Eip4844 { #[repr(transparent)] struct RlpBlob<'blob>(&'blob Blob); -impl<'blob> alloy_rlp::Encodable for RlpBlob<'blob> { +impl alloy_rlp::Encodable for RlpBlob<'_> { fn encode(&self, out: &mut dyn alloy_rlp::BufMut) { self.0.as_ref().encode(out); } @@ -290,7 +290,7 @@ impl<'blob> From<&'blob Blob> for RlpBlob<'blob> { #[repr(transparent)] struct RlpBytes48<'bytes>(&'bytes Bytes48); -impl<'bytes> alloy_rlp::Encodable for RlpBytes48<'bytes> { +impl alloy_rlp::Encodable for RlpBytes48<'_> { fn encode(&self, out: &mut dyn alloy_rlp::BufMut) { self.0.as_ref().encode(out); } diff --git a/crates/edr_evm/src/block/builder/l1.rs b/crates/edr_evm/src/block/builder/l1.rs index 3ad2febf6..9bcb99358 100644 --- a/crates/edr_evm/src/block/builder/l1.rs +++ b/crates/edr_evm/src/block/builder/l1.rs @@ -61,8 +61,8 @@ where withdrawals: Option>, } -impl<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT> - EthBlockBuilder<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT> +impl + EthBlockBuilder<'_, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT> where ChainSpecT: RuntimeSpec, { @@ -323,8 +323,8 @@ where } } -impl<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT> - EthBlockBuilder<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT> +impl + EthBlockBuilder<'_, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT> where ChainSpecT: SyncRuntimeSpec, StateErrorT: Debug, diff --git a/crates/edr_evm/src/state/overrides.rs b/crates/edr_evm/src/state/overrides.rs index aaf1fcbbe..b3535d50c 100644 --- a/crates/edr_evm/src/state/overrides.rs +++ b/crates/edr_evm/src/state/overrides.rs @@ -262,7 +262,7 @@ impl<'overrides, StateT> StateRefOverrider<'overrides, StateT> { } } -impl<'state, StateT: State> State for StateRefOverrider<'state, StateT> { +impl State for StateRefOverrider<'_, StateT> { type Error = StateT::Error; fn basic(&self, address: Address) -> Result, Self::Error> { diff --git a/crates/edr_evm/src/state/trie/account.rs b/crates/edr_evm/src/state/trie/account.rs index cc13178fb..62536312c 100644 --- a/crates/edr_evm/src/state/trie/account.rs +++ b/crates/edr_evm/src/state/trie/account.rs @@ -181,7 +181,7 @@ struct AccountTrieMutation<'a> { storage_tries: &'a mut StorageTries, } -impl<'a> AccountTrieMutation<'a> { +impl AccountTrieMutation<'_> { #[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))] pub fn init_account(&mut self, address: &Address, account_info: &AccountInfo) { let storage_trie = StorageTrie::default(); diff --git a/crates/edr_evm/src/state/trie/state_trie.rs b/crates/edr_evm/src/state/trie/state_trie.rs index 14e0641e6..55a668dc2 100644 --- a/crates/edr_evm/src/state/trie/state_trie.rs +++ b/crates/edr_evm/src/state/trie/state_trie.rs @@ -66,7 +66,7 @@ pub(super) struct StateTrieMutation<'a> { trie_query: TrieQuery, } -impl<'a> StateTrieMutation<'a> { +impl StateTrieMutation<'_> { pub fn account(&self, address: &Address) -> Option { self.state_trie.account(address) } @@ -90,7 +90,7 @@ impl<'a> StateTrieMutation<'a> { } } -impl<'a> Drop for StateTrieMutation<'a> { +impl Drop for StateTrieMutation<'_> { fn drop(&mut self) { self.state_trie.root = self.trie_query.root(); } diff --git a/crates/edr_evm/src/state/trie/storage_trie.rs b/crates/edr_evm/src/state/trie/storage_trie.rs index 5af935bda..395859f79 100644 --- a/crates/edr_evm/src/state/trie/storage_trie.rs +++ b/crates/edr_evm/src/state/trie/storage_trie.rs @@ -73,7 +73,7 @@ pub(super) struct StorageTrieMutation<'a> { trie_query: TrieQuery, } -impl<'a> StorageTrieMutation<'a> { +impl StorageTrieMutation<'_> { #[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))] pub fn set_storage_slots(&mut self, storage: &EvmStorage) { storage.iter().for_each(|(index, value)| { @@ -102,7 +102,7 @@ impl<'a> StorageTrieMutation<'a> { } } -impl<'a> Drop for StorageTrieMutation<'a> { +impl Drop for StorageTrieMutation<'_> { fn drop(&mut self) { self.storage_trie.root = self.trie_query.root(); } diff --git a/crates/edr_provider/src/pending.rs b/crates/edr_provider/src/pending.rs index bae8457e3..f878b6d23 100644 --- a/crates/edr_provider/src/pending.rs +++ b/crates/edr_provider/src/pending.rs @@ -54,8 +54,7 @@ impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockchainWithPending<'blockchain } } -impl<'blockchain, ChainSpecT> Blockchain - for BlockchainWithPending<'blockchain, ChainSpecT> +impl Blockchain for BlockchainWithPending<'_, ChainSpecT> where ChainSpecT: SyncRuntimeSpec< LocalBlock: BlockReceipts< @@ -212,8 +211,8 @@ where } } -impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockchainMut - for BlockchainWithPending<'blockchain, ChainSpecT> +impl BlockchainMut + for BlockchainWithPending<'_, ChainSpecT> { type Error = BlockchainErrorForChainSpec; @@ -237,9 +236,7 @@ impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockchainMut } } -impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockHash - for BlockchainWithPending<'blockchain, ChainSpecT> -{ +impl BlockHash for BlockchainWithPending<'_, ChainSpecT> { type Error = BlockchainErrorForChainSpec; fn block_hash_by_number(&self, block_number: u64) -> Result { diff --git a/crates/edr_rpc_client/src/cache/block_spec.rs b/crates/edr_rpc_client/src/cache/block_spec.rs index fb47e2de6..2c7a602df 100644 --- a/crates/edr_rpc_client/src/cache/block_spec.rs +++ b/crates/edr_rpc_client/src/cache/block_spec.rs @@ -25,7 +25,7 @@ pub enum CacheableBlockSpec<'a> { Finalized, } -impl<'a> CacheKeyVariant for CacheableBlockSpec<'a> { +impl CacheKeyVariant for CacheableBlockSpec<'_> { fn cache_key_variant(&self) -> u8 { match self { CacheableBlockSpec::Number { .. } => 0, diff --git a/crates/edr_rpc_client/src/cache/filter.rs b/crates/edr_rpc_client/src/cache/filter.rs index 969e0d0d1..3f10b494f 100644 --- a/crates/edr_rpc_client/src/cache/filter.rs +++ b/crates/edr_rpc_client/src/cache/filter.rs @@ -66,7 +66,7 @@ pub enum CacheableLogFilterRange<'a> { }, } -impl<'a> CacheKeyVariant for CacheableLogFilterRange<'a> { +impl CacheKeyVariant for CacheableLogFilterRange<'_> { fn cache_key_variant(&self) -> u8 { match self { CacheableLogFilterRange::Hash(_) => 0, diff --git a/crates/edr_rpc_client/src/client.rs b/crates/edr_rpc_client/src/client.rs index 178d48cf8..b3602ecce 100644 --- a/crates/edr_rpc_client/src/client.rs +++ b/crates/edr_rpc_client/src/client.rs @@ -92,7 +92,7 @@ pub enum RpcClientError { #[error("{error}. Request: {request}")] JsonRpcError { /// The JSON-RPC error - error: jsonrpc::Error, + error: Box, /// The request JSON request: String, }, @@ -239,7 +239,7 @@ impl RpcClient { }; result.map_err(|error| RpcClientError::JsonRpcError { - error, + error: Box::new(error), request: request.to_json_string(), }) } @@ -708,7 +708,7 @@ mod tests { NetVersion, } - impl<'method> CachedTestMethod<'method> { + impl CachedTestMethod<'_> { fn key_hasher(&self) -> Result { let hasher = KeyHasher::default().hash_u8(self.cache_key_variant()); @@ -770,7 +770,7 @@ mod tests { } } - impl<'method> CacheKeyVariant for CachedTestMethod<'method> { + impl CacheKeyVariant for CachedTestMethod<'_> { fn cache_key_variant(&self) -> u8 { match self { Self::GetBlockByNumber { .. } => 0, @@ -779,7 +779,7 @@ mod tests { } } - impl<'method> CacheableMethod for CachedTestMethod<'method> { + impl CacheableMethod for CachedTestMethod<'_> { type MethodWithResolvableBlockTag = TestMethodWithResolvableBlockSpec; fn resolve_block_tag( diff --git a/crates/edr_rpc_client/src/jsonrpc.rs b/crates/edr_rpc_client/src/jsonrpc.rs index 577d7c817..6d8f488f6 100644 --- a/crates/edr_rpc_client/src/jsonrpc.rs +++ b/crates/edr_rpc_client/src/jsonrpc.rs @@ -145,7 +145,7 @@ impl<'a> Deserialize<'a> for Version { struct VersionVisitor; -impl<'a> serde::de::Visitor<'a> for VersionVisitor { +impl serde::de::Visitor<'_> for VersionVisitor { type Value = Version; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { diff --git a/crates/edr_rpc_eth/src/cacheable_method_invocation.rs b/crates/edr_rpc_eth/src/cacheable_method_invocation.rs index add86376d..e72427222 100644 --- a/crates/edr_rpc_eth/src/cacheable_method_invocation.rs +++ b/crates/edr_rpc_eth/src/cacheable_method_invocation.rs @@ -71,7 +71,7 @@ pub enum CachedRequestMethod<'a> { NetVersion, } -impl<'a> CachedRequestMethod<'a> { +impl CachedRequestMethod<'_> { // Allow to keep same structure as other RequestMethod and other methods. #[allow(clippy::match_same_arms)] fn key_hasher(&self) -> Result { @@ -266,7 +266,7 @@ impl RpcMethod for RequestMethod { } } -impl<'method> CacheableMethod for CachedRequestMethod<'method> { +impl CacheableMethod for CachedRequestMethod<'_> { type MethodWithResolvableBlockTag = MethodWithResolvableBlockSpec; fn resolve_block_tag(method: Self::MethodWithResolvableBlockTag, block_number: u64) -> Self { @@ -337,7 +337,7 @@ impl<'method> CacheableMethod for CachedRequestMethod<'method> { } } -impl<'a> CacheKeyVariant for CachedRequestMethod<'a> { +impl CacheKeyVariant for CachedRequestMethod<'_> { fn cache_key_variant(&self) -> u8 { match self { // The commented out methods have been removed as they're not currently in use by the diff --git a/crates/edr_solidity/src/compiler.rs b/crates/edr_solidity/src/compiler.rs index 076be37e9..1ee257fee 100644 --- a/crates/edr_solidity/src/compiler.rs +++ b/crates/edr_solidity/src/compiler.rs @@ -1,6 +1,7 @@ //! Processes the Solidity compiler standard JSON[^1] input and output AST and //! creates the source model used to perform the stack trace decoding. - +//! +//! [^1]: See . use std::{cell::RefCell, collections::HashMap, rc::Rc, str::FromStr}; use anyhow::{self, Context as _}; @@ -18,12 +19,10 @@ use crate::{ }; /// For the Solidity compiler version and its standard JSON input and -/// output[^1], creates the source model, decodes the bytecode with source +/// output, creates the source model, decodes the bytecode with source /// mapping and links them to the source files. /// /// Returns the decoded bytecodes that reference the resolved source model. -/// -/// [^1]: See . pub fn create_models_and_decode_bytecodes( solc_version: String, compiler_input: &CompilerInput, diff --git a/rust-toolchain b/rust-toolchain index d456f7459..74c280fb8 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.80 +1.83