Skip to content

Commit

Permalink
build: upgrade to Rust 1.83.0 (#757)
Browse files Browse the repository at this point in the history
This version of Rust resolves a bug that was
introduced in 1.81 that broke our usage of native
Node modules, inhibiting prior upgrades.
  • Loading branch information
Wodann authored Dec 31, 2024
1 parent 53aa8bf commit 7f21538
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 36 deletions.
2 changes: 1 addition & 1 deletion crates/edr_eth/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions crates/edr_eth/src/transaction/pooled/eip4844.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions crates/edr_evm/src/block/builder/l1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ where
withdrawals: Option<Vec<Withdrawal>>,
}

impl<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
EthBlockBuilder<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
impl<BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
EthBlockBuilder<'_, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
where
ChainSpecT: RuntimeSpec,
{
Expand Down Expand Up @@ -323,8 +323,8 @@ where
}
}

impl<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
EthBlockBuilder<'blockchain, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
impl<BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
EthBlockBuilder<'_, BlockchainErrorT, ChainSpecT, DebugDataT, StateErrorT>
where
ChainSpecT: SyncRuntimeSpec,
StateErrorT: Debug,
Expand Down
2 changes: 1 addition & 1 deletion crates/edr_evm/src/state/overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl<'overrides, StateT> StateRefOverrider<'overrides, StateT> {
}
}

impl<'state, StateT: State> State for StateRefOverrider<'state, StateT> {
impl<StateT: State> State for StateRefOverrider<'_, StateT> {
type Error = StateT::Error;

fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/edr_evm/src/state/trie/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions crates/edr_evm/src/state/trie/state_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BasicAccount> {
self.state_trie.account(address)
}
Expand All @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions crates/edr_evm/src/state/trie/storage_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)| {
Expand Down Expand Up @@ -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();
}
Expand Down
11 changes: 4 additions & 7 deletions crates/edr_provider/src/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockchainWithPending<'blockchain
}
}

impl<'blockchain, ChainSpecT> Blockchain<ChainSpecT>
for BlockchainWithPending<'blockchain, ChainSpecT>
impl<ChainSpecT> Blockchain<ChainSpecT> for BlockchainWithPending<'_, ChainSpecT>
where
ChainSpecT: SyncRuntimeSpec<
LocalBlock: BlockReceipts<
Expand Down Expand Up @@ -212,8 +211,8 @@ where
}
}

impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockchainMut<ChainSpecT>
for BlockchainWithPending<'blockchain, ChainSpecT>
impl<ChainSpecT: SyncRuntimeSpec> BlockchainMut<ChainSpecT>
for BlockchainWithPending<'_, ChainSpecT>
{
type Error = BlockchainErrorForChainSpec<ChainSpecT>;

Expand All @@ -237,9 +236,7 @@ impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockchainMut<ChainSpecT>
}
}

impl<'blockchain, ChainSpecT: SyncRuntimeSpec> BlockHash
for BlockchainWithPending<'blockchain, ChainSpecT>
{
impl<ChainSpecT: SyncRuntimeSpec> BlockHash for BlockchainWithPending<'_, ChainSpecT> {
type Error = BlockchainErrorForChainSpec<ChainSpecT>;

fn block_hash_by_number(&self, block_number: u64) -> Result<B256, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/edr_rpc_client/src/cache/block_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/edr_rpc_client/src/cache/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions crates/edr_rpc_client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub enum RpcClientError {
#[error("{error}. Request: {request}")]
JsonRpcError {
/// The JSON-RPC error
error: jsonrpc::Error,
error: Box<jsonrpc::Error>,
/// The request JSON
request: String,
},
Expand Down Expand Up @@ -239,7 +239,7 @@ impl<MethodT: RpcMethod + Serialize> RpcClient<MethodT> {
};

result.map_err(|error| RpcClientError::JsonRpcError {
error,
error: Box::new(error),
request: request.to_json_string(),
})
}
Expand Down Expand Up @@ -708,7 +708,7 @@ mod tests {
NetVersion,
}

impl<'method> CachedTestMethod<'method> {
impl CachedTestMethod<'_> {
fn key_hasher(&self) -> Result<cache::KeyHasher, UnresolvedBlockTagError> {
let hasher = KeyHasher::default().hash_u8(self.cache_key_variant());

Expand Down Expand Up @@ -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,
Expand All @@ -779,7 +779,7 @@ mod tests {
}
}

impl<'method> CacheableMethod for CachedTestMethod<'method> {
impl CacheableMethod for CachedTestMethod<'_> {
type MethodWithResolvableBlockTag = TestMethodWithResolvableBlockSpec;

fn resolve_block_tag(
Expand Down
2 changes: 1 addition & 1 deletion crates/edr_rpc_client/src/jsonrpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions crates/edr_rpc_eth/src/cacheable_method_invocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<cache::KeyHasher, UnresolvedBlockTagError> {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions crates/edr_solidity/src/compiler.rs
Original file line number Diff line number Diff line change
@@ -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 <https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-input-and-output-json-description>.
use std::{cell::RefCell, collections::HashMap, rc::Rc, str::FromStr};

use anyhow::{self, Context as _};
Expand All @@ -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 <https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-input-and-output-json-description>.
pub fn create_models_and_decode_bytecodes(
solc_version: String,
compiler_input: &CompilerInput,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.80
1.83

0 comments on commit 7f21538

Please sign in to comment.