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
* update signer logic to check node's tenure info after local state times out (do not consult local state for global acceptance status)
* update node get_tenuretip endpoint to return highest tip in tenure with canonical burn_view
* update proposal validation and mining logic to do the same
* update miner to be more defensive with burn_view check
/// 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
+
///
599
+
/// This updates the activity timer for the miner of `block`.
600
+
pubfncheck_latest_block_in_tenure(
601
+
tenure_id:&ConsensusHash,
603
602
block:&NakamotoBlock,
604
603
signer_db:&mutSignerDb,
605
604
client:&StacksClient,
606
605
tenure_last_block_proposal_timeout:Duration,
607
606
reorg_attempts_activity_timeout:Duration,
608
607
) -> 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
608
let last_block_info = Self::get_tenure_last_block_info(
612
-
&tenure_change.prev_tenure_consensus_hash,
609
+
tenure_id,
613
610
signer_db,
614
611
tenure_last_block_proposal_timeout,
615
612
)?;
@@ -636,7 +633,7 @@ impl SortitionsView {
636
633
// to give the miner some extra buffer time to wait for its chain tip to advance
637
634
// The miner may just be slow, so count this invalid block proposal towards valid miner activity.
0 commit comments