stacks-core
stacks-core copied to clipboard
Miner should extend from the latest sortition in which it mined blocks, not the latest sortition it won
This problem extends from the problem described in #6481:
- Miner A wins tenure N
- Miner A submits block commit confirming tenure N-1 before any of its blocks for tenure N have been approved
- Miner A mines 2 or more blocks in tenure N
- Miner A wins tenure N+1 with the block commit confirming N-1 (maybe it failed to RBF the block commit, or maybe it never tried for some reason)
- Miner A cannot mine a tenure change + coinbase in N+1 because it would be reorging its own blocks from tenure N
- With the fix from #6513, Miner A will now tenure extend from tenure N and continue mining
- In tenure N+2, the null miner wins, so Miner A should extend its tenure and continue mining
- Miner A attempts to mine from tenure N+1 instead of continuing tenure N, but these proposals are all rejected, since they are attempting to reorg