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

Signers should capitulate on allowing a reorg on badly timed block #5820

Open
obycode opened this issue Feb 10, 2025 · 3 comments
Open

Signers should capitulate on allowing a reorg on badly timed block #5820

obycode opened this issue Feb 10, 2025 · 3 comments
Assignees
Milestone

Comments

@obycode
Copy link
Contributor

obycode commented Feb 10, 2025

Currently, a tenure can be reorged when the next Bitcoin block arrives within first_proposal_burn_block_timing_secs of the first block proposal in that tenure. This ensures that an honest miner is not punished because of bad timing of the previous miner and the next Bitcoin block.

This can lead to a standstill scenario when some of the signers, more than 30% but less than 70%, saw the timing which would allow the reorg and the rest of the signers, also more than 30% but less than 70%, saw the timing which would not allow the reorg. In this case, the miner of block N-1 would be rejected when it attempts to tenure extend and the miner of block N would be rejected when it attempts to reorg. This tie will never be broken until the next Bitcoin block arrives, meaning the chain is stalled.

A solution to this problem would be to have the signers that are attempting to allow the reorg to capitulate, and allow the tenure extend if it determines that the reorg will not be accepted by the network.

My initial, simple proposal is to accept the reorg from miner N on the first proposal, but if that reorg attempt is rejected by the network, then they should accept the next attempt to tenure extend from miner N-1 and reject any further attempts to reorg from miner N.

@diwakergupta
Copy link
Member

This can lead to a standstill scenario when some of the miners, more than 30% but less than 70%, saw the timing which would allow the reorg and the rest of the miners, also more than 30% but less than 70%, saw the timing which would not allow the reorg.

Did you mean signers instead of miners here?

@obycode
Copy link
Contributor Author

obycode commented Feb 10, 2025

Did you mean signers instead of miners here?

Yes, fixed. Thanks!

@obycode
Copy link
Contributor Author

obycode commented Feb 10, 2025

Additional comments from @kantai:

I think we’d want to use the proposal reject reason code for this
Like, the signers know when a proposal crosses the reject threshold
But they need to know if it’s because the tenure reorg was bad (different from just not confirming enough blocks)
And then they should mark that miner as invalid in the chain state sortition tracking struct
And we want to make sure that decision propagates if there’s an empty sortition

@aldur aldur added this to the 3.1.0.0.6 milestone Feb 11, 2025
@aldur aldur moved this from Status: 🆕 New to Status: 📋 Backlog in Stacks Core Eng Feb 11, 2025
@obycode obycode moved this from Status: 📋 Backlog to Status: 💻 In Progress in Stacks Core Eng Feb 11, 2025
obycode added a commit that referenced this issue Feb 12, 2025
These codes provide more insight into why a signer rejected a block and
will be used for implementing the changes in #5820.
obycode added a commit that referenced this issue Feb 12, 2025
These codes provide more insight into why a signer rejected a block and
will be used for implementing the changes in #5820.
obycode added a commit that referenced this issue Feb 14, 2025
This test verifies that a signer will mark a miner as invalid if it
initially accepts a reorg from the miner, but after seeing that >30% of
other signers reject the reorg, it will mark it as invalid.

See #5820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: 💻 In Progress
Development

No branches or pull requests

3 participants