Skip to content

Commit

Permalink
Merge pull request #5368 from stacks-network/fix/signing-in-0th-tenure
Browse files Browse the repository at this point in the history
signing_in_0th_tenure_of_reward_cycle fix: only check signers who match signatures on the block
  • Loading branch information
jferrant authored Oct 23, 2024
2 parents f299dd1 + 18ea947 commit 4bf673f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion testnet/stacks-node/src/tests/signer/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5316,7 +5316,19 @@ fn signing_in_0th_tenure_of_reward_cycle() {
})
.unwrap();

for signer in &signer_public_keys {
let block_mined = test_observer::get_mined_nakamoto_blocks()
.last()
.unwrap()
.clone();
// Must ensure that the signers that signed the block have their blocks_signed updated appropriately
for signature in &block_mined.signer_signature {
let signer = signer_public_keys
.iter()
.find(|pk| {
pk.verify(block_mined.signer_signature_hash.as_bytes(), signature)
.unwrap()
})
.expect("Unknown signer signature");
let blocks_signed = get_v3_signer(&signer, next_reward_cycle);
assert_eq!(blocks_signed, 1);
}
Expand Down

0 comments on commit 4bf673f

Please sign in to comment.