diff --git a/.github/nightly-version b/.github/nightly-version index 09a243d7..4994bc5d 100644 --- a/.github/nightly-version +++ b/.github/nightly-version @@ -1 +1 @@ -nightly-2025-01-01 +nightly-2025-02-01 diff --git a/Cargo.toml b/Cargo.toml index 7ac71666..ba869e98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -208,6 +208,7 @@ directories-next = { path = "patches/directories-next" } [workspace.lints.clippy] unwrap_or_default = "allow" map_unwrap_or = "allow" +needless_continue = "allow" borrow_as_ptr = "deny" cast_lossless = "deny" cast_possible_truncation = "deny" @@ -238,7 +239,6 @@ manual_string_new = "deny" match_bool = "deny" match_same_arms = "deny" missing_fields_in_debug = "deny" -needless_continue = "deny" needless_pass_by_value = "deny" ptr_cast_constness = "deny" range_minus_one = "deny" diff --git a/coordinator/tributary-sdk/src/merkle.rs b/coordinator/tributary-sdk/src/merkle.rs index 2a3ee3a1..acfb0508 100644 --- a/coordinator/tributary-sdk/src/merkle.rs +++ b/coordinator/tributary-sdk/src/merkle.rs @@ -9,7 +9,7 @@ pub(crate) fn merkle(hash_args: &[[u8; 32]]) -> [u8; 32] { let zero = [0; 32]; let mut interim; while hashes.len() > 1 { - interim = Vec::with_capacity((hashes.len() + 1) / 2); + interim = Vec::with_capacity(hashes.len().div_ceil(2)); let mut i = 0; while i < hashes.len() { diff --git a/coordinator/tributary/src/db.rs b/coordinator/tributary/src/db.rs index 7d5857eb..dc443168 100644 --- a/coordinator/tributary/src/db.rs +++ b/coordinator/tributary/src/db.rs @@ -61,7 +61,7 @@ impl Topic { attempt: attempt + 1, round: SigningProtocolRound::Preprocess, }), - Topic::SlashReport { .. } => None, + Topic::SlashReport => None, Topic::Sign { id, attempt, round: _ } => { Some(Topic::Sign { id, attempt: attempt + 1, round: SigningProtocolRound::Preprocess }) } @@ -83,7 +83,7 @@ impl Topic { } SigningProtocolRound::Share => None, }, - Topic::SlashReport { .. } => None, + Topic::SlashReport => None, Topic::Sign { id, attempt, round } => match round { SigningProtocolRound::Preprocess => { let attempt = attempt + 1; @@ -102,7 +102,7 @@ impl Topic { match self { Topic::RemoveParticipant { .. } => None, Topic::DkgConfirmation { .. } => None, - Topic::SlashReport { .. } => None, + Topic::SlashReport => None, Topic::Sign { id, attempt, round: _ } => Some(SignId { session: set.session, id, attempt }), } } @@ -129,7 +129,7 @@ impl Topic { }; SignId { session: set.session, id, attempt } }), - Topic::SlashReport { .. } => None, + Topic::SlashReport => None, Topic::Sign { .. } => None, } } @@ -147,7 +147,7 @@ impl Topic { Some(Topic::DkgConfirmation { attempt, round: SigningProtocolRound::Preprocess }) } }, - Topic::SlashReport { .. } => None, + Topic::SlashReport => None, Topic::Sign { id, attempt, round } => match round { SigningProtocolRound::Preprocess => None, SigningProtocolRound::Share => { @@ -170,7 +170,7 @@ impl Topic { } SigningProtocolRound::Share => None, }, - Topic::SlashReport { .. } => None, + Topic::SlashReport => None, Topic::Sign { id, attempt, round } => match round { SigningProtocolRound::Preprocess => { Some(Topic::Sign { id, attempt, round: SigningProtocolRound::Share }) @@ -189,7 +189,7 @@ impl Topic { // We don't require recognition for the first attempt, solely the re-attempts Topic::DkgConfirmation { attempt, .. } => *attempt != 0, // We don't require recognition for the slash report - Topic::SlashReport { .. } => false, + Topic::SlashReport => false, // We do require recognition for every sign protocol Topic::Sign { .. } => true, } @@ -206,7 +206,7 @@ impl Topic { match self { Topic::RemoveParticipant { .. } => Participating::Everyone, Topic::DkgConfirmation { .. } => Participating::Participated, - Topic::SlashReport { .. } => Participating::Everyone, + Topic::SlashReport => Participating::Everyone, Topic::Sign { .. } => Participating::Participated, } } diff --git a/crypto/schnorr/src/aggregate.rs b/crypto/schnorr/src/aggregate.rs index d393c98e..cc0ac620 100644 --- a/crypto/schnorr/src/aggregate.rs +++ b/crypto/schnorr/src/aggregate.rs @@ -31,9 +31,8 @@ fn weight(digest: &mut DigestTran // Derive a scalar from enough bits of entropy that bias is < 2^128 // This can't be const due to its usage of a generic // Also due to the usize::try_from, yet that could be replaced with an `as` - // The + 7 forces it to round up #[allow(non_snake_case)] - let BYTES: usize = usize::try_from(((F::NUM_BITS + 128) + 7) / 8).unwrap(); + let BYTES: usize = usize::try_from((F::NUM_BITS + 128).div_ceil(8)).unwrap(); let mut remaining = BYTES; diff --git a/substrate/in-instructions/pallet/src/lib.rs b/substrate/in-instructions/pallet/src/lib.rs index 7580056d..ff5e87a1 100644 --- a/substrate/in-instructions/pallet/src/lib.rs +++ b/substrate/in-instructions/pallet/src/lib.rs @@ -381,7 +381,7 @@ pub mod pallet { // Explicitly provide a pre-dispatch which calls validate_unsigned fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError> { - Self::validate_unsigned(TransactionSource::InBlock, call).map(|_| ()).map_err(Into::into) + Self::validate_unsigned(TransactionSource::InBlock, call).map(|_| ()) } } } diff --git a/substrate/node/src/service.rs b/substrate/node/src/service.rs index 5f76decf..af438602 100644 --- a/substrate/node/src/service.rs +++ b/substrate/node/src/service.rs @@ -351,7 +351,7 @@ pub fn new_full(mut config: Configuration) -> Result telemetry: telemetry.as_mut(), })?; - if let sc_service::config::Role::Authority { .. } = &role { + if let sc_service::config::Role::Authority = &role { let slot_duration = babe_link.config().slot_duration(); let babe_config = sc_consensus_babe::BabeParams { keystore: keystore.clone(), diff --git a/substrate/validator-sets/pallet/src/lib.rs b/substrate/validator-sets/pallet/src/lib.rs index ff1cc452..3d955f4a 100644 --- a/substrate/validator-sets/pallet/src/lib.rs +++ b/substrate/validator-sets/pallet/src/lib.rs @@ -1254,7 +1254,7 @@ pub mod pallet { // Explicitly provide a pre-dispatch which calls validate_unsigned fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError> { - Self::validate_unsigned(TransactionSource::InBlock, call).map(|_| ()).map_err(Into::into) + Self::validate_unsigned(TransactionSource::InBlock, call).map(|_| ()) } }