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

Interrupt miner when Stacks tip changes #5751

Closed
obycode opened this issue Jan 27, 2025 · 1 comment
Closed

Interrupt miner when Stacks tip changes #5751

obycode opened this issue Jan 27, 2025 · 1 comment
Labels
optimization Update speed, efficiency, or quality of a feature.

Comments

@obycode
Copy link
Contributor

obycode commented Jan 27, 2025

This is an optimization to improve the time it takes to mine the first valid block in a tenure. When mining a tenure, the miner thread should get interrupted when the tip advances. The way it currently works, at the beginning of a tenure, the miner will often start mining its first block before it sees the last block of the previous tenure. If that last block is accepted and the miner's tip advances, the miner finishes building the block and proposing it to the signers any way. Instead, the miner should stop building its current block, or stop waiting for signatures, since it knows that it will be rejected by 70+% of the signers for not confirming that last block. It can then quickly build a new block atop the new tip.

@obycode obycode added the optimization Update speed, efficiency, or quality of a feature. label Jan 27, 2025
@github-project-automation github-project-automation bot moved this to Status: 🆕 New in Stacks Core Eng Jan 27, 2025
@aldur aldur changed the title Interrupt miner when tip changes Interrupt miner when Stacks tip changes Jan 29, 2025
obycode added a commit that referenced this issue Feb 4, 2025
This could happen at the beginning of a tenure, if the miner for tenure
T+1 proposes its first block before it sees the last block from tenure
T, so the block it proposed is reorging that last block. Once it sees
this block, it should immediately stop waiting for signatures and
instead build a new block off of the new tip.

Fixes: #5751
@obycode
Copy link
Contributor Author

obycode commented Feb 7, 2025

Fixed with #5801

@obycode obycode closed this as completed Feb 7, 2025
@github-project-automation github-project-automation bot moved this from Status: 🆕 New to Status: ✅ Done in Stacks Core Eng Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Update speed, efficiency, or quality of a feature.
Projects
Status: Status: ✅ Done
Development

No branches or pull requests

1 participant