diff --git a/bin/reth/src/node/mod.rs b/bin/reth/src/node/mod.rs index a3fe6f711f..3c3aa43165 100644 --- a/bin/reth/src/node/mod.rs +++ b/bin/reth/src/node/mod.rs @@ -331,7 +331,7 @@ impl Command { let mut pipeline = self .build_networked_pipeline( - &mut config, + &config, client.clone(), Arc::clone(&consensus), db.clone(), @@ -351,7 +351,7 @@ impl Command { } else { let pipeline = self .build_networked_pipeline( - &mut config, + &config, network_client.clone(), Arc::clone(&consensus), db.clone(), @@ -480,7 +480,7 @@ impl Command { #[allow(clippy::too_many_arguments)] async fn build_networked_pipeline( &self, - config: &mut Config, + config: &Config, client: Client, consensus: Arc, db: DB, diff --git a/bin/reth/src/stage/dump/execution.rs b/bin/reth/src/stage/dump/execution.rs index b2d7bbed32..67eda8033c 100644 --- a/bin/reth/src/stage/dump/execution.rs +++ b/bin/reth/src/stage/dump/execution.rs @@ -13,7 +13,7 @@ use std::{path::PathBuf, sync::Arc}; use tracing::info; pub(crate) async fn dump_execution_stage( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: u64, to: u64, output_db: &PathBuf, @@ -90,7 +90,7 @@ fn import_tables_with_range( /// PlainAccountState safely. There might be some state dependency from an address /// which hasn't been changed in the given range. async fn unwind_and_copy( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: u64, tip_block_number: u64, output_db: &DatabaseEnv, diff --git a/bin/reth/src/stage/dump/hashing_account.rs b/bin/reth/src/stage/dump/hashing_account.rs index cc0e72536d..2a947d013e 100644 --- a/bin/reth/src/stage/dump/hashing_account.rs +++ b/bin/reth/src/stage/dump/hashing_account.rs @@ -9,7 +9,7 @@ use std::{path::PathBuf, sync::Arc}; use tracing::info; pub(crate) async fn dump_hashing_account_stage( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: BlockNumber, to: BlockNumber, output_db: &PathBuf, @@ -33,7 +33,7 @@ pub(crate) async fn dump_hashing_account_stage( /// Dry-run an unwind to FROM block and copy the necessary table data to the new database. async fn unwind_and_copy( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: u64, tip_block_number: u64, output_db: &DatabaseEnv, diff --git a/bin/reth/src/stage/dump/hashing_storage.rs b/bin/reth/src/stage/dump/hashing_storage.rs index 1af985281d..0a8df0a6e4 100644 --- a/bin/reth/src/stage/dump/hashing_storage.rs +++ b/bin/reth/src/stage/dump/hashing_storage.rs @@ -9,7 +9,7 @@ use std::{path::PathBuf, sync::Arc}; use tracing::info; pub(crate) async fn dump_hashing_storage_stage( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: u64, to: u64, output_db: &PathBuf, @@ -28,7 +28,7 @@ pub(crate) async fn dump_hashing_storage_stage( /// Dry-run an unwind to FROM block and copy the necessary table data to the new database. async fn unwind_and_copy( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: u64, tip_block_number: u64, output_db: &DatabaseEnv, diff --git a/bin/reth/src/stage/dump/merkle.rs b/bin/reth/src/stage/dump/merkle.rs index b541687687..4339ef94e7 100644 --- a/bin/reth/src/stage/dump/merkle.rs +++ b/bin/reth/src/stage/dump/merkle.rs @@ -15,7 +15,7 @@ use std::{path::PathBuf, sync::Arc}; use tracing::info; pub(crate) async fn dump_merkle_stage( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, from: BlockNumber, to: BlockNumber, output_db: &PathBuf, @@ -42,7 +42,7 @@ pub(crate) async fn dump_merkle_stage( /// Dry-run an unwind to FROM block and copy the necessary table data to the new database. async fn unwind_and_copy( - db_tool: &mut DbTool<'_, DB>, + db_tool: &DbTool<'_, DB>, range: (u64, u64), tip_block_number: u64, output_db: &DatabaseEnv, diff --git a/bin/reth/src/stage/dump/mod.rs b/bin/reth/src/stage/dump/mod.rs index 5e7206cf1a..792777d1a6 100644 --- a/bin/reth/src/stage/dump/mod.rs +++ b/bin/reth/src/stage/dump/mod.rs @@ -104,20 +104,20 @@ impl Command { let db = Arc::new(init_db(db_path, self.db.log_level)?); info!(target: "reth::cli", "Database opened"); - let mut tool = DbTool::new(&db, self.chain.clone())?; + let tool = DbTool::new(&db, self.chain.clone())?; match &self.command { Stages::Execution(StageCommand { output_db, from, to, dry_run, .. }) => { - dump_execution_stage(&mut tool, *from, *to, output_db, *dry_run).await? + dump_execution_stage(&tool, *from, *to, output_db, *dry_run).await? } Stages::StorageHashing(StageCommand { output_db, from, to, dry_run, .. }) => { - dump_hashing_storage_stage(&mut tool, *from, *to, output_db, *dry_run).await? + dump_hashing_storage_stage(&tool, *from, *to, output_db, *dry_run).await? } Stages::AccountHashing(StageCommand { output_db, from, to, dry_run, .. }) => { - dump_hashing_account_stage(&mut tool, *from, *to, output_db, *dry_run).await? + dump_hashing_account_stage(&tool, *from, *to, output_db, *dry_run).await? } Stages::Merkle(StageCommand { output_db, from, to, dry_run, .. }) => { - dump_merkle_stage(&mut tool, *from, *to, output_db, *dry_run).await? + dump_merkle_stage(&tool, *from, *to, output_db, *dry_run).await? } } diff --git a/crates/revm/revm-inspectors/src/tracing/types.rs b/crates/revm/revm-inspectors/src/tracing/types.rs index 2739517dd4..b7d8648140 100644 --- a/crates/revm/revm-inspectors/src/tracing/types.rs +++ b/crates/revm/revm-inspectors/src/tracing/types.rs @@ -487,7 +487,7 @@ impl CallTraceNode { post_value: bool, ) { let addr = self.trace.address; - let acc_state = account_states.entry(addr).or_insert_with(AccountState::default); + let acc_state = account_states.entry(addr).or_default(); for change in self.trace.steps.iter().filter_map(|s| s.storage_change) { let StorageChange { key, value, had_value } = change; let storage_map = acc_state.storage.get_or_insert_with(BTreeMap::new); diff --git a/crates/rpc/rpc/src/reth.rs b/crates/rpc/rpc/src/reth.rs index 7fbdf25ab4..8fabf50e5f 100644 --- a/crates/rpc/rpc/src/reth.rs +++ b/crates/rpc/rpc/src/reth.rs @@ -62,7 +62,6 @@ where } fn try_balance_changes_in_block(&self, block_id: BlockId) -> EthResult> { - let block_id = block_id; let Some(block_number) = self.provider().block_number_for_id(block_id)? else { return Err(EthApiError::UnknownBlockNumber) }; diff --git a/crates/storage/libmdbx-rs/src/environment.rs b/crates/storage/libmdbx-rs/src/environment.rs index fb89beecef..4a37b941bd 100644 --- a/crates/storage/libmdbx-rs/src/environment.rs +++ b/crates/storage/libmdbx-rs/src/environment.rs @@ -346,7 +346,7 @@ where } /////////////////////////////////////////////////////////////////////////////////////////////////// -//// Environment Builder +// Environment Builder /////////////////////////////////////////////////////////////////////////////////////////////////// #[derive(Clone, Debug, PartialEq, Eq)] @@ -512,6 +512,7 @@ where match rx.recv() { Ok(msg) => match msg { TxnManagerMessage::Begin { parent, flags, sender } => { + #[allow(clippy::redundant_locals)] let e = e; let mut txn: *mut ffi::MDBX_txn = ptr::null_mut(); sender