Closed obycode closed 2 months ago
This still needs an integration test.
Plan for integration test:
Plan for integration test:
- Two miners
- Miner A finishes a tenure and miner B submits a block commit before seeing the last block of A's tenure
- B's commit is committing to a block (of A's) that has something like 4 tx's
- Then, B gets the new block from A and builds off of it
- When B tries to make a block, it only has two tx's available, because 2 of them were in A's last block
- Without this PR's change, the miner would get stuck. The test should verify that B can make the new block just fine
This sounds good, except in the last bullet, it's not that the miner would get stuck, but it would mine a sibling block, instead of building off of the latest tip, so we would not see the chain length increase and we would see two blocks at the same height.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
When mining, if the Stacks tip changes, then we no longer want to compare the transaction count of a newly mined block with that of the previously mined block, since the previous block is now a reorg.
Fixes #5157.