From 332ef29995470b2045d609a62905c0a1fc78a512 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 18 Sep 2025 16:10:32 +0200 Subject: [PATCH 1/3] fix: warning about unnecessary parentheses around closure body --- .../src/database/record/signer_registration.rs | 8 ++++---- mithril-common/src/messages/message_parts/signer.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mithril-aggregator/src/database/record/signer_registration.rs b/mithril-aggregator/src/database/record/signer_registration.rs index 6e72169a167..60a9b98d86e 100644 --- a/mithril-aggregator/src/database/record/signer_registration.rs +++ b/mithril-aggregator/src/database/record/signer_registration.rs @@ -61,8 +61,8 @@ impl From for Signer { verification_key: other.verification_key.try_into().unwrap(), verification_key_signature: other .verification_key_signature - .map(|k| (k.try_into().unwrap())), - operational_certificate: other.operational_certificate.map(|o| (o.try_into().unwrap())), + .map(|k| k.try_into().unwrap()), + operational_certificate: other.operational_certificate.map(|o| o.try_into().unwrap()), kes_period: other.kes_period, } } @@ -75,8 +75,8 @@ impl From for SignerWithStake { verification_key: other.verification_key.try_into().unwrap(), verification_key_signature: other .verification_key_signature - .map(|k| (k.try_into().unwrap())), - operational_certificate: other.operational_certificate.map(|o| (o.try_into().unwrap())), + .map(|k| k.try_into().unwrap()), + operational_certificate: other.operational_certificate.map(|o| o.try_into().unwrap()), kes_period: other.kes_period, stake: other.stake.unwrap_or_default(), } diff --git a/mithril-common/src/messages/message_parts/signer.rs b/mithril-common/src/messages/message_parts/signer.rs index 937595244cb..a6db2b10e11 100644 --- a/mithril-common/src/messages/message_parts/signer.rs +++ b/mithril-common/src/messages/message_parts/signer.rs @@ -107,7 +107,7 @@ impl From for SignerWithStakeMessagePart { .map(|k| k.try_into().unwrap()), operational_certificate: value .operational_certificate - .map(|op_cert| (op_cert.try_into().unwrap())), + .map(|op_cert| op_cert.try_into().unwrap()), kes_period: value.kes_period, stake: value.stake, } @@ -230,7 +230,7 @@ impl From for SignerMessagePart { .map(|k| k.try_into().unwrap()), operational_certificate: value .operational_certificate - .map(|op_cert| (op_cert.try_into().unwrap())), + .map(|op_cert| op_cert.try_into().unwrap()), kes_period: value.kes_period, } } From a6f58b7cb220fe95dbf32306db4995b920463c4a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 18 Sep 2025 16:10:58 +0200 Subject: [PATCH 2/3] fix: warning about manual implementation of '.is_multiple_of()' --- .../src/digesters/immutable_digester.rs | 2 +- .../src/test/dummy_cardano_db.rs | 2 +- mithril-aggregator/src/services/epoch_service.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cardano-node/mithril-cardano-node-internal-database/src/digesters/immutable_digester.rs b/internal/cardano-node/mithril-cardano-node-internal-database/src/digesters/immutable_digester.rs index 0877ecbf4bc..ce62380d399 100644 --- a/internal/cardano-node/mithril-cardano-node-internal-database/src/digesters/immutable_digester.rs +++ b/internal/cardano-node/mithril-cardano-node-internal-database/src/digesters/immutable_digester.rs @@ -177,7 +177,7 @@ pub(super) struct Progress { impl Progress { pub(super) fn report(&mut self, ix: usize) -> bool { self.index = ix; - (20 * ix) % self.total == 0 + (20 * ix).is_multiple_of(self.total) } pub(super) fn percent(&self) -> f64 { diff --git a/internal/cardano-node/mithril-cardano-node-internal-database/src/test/dummy_cardano_db.rs b/internal/cardano-node/mithril-cardano-node-internal-database/src/test/dummy_cardano_db.rs index 3185e4eba55..224d8c85e61 100644 --- a/internal/cardano-node/mithril-cardano-node-internal-database/src/test/dummy_cardano_db.rs +++ b/internal/cardano-node/mithril-cardano-node-internal-database/src/test/dummy_cardano_db.rs @@ -211,7 +211,7 @@ impl DummyCardanoDbBuilder { /// Note: by default, the size of the produced files is less than 1 kb. pub fn set_immutable_trio_file_size(&mut self, trio_file_size: u64) -> &mut Self { assert!( - trio_file_size % 3 == 0, + trio_file_size.is_multiple_of(3), "'trio_file_size' must be a multiple of 3" ); diff --git a/mithril-aggregator/src/services/epoch_service.rs b/mithril-aggregator/src/services/epoch_service.rs index 3c9a109b534..3c8b55180f9 100644 --- a/mithril-aggregator/src/services/epoch_service.rs +++ b/mithril-aggregator/src/services/epoch_service.rs @@ -1019,7 +1019,7 @@ mod tests { let stake_store = { assert!( - self.total_stake % self.total_spo as u64 == 0, + self.total_stake.is_multiple_of(self.total_spo as u64), "'total_stake' must be a multiple of 'total_spo' to create a uniform stake distribution" ); let stake_per_spo = self.total_stake / self.total_spo as u64; From 0dae901b2c38f0ce55e825f6565c5fce1ed926e6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 18 Sep 2025 16:11:05 +0200 Subject: [PATCH 3/3] chore: upgrade crate versions * mithril-cardano-node-internal-database from `0.1.6` to `0.1.7` * mithril-aggregator from `0.7.84` to `0.7.85` * mithril-common from `0.6.17` to `0.6.18` --- Cargo.lock | 6 +++--- .../mithril-cardano-node-internal-database/Cargo.toml | 2 +- mithril-aggregator/Cargo.toml | 2 +- mithril-common/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a35d5e4ac63..d36c3e77dcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3989,7 +3989,7 @@ dependencies = [ [[package]] name = "mithril-aggregator" -version = "0.7.84" +version = "0.7.85" dependencies = [ "anyhow", "async-trait", @@ -4141,7 +4141,7 @@ dependencies = [ [[package]] name = "mithril-cardano-node-internal-database" -version = "0.1.6" +version = "0.1.7" dependencies = [ "anyhow", "async-trait", @@ -4262,7 +4262,7 @@ dependencies = [ [[package]] name = "mithril-common" -version = "0.6.17" +version = "0.6.18" dependencies = [ "anyhow", "async-trait", diff --git a/internal/cardano-node/mithril-cardano-node-internal-database/Cargo.toml b/internal/cardano-node/mithril-cardano-node-internal-database/Cargo.toml index 965e080ed52..9a1783b8852 100644 --- a/internal/cardano-node/mithril-cardano-node-internal-database/Cargo.toml +++ b/internal/cardano-node/mithril-cardano-node-internal-database/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-cardano-node-internal-database" -version = "0.1.6" +version = "0.1.7" description = "Mechanisms that allow Mithril nodes to read the files of a Cardano node internal database and compute digests from them" authors.workspace = true documentation.workspace = true diff --git a/mithril-aggregator/Cargo.toml b/mithril-aggregator/Cargo.toml index 32ae42a4dc8..d9c3b92803b 100644 --- a/mithril-aggregator/Cargo.toml +++ b/mithril-aggregator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-aggregator" -version = "0.7.84" +version = "0.7.85" description = "A Mithril Aggregator server" authors = { workspace = true } edition = { workspace = true } diff --git a/mithril-common/Cargo.toml b/mithril-common/Cargo.toml index 3c54662c771..8f5f401570d 100644 --- a/mithril-common/Cargo.toml +++ b/mithril-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-common" -version = "0.6.17" +version = "0.6.18" description = "Common types, interfaces, and utilities for Mithril nodes." authors = { workspace = true } edition = { workspace = true }