Skip to content

Commit

Permalink
Merge pull request #5103 from stacks-network/hotfix/mock-signature-me…
Browse files Browse the repository at this point in the history
…ssage-slot

Reuse BlockResponse slot for MockSignature message type
  • Loading branch information
wileyj committed Aug 22, 2024
2 parents 75df60f + ee28db9 commit 4daf74d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions libsigner/src/v0/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ impl SignerMessage {
pub fn msg_id(&self) -> Option<MessageSlotID> {
match self {
Self::BlockProposal(_) | Self::BlockPushed(_) => None,
Self::BlockResponse(_) => Some(MessageSlotID::BlockResponse),
Self::MockSignature(_) => Some(MessageSlotID::MockSignature),
Self::BlockResponse(_) | Self::MockSignature(_) => Some(MessageSlotID::BlockResponse), // Mock signature reuses the same slot as block response since its exclusively used in Epoch 2.5
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions testnet/stacks-node/src/tests/signer/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2212,8 +2212,8 @@ fn mock_sign_epoch_25() {
std::thread::sleep(Duration::from_millis(100));
let messages: Vec<SignerMessage> = StackerDB::get_messages(
stackerdb
.get_session_mut(&MessageSlotID::MockSignature)
.expect("Failed to get BlockResponse stackerdb session"),
.get_session_mut(&MessageSlotID::BlockResponse)
.expect("Failed to get BlockResponse stackerdb session"), // Epoch 2.5 MockSignatures use the BlockResponse slot
&signer_slot_ids,
)
.expect("Failed to get message from stackerdb");
Expand Down

0 comments on commit 4daf74d

Please sign in to comment.