Skip to content

Commit

Permalink
Signature mismatch fix (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacholme7 authored Feb 17, 2025
1 parent fdba58d commit f5c09c8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions anchor/common/ssv_types/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,19 @@ impl SignedSSVMessage {
self.operator_ids.extend(signed_msg.operator_ids);
}

self.signatures.sort();
self.operator_ids.sort();
// Maintain id <-> sig pairing during sorting
let mut sig_pairs: Vec<_> = self
.signatures
.iter()
.cloned()
.zip(self.operator_ids.iter())
.collect();

sig_pairs.sort_by_key(|&(_, op_id)| *op_id);

let (sorted_signatures, sorted_operator_ids) = sig_pairs.into_iter().unzip();
self.signatures = sorted_signatures;
self.operator_ids = sorted_operator_ids;
}

// Validate the signed message to ensure that it is well formed for qbft processing
Expand Down

0 comments on commit f5c09c8

Please sign in to comment.