You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Check if the tenure change block confirms the expected parent block
594
-
/// (i.e., the last locally accepted block in the parent tenure, or if that block is timed out, the last globally accepted block in the parent tenure)
595
-
/// It checks the local DB first, and if the block is not present in the local DB, it asks the
596
-
/// Stacks node for the highest processed block header in the given tenure (and then caches it
597
-
/// in the DB).
594
+
/// Check whether or not `block` is higher than the highest block in `tenure_id`.
595
+
/// returns `Ok(true)` if `block` is higher, `Ok(false)` if not.
598
596
///
599
-
/// The rationale here is that the signer DB can be out-of-sync with the node. For example,
600
-
/// the signer may have been added to an already-running node.
601
-
pubfncheck_tenure_change_confirms_parent(
602
-
tenure_change:&TenureChangePayload,
597
+
/// If we can't look up `tenure_id`, assume `block` is higher.
598
+
/// This assumption is safe because this proposal ultimately must be passed
599
+
/// to the `stacks-node` for proposal processing: so, if we pass the block
600
+
/// height check here, we are relying on the `stacks-node` proposal endpoint
601
+
/// to do the validation on the chainstate data that it has.
602
+
///
603
+
/// This updates the activity timer for the miner of `block`.
604
+
pubfncheck_latest_block_in_tenure(
605
+
tenure_id:&ConsensusHash,
603
606
block:&NakamotoBlock,
604
607
signer_db:&mutSignerDb,
605
608
client:&StacksClient,
606
609
tenure_last_block_proposal_timeout:Duration,
607
610
reorg_attempts_activity_timeout:Duration,
608
611
) -> Result<bool,ClientError>{
609
-
// If the tenure change block confirms the expected parent block, it should confirm at least one more block than the last accepted block in the parent tenure.
610
-
// NOTE: returns the locally accepted block if it is not timed out, otherwise it will return the last globally accepted block.
611
612
let last_block_info = Self::get_tenure_last_block_info(
612
-
&tenure_change.prev_tenure_consensus_hash,
613
+
tenure_id,
613
614
signer_db,
614
615
tenure_last_block_proposal_timeout,
615
616
)?;
@@ -636,7 +637,7 @@ impl SortitionsView {
636
637
// to give the miner some extra buffer time to wait for its chain tip to advance
637
638
// The miner may just be slow, so count this invalid block proposal towards valid miner activity.
0 commit comments