-
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
Feat: sortition state tracking in signer #4801
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hstove
force-pushed
the
feat/header-signer-signatures
branch
from
May 16, 2024 20:49
0025174
to
da6dad1
Compare
jferrant
reviewed
May 17, 2024
jferrant
reviewed
May 17, 2024
jferrant
reviewed
May 17, 2024
jferrant
reviewed
May 17, 2024
jferrant
reviewed
May 17, 2024
jferrant
reviewed
May 17, 2024
Thanks for the comments @jferrant -- I will work through them and also rebase with the latest from the parent branch. |
kantai
force-pushed
the
feat/signer-stacks-state
branch
from
May 20, 2024 16:48
55d3f92
to
9627fec
Compare
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
jcnelson
reviewed
May 20, 2024
kantai
dismissed stale reviews from jcnelson and jferrant
June 4, 2024 20:21
The base branch was changed.
jcnelson
previously approved these changes
Jun 5, 2024
jferrant
previously approved these changes
Jun 5, 2024
Hopefully the last round of re-reviews, here! |
jcnelson
approved these changes
Jun 5, 2024
jferrant
approved these changes
Jun 5, 2024
5 tasks
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new module
chainstate
to the signer binary. This module contains a structSortitionsView
which tracks information about the most recent sortitions from thestacks-node
. It obtains this information from a new RPC endpoint in thestacks-node
. The struct caches this information (controlled via thefresh
flag). To integrate it with the signer binary, on burnchain events, this flag should be flipped.This sortitions view applies a bunch of "good behavior" checks on submitted
NakamotoBlock
s. It checks:parent_tenure_id
is a valid choice (it should not reorg another tenure, but if it does, it should be because the prior tenure was empty).There are some
TODO
s left in the PR. These mostly will require additional state tracking in the signer binary:On top of this, there's I think another TODO. This PR uses
signed_off
as the indicator of whether or not a block should be considered "must confirm". This is a local-only policy, which is great, but it's not the one this should eventually ship with. Instead, signers should track the threshold of signatures (gathering them just like the miner does). This will allow signers to broadcast the block if the miner fails to do so, but it will also allow signers to mark blocks assigned_off
andthreshold_reached
. This should be follow-on work from this PR (will open an issue).Note: the checks in this struct depend on the stacks-node's block validation endpoint to do a bunch of other checks. The reason that things like checking the
parent_tenure_id
as it does are sufficient is that thestacks-node
itself enforces the match between the sortition'sparent_tenure_id
and the tenure change payload in the block.