Skip to content

Commit 53e670f

Browse files
authored
Merge pull request #5691 from stacks-network/test/allow_reorg_within_first_proposal_burn_block_timing_secs
Ensure miner builds on its own blocks when reorging due to badly timed blocks
2 parents 6e9a42d + cf38139 commit 53e670f

File tree

4 files changed

+537
-2
lines changed

4 files changed

+537
-2
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ jobs:
147147
- tests::signer::v0::multiple_miners_empty_sortition
148148
- tests::signer::v0::block_proposal_timeout
149149
- tests::signer::v0::rejected_blocks_count_towards_miner_validity
150+
- tests::signer::v0::allow_reorg_within_first_proposal_burn_block_timing_secs
150151
- tests::nakamoto_integrations::burn_ops_integration_test
151152
- tests::nakamoto_integrations::check_block_heights
152153
- tests::nakamoto_integrations::clarity_burn_state

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1414
Previously, the miner had difficulty restarting their missed tenure and extending into the new
1515
bitcoin block, leading to 1-2 bitcoin blocks of missed Stacks block production.
1616

17+
## Changed
18+
19+
- When a miner reorgs the previous tenure due to a poorly timed block, it can now continue to build blocks on this new chain tip (#5691)
20+
1721
## [3.1.0.0.3]
1822

1923
### Added

testnet/stacks-node/src/nakamoto_node/miner.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,8 @@ impl BlockMinerThread {
932932
})?;
933933

934934
let stacks_tip_block_id = StacksBlockId::new(&stacks_tip_ch, &stacks_tip_bh);
935-
let tenure_tip_opt = NakamotoChainState::get_highest_block_header_in_tenure(
935+
let tenure_tip_opt = NakamotoChainState::get_highest_known_block_header_in_tenure(
936936
&mut chain_state.index_conn(),
937-
&stacks_tip_block_id,
938937
&self.burn_election_block.consensus_hash,
939938
)
940939
.map_err(|e| {

0 commit comments

Comments
 (0)