From d488bf9a434e9a070a2dc576163c39ca174c3f54 Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Fri, 9 Oct 2026 19:34:10 +0300 Subject: [PATCH] fix for https://ghostforum.org/t/pallets-exodus-round-5-to-6-bitmap-intersection-desyncs-the-proof-gate-for-dense-validator-sets-dkg-restart-loop-on-ordinary-dropouts/168 Signed-off-by: Uncle Stretch --- pallets/exodus/Cargo.toml | 2 +- pallets/exodus/src/lib.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pallets/exodus/Cargo.toml b/pallets/exodus/Cargo.toml index e5d13ca..0901ceb 100644 --- a/pallets/exodus/Cargo.toml +++ b/pallets/exodus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-exodus" -version = "0.0.23" +version = "0.0.24" description = "Threshold signature generation with DKG included" license.workspace = true authors.workspace = true diff --git a/pallets/exodus/src/lib.rs b/pallets/exodus/src/lib.rs index f47df9d..22d8c95 100644 --- a/pallets/exodus/src/lib.rs +++ b/pallets/exodus/src/lib.rs @@ -1894,7 +1894,7 @@ pub mod pallet { DkgPhase::Round2 => DkgRemovalResult::new(|| Self::prepare_round3_storage(network_curve, &mut dkg_qualification, maybe_cursor)), DkgPhase::Round3 => DkgRemovalResult::new(|| Self::prepare_round4_storage(network_curve, min_threshold, &mut dkg_qualification, maybe_cursor)), DkgPhase::Round4 => DkgRemovalResult::new(|| Self::prepare_round5_storage(network_curve, min_threshold, &mut dkg_qualification, maybe_cursor)), - DkgPhase::Round5 => DkgRemovalResult::new(|| Self::prepare_round6_storage(network_curve, &mut dkg_qualification, maybe_cursor)), + DkgPhase::Round5 => DkgRemovalResult::new(|| Self::prepare_round6_storage(network_curve, min_threshold, &mut dkg_qualification, maybe_cursor)), DkgPhase::Round6 => DkgRemovalResult::new(|| Self::prepare_round7_storage(network_curve, min_threshold, &mut dkg_qualification, maybe_cursor)), DkgPhase::Round7 => DkgRemovalResult::new(|| Self::prepare_finalization_storage(network_curve, &mut dkg_qualification, maybe_cursor)), DkgPhase::Finalized => return weight, @@ -2485,6 +2485,7 @@ impl Pallet { fn prepare_round6_storage( network_curve: NetworkCurve, + min_threshold: AuthIndex, dkg_qualification: &mut QualifyingState, maybe_cursor: Option>, ) -> (Weight, bool) { @@ -2514,7 +2515,9 @@ impl Pallet { weight.saturating_accrue(T::DbWeight::get().reads(1)); let state = VerifyingKeyConsensus::::get(&network_curve, &dkg_index); - dkg_qualification.intersect_indexes(&state.participants); + if state.participants.count_ones::() < min_threshold { + dkg_qualification.nullify_indexes(); + } }) }