Skip to content

Commit 77d5259

Browse files
committed
test: add mark_miner_as_invalid_if_reorg_is_rejected
This test verifies that a signer will mark a miner as invalid if it initially accepts a reorg from the miner, but after seeing that >30% of other signers reject the reorg, it will mark it as invalid. See #5820
1 parent ce5d2a3 commit 77d5259

File tree

3 files changed

+384
-879
lines changed

3 files changed

+384
-879
lines changed

stacks-signer/src/chainstate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl SortitionsView {
253253
);
254254
self.cur_sortition.miner_status =
255255
SortitionMinerStatus::InvalidatedBeforeFirstBlock;
256+
return Err(RejectReason::ReorgNotAllowed);
256257
}
257258
}
258259
}

testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ impl StackerDBListener {
391391
"signer_weight" => signer_entry.weight,
392392
"total_weight_signed" => block.total_weight_signed,
393393
"reason" => rejected_data.reason,
394-
"reason_code" => %rejected_data.reason_code,
394+
"reason_code" => ?rejected_data.reason_code,
395395
"tenure_extend_timestamp" => rejected_data.response_data.tenure_extend_timestamp,
396396
"server_version" => rejected_data.metadata.server_version,
397397
);

0 commit comments

Comments
 (0)