This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
rphmeier
added
A3-in_progress
Pull request is in progress. No review needed at this stage.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
labels
Dec 11, 2020
also add some key computation
rphmeier
added
A0-please_review
Pull request needs code review.
and removed
A3-in_progress
Pull request is in progress. No review needed at this stage.
labels
Feb 9, 2021
burdges
reviewed
Feb 10, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎊
burdges
reviewed
Feb 10, 2021
burdges
reviewed
Feb 10, 2021
ordian
reviewed
Feb 11, 2021
ordian
added a commit
that referenced
this pull request
Feb 11, 2021
* master: Implement Approval Voting Subsystem (#2112) Introduce PerPeerSet utility that allows to segrate based on PeerSet (#2420) [CI] Move check_labels to github actions (#2415) runtime: set equivocation report longevity (#2404) Companion for #7936: Migrate pallet-balances to pallet attribute macro (#2331) Corrected Physical (#2414) validator_discovery: cache by (Hash, ParaId) (#2402) Enable wasmtime caching for PVF (companion for #8057) (#2387) Use construct_runtime in tests, remove default PalletInfo impl (#2409) validator_discovery: pass PeerSet to the request (#2372) guide: more robust approval counting procedure (#2378) Publish rococo on every push to `rococo-v1` branch (#2388) Bump trie-db from 0.22.2 to 0.22.3 (#2344) Send view to new peers (#2392)
ordian
added a commit
that referenced
this pull request
Feb 11, 2021
* master: Implement Approval Voting Subsystem (#2112) Introduce PerPeerSet utility that allows to segrate based on PeerSet (#2420) [CI] Move check_labels to github actions (#2415) runtime: set equivocation report longevity (#2404) Companion for #7936: Migrate pallet-balances to pallet attribute macro (#2331) Corrected Physical (#2414) validator_discovery: cache by (Hash, ParaId) (#2402) Enable wasmtime caching for PVF (companion for #8057) (#2387) Use construct_runtime in tests, remove default PalletInfo impl (#2409) validator_discovery: pass PeerSet to the request (#2372) guide: more robust approval counting procedure (#2378) Publish rococo on every push to `rococo-v1` branch (#2388) Bump trie-db from 0.22.2 to 0.22.3 (#2344) Send view to new peers (#2392)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
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.
Closes #1975
This implements all the logic of the approval voting system.
Approval votes are split into two parts: Assignments and Approvals. Validators first broadcast their assignment to indicate intent to check a candidate. Upon successfully checking, they broadcast an approval vote. If a validator doesn't broadcast their approval vote shortly after issuing an assignment, this is an indication that they are being prevented from recovering or validating the block data and that more validators should self-select to check the candidate. This is known as a "no-show".
The core of this subsystem is a
Tick
-based timer loop, whereTick
s are 500ms. We also reason about time in terms ofDelayTranche
s, which measure the number of ticks elapsed since a block was produced. We track metadata for all un-finalized but included candidates. We compute our local assignments to check each candidate, as well as whichDelayTranche
those assignments may be minimally triggered at. As the same candidate may appear in more than one block, we must produce our potential assignments for each(Block, Candidate)
pair. The timing loop is based on waiting for assignments to become no-shows or waiting to broadcast and begin our own assignment to check.Another main component of this subsystem is the logic for determining when a
(Block, Candidate)
pair has been approved and when to broadcast and trigger our own assignment. Once a(Block, Candidate)
pair has been approved, we mark a corresponding bit in theBlockEntry
that indicates the candidate has been approved under the block. When we trigger our own assignment, we broadcast it via Approval Distribution, begin fetching the data from Availability Recovery, and then pass it through to the Candidate Validation. Once these steps are successful, we issue our approval vote. If any of these steps fail, we don't issue any vote and will "no-show" from the perspective of other validators. In the future we will initiate disputes as well.Where this all fits into Polkadot is via block finality. Our goal is to not finalize any block containing a candidate that is not approved. We provide a hook for a custom GRANDPA voting rule - GRANDPA makes requests of the form
(target, minimum)
consisting of a target block (i.e. longest chain) that it would like to finalize, and a minimum block which, due to the rules of GRANDPA, must be voted on. The minimum is typically the last finalized block, but may be beyond it, in the case of having a last-round-estimate beyond the last finalized. Thus, our goal is to inform GRANDPA of some block betweentarget
andminimum
which we believe can be finalized safely. We do this by iterating backwards from thetarget
to theminimum
and finding the longest continuous chain fromminimum
where all candidates included by those blocks have been approved.