Skip to content

Commit f52dedc

Browse files
committed
fix: do not return when marking current sortition as invalid
The logic for checking the current sortition should be unrelated to the check of the latest proposal. This is a little unclear, so I added some comments to help.
1 parent 641c65e commit f52dedc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

stacks-signer/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1818
- Signers no longer view any block proposal by a miner in their DB as indicative of valid miner activity.
1919
- Various index improvements to the signer's database to improve performance.
2020
- Add new reject codes to the signer response for better visibility into why a block was rejected.
21-
- When allowing a reorg within the `reorg_attempts_activity_timeout_ms`, the signer will now watch the responses from other signers and if >30% of them reject this reorg attempt, then the signer will mark the miner as invalid, reject further attempts to reorg and allowing the previous miner to extend their tenure.
21+
- When allowing a reorg within the `reorg_attempts_activity_timeout_ms`, the signer will now watch the responses from other signers and if >30% of them reject this reorg attempt, then the signer will mark the miner as invalid, reject further attempts to reorg and allow the previous miner to extend their tenure.
2222

2323
## [3.1.0.0.5.0]
2424

stacks-signer/src/chainstate.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ impl SortitionsView {
213213
.cur_sortition
214214
.is_timed_out(self.config.block_proposal_timeout, signer_db)?
215215
{
216+
// Note that this is only checking the current sortition, and it is
217+
// not necessarily related to the proposal being checked. For this
218+
// reason, we do not return an error here, just set the state and
219+
// log what happened.
216220
info!(
217221
"Current miner timed out, marking as invalid.";
218222
"block_height" => block.header.chain_length,
@@ -246,14 +250,17 @@ impl SortitionsView {
246250
&self.config.first_proposal_burn_block_timing,
247251
)?;
248252
if !is_valid_parent_tenure {
253+
// Note that this is only checking the current sortition,
254+
// and it is not necessarily related to the proposal being
255+
// checked. For this reason, we do not return an error
256+
// here, just set the state and log what happened.
249257
warn!(
250258
"Current sortition does not build off of canonical tip tenure, marking as invalid";
251259
"current_sortition_parent" => ?self.cur_sortition.parent_tenure_id,
252260
"tip_consensus_hash" => ?tip.block.header.consensus_hash,
253261
);
254262
self.cur_sortition.miner_status =
255263
SortitionMinerStatus::InvalidatedBeforeFirstBlock;
256-
return Err(RejectReason::ReorgNotAllowed);
257264
}
258265
}
259266
}

0 commit comments

Comments
 (0)