Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Parity's Aura consensus protocol work?

Here it's a very high level description with only formulas. I want to understand actually how it works.

I don't actually understand what a step is and what's it's use? Does a node always keep updating the step? And when time to create to create and broadcast a block comes it will take the current step value and check if he should broadcast or not.

What do you mean by "Blocks from more than 1 step into the future are rejected."? Does this mean that if block time is 5 seconds then the next block timestamp should be exactly 5 seconds higher.

And also what happens when the next primary doesn't broadcast? How does the network deal with it? All the next blocks should get invalidated right because they won't follow a timestamp difference of 5 seconds.

like image 953
Narayan Prusty Avatar asked Apr 18 '17 06:04

Narayan Prusty


People also ask

What consensus mechanism does polkadot use?

Polkadot (DOT) uses the nominated proof-of-stake (PoS) consensus algorithm. Polkadot uses parachains and a relay chain to facilitate a much more scalable blockchain ecosystem. The protocol's bridges allow different blockchain networks to interact with each other.

What does a consensus protocol do?

A consensus protocol prevents a single entity from controlling a blockchain or distorting the “truth” of what should be recorded. Double spending is an example of what could happen if one entity tried to take control of the entire network by creating its own version of the blockchain.

Does polkadot use POW?

Polkadot uses NPoS (Nominated Proof-of-Stake) as its mechanism for selecting the validator set. It is designed with the roles of validators and nominators, to maximize chain security. Actors who are interested in maintaining the network can run a validator node.


1 Answers

AuRa is the name for Parity's Proof-of-Authority (PoA) consensus engine, the name originally comes from Authority Round (used to be AuRo). It's used in the Kovan network.

PoA networks are permissioned not public by design. Only strictly defined authority nodes are allowed to seal blocks. This is very useful for test networks or enterprise networks where the native tokens on the blockchain are not holding any value and therefore would be easy to attack in a Proof-of-Work (PoW) or Proof-of-Stake (PoS) environment.

A step is one part of the authority round. Each authority can seal one block in each round. Let's say we have five authorities: 0x0a .. 0x0e. These would be the steps, as defined in the chain specification or in the dynamic validator contract:

  1. Step 1: 0x0a seals a block
  2. Step 2: 0x0b seals a block
  3. Step 3: 0x0c seals a block
  4. Step 4: 0x0d seals a block
  5. Step 5: 0x0e seals a block

After the round is finished, it starts over again.

What do you mean by "Blocks from more than 1 step into the future are rejected."?

Now if The node 0x0c would try to seal a block right after 0x0a, then this block would be more than 1 step into the future. The block sealing strickly relies on the block step order of all authorities.

And also what happens when the next primary doesn't broadcast?

That's no problem, there will be a gap between two blocks, i.e., doubled block time. So if 0x0c notices that 0x0b is not providing a block in the specified time window, it can override this step with its own block and the round goes on. There are certain tolerances on the block timestamps to make sure the network does not stall.

Kovan Stats Screenshot

In this screenshot above, you can see that two authorities in the Kovan network are not sealing blocks. The result is an increased block time between these steps.

Disclosure: I work for Parity.

like image 155
Afr Avatar answered Sep 19 '22 16:09

Afr