From d08b09de955e9f12c91e737cd8015ff971f20fdc Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Wed, 21 Jan 2026 00:21:15 +0000 Subject: [PATCH 1/7] cargo clippy --fix --- p2p/p2p/src/broadcast.rs | 2 +- p2p/p2p/src/peer_set.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/p2p/src/broadcast.rs b/p2p/p2p/src/broadcast.rs index 09fe1f768..e79449726 100644 --- a/p2p/p2p/src/broadcast.rs +++ b/p2p/p2p/src/broadcast.rs @@ -3,7 +3,7 @@ //! This module handles broadcasting messages to multiple peers with the [`BroadcastSvc`]. use std::{ future::{ready, Future, Ready}, - pin::{pin, Pin}, + pin::Pin, task::{ready, Context, Poll}, time::Duration, }; diff --git a/p2p/p2p/src/peer_set.rs b/p2p/p2p/src/peer_set.rs index 498eaafcb..bf21ae698 100644 --- a/p2p/p2p/src/peer_set.rs +++ b/p2p/p2p/src/peer_set.rs @@ -1,6 +1,6 @@ use std::{ future::{ready, Future, Ready}, - pin::{pin, Pin}, + pin::Pin, task::{Context, Poll}, }; From ef3cab37313bc29952a65b76cfbde06ff06a3dd5 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Wed, 21 Jan 2026 00:25:48 +0000 Subject: [PATCH 2/7] add clippy.toml exceptions --- clippy.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clippy.toml b/clippy.toml index d558c4688..e34f4085c 100644 --- a/clippy.toml +++ b/clippy.toml @@ -4,6 +4,10 @@ upper-case-acronyms-aggressive = true # doc-valid-idents = [ "RandomX", + "PoW", + "PoWER", + "RandomX", + "EquiX", # This adds the rest of the default exceptions. ".." ] From 15c3666a1666995e5afe6e0f28243da5ca4e23ac Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Wed, 21 Jan 2026 00:28:24 +0000 Subject: [PATCH 3/7] fix renamed lint --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index eb7a5fad0..85e41f012 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -395,7 +395,7 @@ return_self_not_must_use = "deny" single_match_else = "deny" string_add_assign = "deny" transmute_ptr_to_ptr = "deny" -unchecked_duration_subtraction = "deny" +unchecked_time_subtraction = "deny" unnecessary_box_returns = "deny" unnecessary_wraps = "deny" branches_sharing_code = "deny" From 69e75e71ccb0967343c4cc9a60cd32c08e748ef8 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Wed, 21 Jan 2026 00:50:12 +0000 Subject: [PATCH 4/7] fix clippy::unused-assignments --- cryptonight/src/util.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cryptonight/src/util.rs b/cryptonight/src/util.rs index 292139739..b438178b7 100644 --- a/cryptonight/src/util.rs +++ b/cryptonight/src/util.rs @@ -83,6 +83,7 @@ mod tests { } #[test] + #[expect(clippy::unused_assignments)] fn test_subarray_copy() { let mut array = [1_u8, 2, 3, 4, 5]; let sub_copied: [u8; 3] = subarray_copy(&array, 1); From bebe4c831f40a50364ee25de1e46351b3641932a Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Wed, 21 Jan 2026 21:12:55 +0000 Subject: [PATCH 5/7] rustc lint --- cryptonight/src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptonight/src/util.rs b/cryptonight/src/util.rs index b438178b7..41ce64976 100644 --- a/cryptonight/src/util.rs +++ b/cryptonight/src/util.rs @@ -83,7 +83,7 @@ mod tests { } #[test] - #[expect(clippy::unused_assignments)] + #[expect(unused_assignments)] fn test_subarray_copy() { let mut array = [1_u8, 2, 3, 4, 5]; let sub_copied: [u8; 3] = subarray_copy(&array, 1); From 4493e4fcd7cc5932adeddf41d8657dfe2503b9c5 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Mon, 26 Jan 2026 21:46:58 +0000 Subject: [PATCH 6/7] clippy --- net/epee-encoding/tests/seq.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/epee-encoding/tests/seq.rs b/net/epee-encoding/tests/seq.rs index b4ae788d7..c648ec831 100644 --- a/net/epee-encoding/tests/seq.rs +++ b/net/epee-encoding/tests/seq.rs @@ -3,7 +3,7 @@ use cuprate_epee_encoding::{epee_object, from_bytes}; struct ObjSeq { - seq: Vec, + seq: Vec, } epee_object!( From a50f4429cf5f7f0580401d1ae9ddcbf86d41e189 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Mon, 26 Jan 2026 22:17:10 +0000 Subject: [PATCH 7/7] 1.93 clippy --- Cargo.toml | 2 +- consensus/context/src/lib.rs | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 85e41f012..3ab3d6cf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -253,7 +253,7 @@ const_is_empty = "deny" doc_lazy_continuation = "deny" doc_link_with_quotes = "deny" duplicated_attributes = "deny" -empty_enum = "deny" +empty_enums = "deny" enum_glob_use = "deny" expl_impl_clone_on_copy = "deny" explicit_into_iter_loop = "deny" diff --git a/consensus/context/src/lib.rs b/consensus/context/src/lib.rs index d649197fe..ddf933675 100644 --- a/consensus/context/src/lib.rs +++ b/consensus/context/src/lib.rs @@ -143,21 +143,21 @@ impl BlockchainContext { /// /// ref: pub fn current_adjusted_timestamp_for_time_lock(&self) -> u64 { - if self.current_hf < HardFork::V13 || self.median_block_timestamp.is_none() { - current_unix_timestamp() - } else { - // This is safe as we just checked if this was None. - let median = self.median_block_timestamp.unwrap(); - - let adjusted_median = median - + (BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW + 1) * self.current_hf.block_time().as_secs() - / 2; - - // This is safe as we just checked if the median was None and this will only be none for genesis and the first block. - let adjusted_top_block = - self.top_block_timestamp.unwrap() + self.current_hf.block_time().as_secs(); - - min(adjusted_median, adjusted_top_block) + // FIXME: use if let chain with Rust 2024. + match self.median_block_timestamp { + Some(median) if self.current_hf >= HardFork::V13 => { + let adjusted_median = median + + (BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW + 1) + * self.current_hf.block_time().as_secs() + / 2; + + // This is safe as we just checked if the median was None and this will only be none for genesis and the first block. + let adjusted_top_block = + self.top_block_timestamp.unwrap() + self.current_hf.block_time().as_secs(); + + min(adjusted_median, adjusted_top_block) + } + Some(_) | None => current_unix_timestamp(), } }