Skip to content

Commit b4432a7

Browse files
committed
Use the local supported version by default if no consensus is found
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent e219173 commit b4432a7

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

stacks-signer/src/v0/signer.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -715,25 +715,23 @@ impl Signer {
715715
block: &NakamotoBlock,
716716
) -> Option<BlockResponse> {
717717
// First update our global state evaluator with our local state if we have one
718-
let version = self.get_signer_protocol_version();
718+
let local_version = self.get_signer_protocol_version();
719719
if let Ok(update) = self
720720
.local_state_machine
721-
.try_into_update_message_with_version(version)
721+
.try_into_update_message_with_version(local_version)
722722
{
723723
self.global_state_evaluator
724724
.insert_update(self.stacks_address, update);
725725
};
726-
let Some(latest_version) = self
727-
.global_state_evaluator
728-
.determine_latest_supported_signer_protocol_version()
729-
else {
726+
let latest_version = self
727+
.global_state_evaluator
728+
.determine_latest_supported_signer_protocol_version()
729+
.unwrap_or_else(|| {
730730
warn!(
731-
"{self}: No consensus on signer protocol version. Unable to validate block. Rejecting.";
732-
"signer_signature_hash" => %block.header.signer_signature_hash(),
733-
"block_id" => %block.block_id(),
731+
"{self}: No consensus on signer protocol version. Defaulting to local supported version: {local_version}"
734732
);
735-
return Some(self.create_block_rejection(RejectReason::NoSignerConsensus, block));
736-
};
733+
local_version
734+
});
737735
let state_version = SortitionStateVersion::from_protocol_version(latest_version);
738736
if state_version.uses_global_state() {
739737
self.check_block_against_global_state(stacks_client, block)

0 commit comments

Comments
 (0)