Skip to content
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

[Runtime] Use Babe instead of Aura #240

Open
sea212 opened this issue Jul 23, 2021 · 1 comment
Open

[Runtime] Use Babe instead of Aura #240

sea212 opened this issue Jul 23, 2021 · 1 comment
Labels
p:high High priority, prioritize the resolution of this issue t:maintenance The issue describes necessary maintenance

Comments

@sea212
Copy link
Member

sea212 commented Jul 23, 2021

BABE provides a mechanism to select the authors of the next block. In that term it is almost identical to AURA, with the difference that multiple block authors can be selected for one slot. AURA uses a round-robin scheme, whereas BABE uses a Verifiable Random Function (VRF) to select the next set of block authors. In BABE, for every epoch, every validator is assigned a weight. For equal chances are weights are equal, in a PoS system the weight is inversely proportional with the stake amount. Every weight is split into n different slots. On every slot, every validator in the set of validators generates a pseudorandom number using the VRF. If the validators random number is less than the weight assigned, then the validator is allowed to produce a block. Along with the random number, a proof is submitted, such that every other participant can verify that this number was indeed pseudorandomly generated. At this point we can see, that it is possible that multiple validators generate numbers less than their weight and therefore multiple validators can have the right to produce a block at a given slot. Therefore temporary forks happen more frequently when using BABE, but this is no greater issue, since a finality mechanism like GRANDPA will ensure (relatively fast), what the finalized canonical chain is.

BABE has (at least) one major advantage. Since the set of validators provides verifiably pseudorandomly generated numbers, a new source of entropy comes into existence in the deterministic low-entropy chain. Every pseudo random number can be cleverly mixed to obtain a good source of entropy and therefore potentially a good random number generator.

Currently we use the Randomness Collective Coin Flip Pallet to generate randomness. This is a very insecure way to generate entropy and should only be used in tests.

@sea212 sea212 added p:high High priority, prioritize the resolution of this issue t:enhancement The issue described an enhancement labels Jul 23, 2021
@sea212 sea212 added t:maintenance The issue describes necessary maintenance and removed t:enhancement The issue described an enhancement labels Jul 23, 2021
@c410-f3r
Copy link
Contributor

Cumulus does not yet support BABE (https://github.com/paritytech/cumulus/tree/master/client/consensus) and the current used consensus algorithm based on the MoonBeam implementation (https://github.com/PureStake/cumulus/tree/nimbus) is based on Aura. Therefore, it will probably take some time before BABE is available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:high High priority, prioritize the resolution of this issue t:maintenance The issue describes necessary maintenance
Projects
None yet
Development

No branches or pull requests

2 participants