-
Notifications
You must be signed in to change notification settings - Fork 671
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
[Nakamoto] getsortition.rs try_handle_request does not actually attempt to return the last winning sortition correctly #4938
Comments
I can take this |
So, just a heads up, this is not what the node's API contract of this endpoint is. The API contract is to return data about a specific sortition, given one of a set of possible identifiers for it. If that sortition happens to be empty, then no data will be returned. But, I can change the node to always return the consensus hash of the last sortition with a winner |
Here you go. #4939 Can you add test coverage to this and verify that it does what the signer expects it to do? |
Will do! |
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. |
This function should be returning the last sortition with the winning commit. However, note the if statement returns none for the last_sortition_ch when the fetched block snapshot does not contain a winning sortition. Later in the signer we attempt to use this non existent consensus hash to find the last winning soritition which will of course always fail. Update getsortition.rs to properly fetch the last winning sortition. This can either be fixed inside getsortition.rs or in the chainstate.
See the following relevant sections:
stacks-core/stackslib/src/net/api/getsortition.rs
Line 216 in 19f753b
stacks-core/stacks-signer/src/chainstate.rs
Line 359 in 19f753b
The text was updated successfully, but these errors were encountered: