@@ -78,8 +78,14 @@ const ABORT_TRY_AGAIN_MS: u64 = 200;
78
78
pub enum MinerDirective {
79
79
/// The miner won sortition so they should begin a new tenure
80
80
BeginTenure {
81
+ /// This is the block ID of the first block in the parent tenure
81
82
parent_tenure_start : StacksBlockId ,
83
+ /// This is the snapshot that this miner won, and will produce a tenure for
82
84
burnchain_tip : BlockSnapshot ,
85
+ /// This is `true` if the snapshot above is known not to be the the latest burnchain tip,
86
+ /// but an ancestor of it (for example, the burnchain tip could be an empty flash block, but the
87
+ /// miner may nevertheless need to produce a Stacks block with a BlockFound tenure-change
88
+ /// transaction for the tenure began by winning `burnchain_tip`'s sortition).
83
89
late : bool ,
84
90
} ,
85
91
/// The miner should try to continue their tenure if they are the active miner
@@ -110,7 +116,17 @@ struct ParentStacksBlockInfo {
110
116
#[ derive( PartialEq , Clone , Debug ) ]
111
117
pub enum MinerReason {
112
118
/// The miner thread was spawned to begin a new tenure
113
- BlockFound { late : bool } ,
119
+ BlockFound {
120
+ /// `late` indicates whether or not the tenure that is about to be started corresponds to
121
+ /// an ancestor of the canonical tip. This can happen if this miner won the highest
122
+ /// sortition, but that sortition's snapshot is not the canonical tip (e.g. the canonical
123
+ /// tip may have no sortition, but its parent (or Nth ancestor) would have had a sortition
124
+ /// that this miner won, and it would be the latest non-empty sortition ancestor of the
125
+ /// tip). This indication is important because the miner would issue a BlockFound
126
+ /// tenure-change, and then issue an Extended tenure-change right afterwards in order to
127
+ /// update the burnchain view exposed to Clarity for the highest sortition.
128
+ late : bool
129
+ } ,
114
130
/// The miner thread was spawned to extend an existing tenure
115
131
Extended {
116
132
/// Current consensus hash on the underlying burnchain. Corresponds to the last-seen
@@ -1015,7 +1031,7 @@ impl BlockMinerThread {
1015
1031
} else {
1016
1032
self . keychain . generate_proof (
1017
1033
self . registered_key . target_block_height ,
1018
- self . burn_block . sortition_hash . as_bytes ( ) ,
1034
+ self . burn_election_block . sortition_hash . as_bytes ( ) ,
1019
1035
)
1020
1036
} ;
1021
1037
@@ -1372,7 +1388,7 @@ impl BlockMinerThread {
1372
1388
// ongoing tenure is not an ancestor of the given burn view, so it must have
1373
1389
// advanced (or forked) relative to the given burn view. Either way, this burn
1374
1390
// view has changed.
1375
- info ! ( "Nakamoto chainstate burn view has changed from miner burn view" ;
1391
+ info ! ( "Nakamoto chainstate burn view has advanced from miner burn view" ;
1376
1392
"nakamoto_burn_view" => %ongoing_tenure_id. burn_view_consensus_hash,
1377
1393
"miner_burn_view" => %burn_view. consensus_hash) ;
1378
1394
@@ -1390,8 +1406,6 @@ impl BlockMinerThread {
1390
1406
sortdb : & SortitionDB ,
1391
1407
chain_state : & mut StacksChainState ,
1392
1408
) -> Result < ( ) , NakamotoNodeError > {
1393
- Self :: check_burn_view_changed ( sortdb, chain_state, & self . burn_block ) ?;
1394
-
1395
1409
if let MinerReason :: BlockFound { late } = & self . reason {
1396
1410
if * late && self . last_block_mined . is_none ( ) {
1397
1411
// this is a late BlockFound tenure change that ought to be appended to the Stacks
0 commit comments