Polkadot’s Consensus Mechanism

PART- 1 : Selection of Validators

  • Nominators are the DOT holders who nominate a validator by backing them with DOT tokens to participate in the consensus process.
  • Validators run their own full nodes and participate in consensus. They run hardware and are backed by Nominators’ DOT tokens.

Few terminologies before continuing:

  • Era: 24 hours time period for which a set of validators are selected.
  • Active Set: The set of Validators who are actively participating in consensus and receiving staking rewards.
  • Waiting Set: Set of Validators who couldn’t enter the active set maybe because of low nominator backing than threshold value.
  • back high staked validator so that enters Active Set; so nominator will also receive rewards
  • back Validator with least stakes in Active Set; to maximize rewards
  • make sure he is not backing a Validator with already 256 nominators, as only top 256 nominators are rewarded per Validator.

Nakamoto Coefficient

PART- 2 : Block Production

How are Validators selected for Block Production?

credits: polkadot wiki
  1. If RESULT < THRESHOLD, that particular Validator is a block production candidate, i.e. he will produce a new block in that slot. This Validator will submit the blocks to the network along with the PROOF that is generated in execution of the VRF function.
  2. If RESULT > THRESHOLD, the Validator will collect blocks and verify signature and check if Validator is the actual Slot Leader by checking the PROOF submitted by the Validator.
  • The slot has only 1 block production candidate (for only 1 Validator, RESULT < THRESHOLD)
  • The slot has multiple block production candidate ( for multiple Validators, RESULT < THRESHOLD)
  • The slot has zero block production candidate ( for no Validator, RESULT < THRESHOLD)
VRF Validator Selection and 3 Cases

Case 1: Only 1 block production Candidate

Case 2: Multiple Candidates

Case 3: No Candidates

PART- 3 : Block Finalization

FORK RULE

  • It should start from the most recent GRANDPA finalized block.
  • It should have the most number of Primary Blocks.

For A:

  1. Chains starts from most recent finalized block ? YES. Starts from F2.
  2. Chain has most primary blocks? NO. Chain is longest but only 1 primary block.

For B:

  1. Chains starts from most recent finalized block ? YES
  2. Chain has most primary blocks? YES. Not the longest chain but has most Primary blocks.

For C:

  1. Chains starts from most recent finalized block ? YES
  2. Chain has most primary blocks? NO. Only 2 primary blocks.

For D:

  1. Chains starts from most recent finalized block ? NO
  2. Chain has most primary blocks? Doesn’t matter as Condition 1 is false.

Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store