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

/v3/sortitions bad optimization for last_sortition_ch #5252

Closed
kantai opened this issue Sep 27, 2024 · 1 comment
Closed

/v3/sortitions bad optimization for last_sortition_ch #5252

kantai opened this issue Sep 27, 2024 · 1 comment

Comments

@kantai
Copy link
Member

kantai commented Sep 27, 2024

last_sortition_ch is wrong in the /v3/sortitions endpoint. My recent consolidation PR changed this optimization:

// optimization heuristic: short-circuit the load if its just `stacks_parent_sn`
let last_sortition_ch = if sortition_sn.num_sortitions == stacks_parent_sn.num_sortitions + 1 {
    stacks_parent_sn.consensus_hash.clone()

To this:

// optimization heuristic: short-circuit the load if its just `stacks_parent_sn`
let last_sortition_ch = if stacks_parent_sn.sortition {
    stacks_parent_sn.consensus_hash.clone()

This is just wrong, and it leads to signers rejecting some proposals that they shouldn't (and accepting some proposals that they shouldn't).

@kantai kantai added bug Unwanted or unintended property causing functional harm testnet 3.0-must 3.0-Hardfork-Bugs and removed bug Unwanted or unintended property causing functional harm testnet labels Sep 27, 2024
@jferrant jferrant closed this as completed Oct 1, 2024
@blockstack-devops
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Status: ✅ Done
Development

No branches or pull requests

3 participants