Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: correct burn view for miner block broadcast #5515

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from
Open
Changes from 4 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9f3f197
Merge branch 'hotfix/proposal-loads-sortition-view-from-block' into f…
jcnelson Nov 27, 2024
91d0f96
chore: use get_block_burn_view()
jcnelson Nov 27, 2024
b0ebc18
Merge branch 'develop' into fix/burn-view
jcnelson Dec 3, 2024
0d7fbfa
Merge branch 'develop' into fix/burn-view
jcnelson Dec 4, 2024
c9f72e4
chore: add new integration test
jcnelson Dec 5, 2024
8533269
chore: make `MinerReason` debug-printable, and factor out fault injec…
jcnelson Dec 5, 2024
2f16742
fix: consider the possibility that the miner can neither begin a new …
jcnelson Dec 5, 2024
3b81155
chore: track the number of miner directives
jcnelson Dec 5, 2024
08fa52a
chore: integration test to verify that a continue-tenure might not be…
jcnelson Dec 5, 2024
0996fb1
Merge branch 'develop' into fix/burn-view
jcnelson Dec 5, 2024
b110f66
chore: more fixes to differentiate the miner's burn view from the bur…
jcnelson Dec 5, 2024
2d93f24
Merge branch 'fix/burn-view' of https://github.com/stacks-network/sta…
jcnelson Dec 5, 2024
9b53d70
chore: more checks on burn view changes
jcnelson Dec 6, 2024
c8974b2
Merge branch 'feat/time-based-tenure-extend' into fix/burn-view
jcnelson Dec 7, 2024
8be6f90
Merge branch 'feat/time-based-tenure-extend' into fix/burn-view
jcnelson Dec 9, 2024
22a9815
Merge branch 'develop' into fix/burn-view
jcnelson Dec 9, 2024
4c9155b
Cargo fmt
jferrant Dec 10, 2024
eb62628
chore: record last sortition
jcnelson Dec 15, 2024
93cf523
chore: remove EmptyTenure miner reason, since it shouldn't ever be used
jcnelson Dec 15, 2024
a7a0b19
chore: factor logic for checking for a tenure-extend into a single fu…
jcnelson Dec 15, 2024
a2f010e
chore; drop needs_initial_block
jcnelson Dec 15, 2024
48e7468
test: finish check that the hotfix ensures that the correct burn view…
jcnelson Dec 15, 2024
f488b35
chore: delete old code
jcnelson Dec 15, 2024
73821ad
Merge branch 'fix/burn-view' of https://github.com/stacks-network/sta…
jcnelson Dec 15, 2024
818c064
Merge branch 'develop' into fix/burn-view
jcnelson Dec 16, 2024
06e2764
chore: clean up compile error and warnings
jcnelson Dec 16, 2024
fd28d81
Merge branch 'fix/burn-view' of https://github.com/stacks-network/sta…
jcnelson Dec 16, 2024
7abaaca
feat: tenure_extend_wait_secs: a config option to wait for a block-fo…
jcnelson Dec 20, 2024
06096ee
fix: allow a BlockFound to be produced if the Relayer determines that…
jcnelson Dec 20, 2024
7631f41
chore: fix choose_miner_directive() to attempt to continue a tenure i…
jcnelson Dec 20, 2024
0f7ada4
chore: fix tests
jcnelson Dec 20, 2024
6b18429
chore: expect a TenureExtend for a flash block
jcnelson Dec 20, 2024
1819f2a
Merge branch 'develop' into fix/burn-view
jcnelson Dec 20, 2024
f146ade
Merge branch 'develop' into fix/burn-view
jcnelson Jan 4, 2025
70833cd
refactor: use `TestFlag` for more flags
obycode Jan 9, 2025
6fe5d2d
fix: pause Stacks mining while mining blocks for miner eligibility
obycode Jan 9, 2025
911560c
test: add wait to ensure tip has advanced
obycode Jan 9, 2025
1c31090
test: add new test for tenure extend
obycode Jan 9, 2025
24193f8
Merge branch 'develop' into fix/burn-view
jcnelson Jan 13, 2025
9de3f84
fix: `won_sortition` calculation in relayer
obycode Jan 13, 2025
5590ec0
chore: get tenure_extend_after_failed_miner to pass
jcnelson Jan 13, 2025
45028e4
Merge branch 'fix/burn-view' of https://github.com/stacks-network/sta…
jcnelson Jan 13, 2025
27519c3
chore: expand test_tenure_extend_from_flashblocks to check that all b…
jcnelson Jan 13, 2025
17d6edc
fix: build issue; fix relayer to always start a new tenure if the cur…
jcnelson Jan 13, 2025
99d3eff
test: change VRF proof calculation to test a comment from @obycode
jcnelson Jan 13, 2025
49d5d65
Merge branch 'develop' into fix/burn-view
jcnelson Jan 14, 2025
262ee7d
chore: revert to LazyStatic
jcnelson Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion testnet/stacks-node/src/nakamoto_node/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,12 @@ impl BlockMinerThread {
return Ok(());
}

let mut sortition_handle = sort_db.index_handle_at_ch(&block.header.consensus_hash)?;
let parent_block_info =
NakamotoChainState::get_block_header(chain_state.db(), &block.header.parent_block_id)?
.ok_or_else(|| ChainstateError::NoSuchBlockError)?;
let burn_view_ch =
NakamotoChainState::get_block_burn_view(sort_db, &block, &parent_block_info)?;
let mut sortition_handle = sort_db.index_handle_at_ch(&burn_view_ch)?;
let chainstate_config = chain_state.config();
let (headers_conn, staging_tx) = chain_state.headers_conn_and_staging_tx_begin()?;
let accepted = NakamotoChainState::accept_block(
Expand Down