Skip to content

Commit 19e4d42

Browse files
committed
chore: more logging when rejecting time-based extend
1 parent c0da03e commit 19e4d42

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

stacks-signer/src/chainstate.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,19 @@ impl SortitionsView {
365365
let sortition_consensus_hash = proposed_by.state().consensus_hash;
366366
let changed_burn_view =
367367
tenure_extend.burn_view_consensus_hash != sortition_consensus_hash;
368-
let enough_time_passed = get_epoch_time_secs()
369-
> signer_db.calculate_tenure_extend_timestamp(
370-
self.config.tenure_idle_timeout,
371-
&sortition_consensus_hash,
372-
);
368+
let extend_timestamp = signer_db.calculate_tenure_extend_timestamp(
369+
self.config.tenure_idle_timeout,
370+
&sortition_consensus_hash,
371+
);
372+
let epoch_time = get_epoch_time_secs();
373+
let enough_time_passed = epoch_time > extend_timestamp;
373374
if !changed_burn_view && !enough_time_passed {
374375
warn!(
375376
"Miner block proposal contains a tenure extend, but the burnchain view has not changed and enough time has not passed to refresh the block limit. Considering proposal invalid.";
376377
"proposed_block_consensus_hash" => %block.header.consensus_hash,
377378
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
379+
"extend_timestamp" => extend_timestamp,
380+
"epoch_time" => epoch_time,
378381
);
379382
return Ok(false);
380383
}

0 commit comments

Comments
 (0)