Skip to main content
19 votes
Accepted

What is the difference between Babe, Aura, and Grandpa?

For a blockchain to continue growing and adding new transactions in a meaningful way, two things must happen to solve the problem of distributed consensus. Typically, these jobs are performed by full ...
JoshOrndorff's user avatar
  • 1,201
9 votes
Accepted

Secure random number generation?

On-chain randomness on any public, decentralized, and deterministic system like a blockchain is difficult. BABE pallet does provide a source of on-chain randomness, but it has its own limits for ...
Shawn Tabrizi's user avatar
  • 16.1k
8 votes
Accepted

Proof of Stake algorithms, why use Aura as block producer?

I was under the impression that in proof of stake, or as substrate uses it, nominated proof of stake, the block producers are chosen by stake, into a set known as validator set through phragmen ...
bkchr's user avatar
  • 11.5k
8 votes
Accepted

What is the KeyOwnerProofSystem in BABE config?

Let's say you have found an equivocation for Babe. Aka you are saying that Alice build two blocks on the same height in session 100. You will now need to prove to the runtime that there is an ...
bkchr's user avatar
  • 11.5k
7 votes
Accepted

Is it possible to resurrect babe chains?

We do have the data of the current chain state but we are still bound by the rules that are set in the runtime, one of the current rules is that the BABE pallet assumes that there will be at least one ...
André's user avatar
  • 2,455
6 votes

Secure random number generation?

Not a full answer but some context that might help: Babe pallet provides 3 implementation of randomness: CurrentBlockRandomness RandomnessFromOneEpochAgo RandomnessFromTwoEpochAgo In the ...
gui's user avatar
  • 221
5 votes
Accepted

After restarting a chain I get a ClientImport("Unexpect epoch change") error. What does this mean in English?

This error occurs when you use BABE block production, and stop running the network for an extended period of time. Basically, BABE expects that a new block is formed at least once per epoch, which is ...
Shawn Tabrizi's user avatar
  • 16.1k
5 votes
Accepted

Backing off claiming new slot for block authorship: finality is lagging

The root cause of the issue here is stalled finality. The block production will deliberately slow down whenever finality is lagging for too long, this is to avoid creating long unfinalized forks. As ...
André's user avatar
  • 2,455
5 votes

Is there a connection between MaxAuthorities from authority_discovery, babe and grandpa?

Well yes they could be different if you want Babe Authorities to be different from Grandpa Authorities, but this just puts more capital requirements on your consensus system so probably best to make ...
Web3 Philosopher's user avatar
5 votes
Accepted

Is there a connection between MaxAuthorities from authority_discovery, babe and grandpa?

In theory they could be different as each pallet's implementation could differ, but I would set them all to the same value. In kusama/polkadot we set them all to 100,000 at the moment (not that we ...
Squirrel's user avatar
  • 3,849
5 votes

Advantages of BABE/GRANDPA over Aura for sovereign chains when weights are equal

Validator selection. Aura is in a round-robin fashion and therefore has predictable block authors, Babe does not. If you can predict the validators for a specific block way into the future, you can ...
Xiu Hung's user avatar
  • 527
5 votes
Accepted

Session changes on reversion

As you already said correctly, sessions are based on time. There is no logic to catch up or similar, we will just skip the sessions. For quite some time this would have been problematic for chains ...
bkchr's user avatar
  • 11.5k
4 votes
Accepted

How can I use BABE's randomness in my parachain?

Yes, you can use the randomness from the relay chain. It is currently not that easy, but you should be able to do it in the following way: In your runtime: impl cumulus_parachain_system::Config for ...
bkchr's user avatar
  • 11.5k
4 votes
Accepted

Substrate change node template from PoA to PoS

The following posts may help: How to upgrade consensus engine of a live chain from PoA to PoS? How to change consensus engine from PoA to PoS? Also, you may want to consider the parachain route: ...
Bruno's user avatar
  • 8,315
4 votes

How does a collator or validator choose their signing key?

This is what session.set_keys achieves, it declares that an on-chain account (presumably with keys in some form of cold storage) will sign blocks/consensus messages with some other key. When a node ...
joepetrowski's user avatar
  • 2,955
3 votes

After restarting a chain I get a ClientImport("Unexpect epoch change") error. What does this mean in English?

what does this error really indicate It means that an unexpected epoch change transition occurred that BABE found and rejected when it was validating the epoch change signal transitions of a block it ...
Luke Schoen's user avatar
  • 2,332
3 votes
Accepted

How to set secondary slots for Babe?

The secondary slot authors are the same as the primary slot authors, there's no distinct validator set to configure. The reason your chain has stalled with "Unexpected epoch change" is ...
André's user avatar
  • 2,455
3 votes
Accepted

Advantages of BABE/GRANDPA over Aura for sovereign chains when weights are equal

GRANDPA is orthogonal to the blockchain extension algorithm. GRANDPA doesn't create blocks but only finalizes blocks that have already been created. One main downside to Aura is the fact that the ...
rob's user avatar
  • 2,126
3 votes

How to solve this error: associated type `BlockNumber` not found for `T`?

According to the Polkadot Release Analysis v1.0.0, GenesisBuild has been has been deprecated in favor of BuildGenesisConfig. Here is an example of how to use: #[pallet::genesis_config] #[derive(...
Bruno's user avatar
  • 8,315
2 votes
Accepted

Substrate chain reconcilliation with BABE/GRANDPA

GRANDPA as a gadget is meant to function on top of something like BABE, which is a blockchain extension process that is itself eventually consistent. The only goal of GRANDPA is to speed up the ...
rob's user avatar
  • 2,126
2 votes

manually creating new blocks with Babe

One requirement of Babe is to produce at least one block per epoch. https://github.com/paritytech/substrate/issues/4464#issuecomment-567651962 You could create a "test" runtime with ...
Bruno's user avatar
  • 8,315
2 votes
Accepted

BABE: VRF verification fails

Likely, this issue won't be coming up again as all teams will be at polkadot v0.937 or greater by the time I wrote this answer, but still happy to share how we resolved the issue. Upgrade the ...
Dominik Harz's user avatar
2 votes

How can I use BABE's randomness in my parachain?

It seems like Moonbeam/Moonriver has a way to do this using a runtime API for client side VRF verification (see: full code snip and original PR): pub struct BabeDataGetter; impl pallet_randomness::...
Sacha Lansky's user avatar
  • 2,640
2 votes
Accepted

What happens on invalid blocks?

Is there any punishment for the block author for example? No there is no punishment. You can not really proof that a block is invalid to the runtime. Yeah, you could do similar to what Polkadot is ...
bkchr's user avatar
  • 11.5k
2 votes
Accepted

file not found for module `sys`

So I cargo.toml file you have to do this there. pallet-session, instead of features = ["historical"], replace it with default-features = false
Abubakar Mujahid's user avatar
2 votes

Custom session keys in Chainspec for Mainnet config

Because AccountId was implemented From<[u8; 32]>. And the KeyId(aura, babe, grandpa...) was implemented UncheckedFrom<[u8; 32]> instead of From<[u8; 32]>. Read more: https://...
AurevoirXavier's user avatar
  • 10.6k
2 votes

What is difference between pallet-babe and sp-consensus-babe?

The first part of sp-consensus-babe sp stands for substrate primitives, meaning packages that usually includes elements providing the foundational structures and functionalities. In this case, sp-...
magecnion's user avatar
  • 244
1 vote

nextAuthorities() output clarification from Babe storage event

In BABE, the authorities are block producers. What you get when you query the nextAuthorities() is the AuthorityId and the BabeAuthorityWeightof the next block producers. /// Next epoch authorities. #[...
Alex Bean's user avatar
  • 5,747
1 vote

Is it possible to start a substrate BABE blockchain with no Grandpa authorities and BABE validators?

Is there a way to start the blockchain such that no session keys are set? No, then no one could produce blocks nor finalize blocks. Do all grandpa authorities need to be hardcoded in the chain spec? ...
bkchr's user avatar
  • 11.5k
1 vote

Substrate change node template from PoA to PoS

I have integrated the POS in fresh node-template on polkadot-v1.0.0 Here you can find the POS(proof-of-stake) node-template with babe: https://github.com/Aideepakchaudhary/POA-to-POS Thanks!
Deepak Chaudhary's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible