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

How to upgrade consensus engine of a live chain from PoA to PoS?

Upgrading a chain from PoA (Proof-of-Authority) to PoS (Proof-of-Stake) is orthogonal to upgrading a chain from Aura to BABE, which is what's causing the issues you are running into. At the moment, it'...
rob's user avatar
  • 2,126
9 votes

In substrate, does the genesis block get finalised the same way as the subsequent blocks?

The first block is #0 (genesis block) and it is always considered finalized by default since it is explicitly defined as part of the chain spec, any subsequent blocks (#1 included) are treated equally ...
André's user avatar
  • 2,455
9 votes

How to revert a bricked chain due to bad setCode

You can use the revert command to revert unfinalized blocks. If you need to revert finalized blocks then I suggest you do the following: Assuming you want to revert to block #42; Add the hash of ...
André's user avatar
  • 2,455
8 votes

How to change consensus engine from PoA to PoS?

This is an involved topic, but as a short primer: The crucial change on the runtime side is in how the validator set is provided. Using Babe on its own with a hard-coded validator set is still PoA. ...
apopiak's user avatar
  • 418
8 votes
Accepted

For staking pallet, what options do I have for ElectionProvider?

As it stands now, you have two implementations in substrate: pallet-election-provider-multi-phase: This is a generic, asynchronous election pallet that can provide a wide range of elections to the ...
kianenigma's user avatar
  • 2,799
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
7 votes
Accepted

Polkadot consensus and Honey Badger BFT

No, Polkadot's consensus doesn't use HBBFT. When the original vision paper was written (https://polkadot.network/PolkaDotPaper.pdf), it was mentioned as a possible component or inspiration for ...
rob's user avatar
  • 2,126
7 votes
Accepted

What is the difference in validator sets between an Era and a Session?

The validator identities are the same throughout an entire era, i.e. new validator elections only happen once per era, but every session the validators can use new session keys (https://docs.substrate....
André's user avatar
  • 2,455
7 votes
Accepted

Recovering from stalled finality (babe/grandpa)

The issue lacks details to know exactly what went wrong in the first place (why did finality stop?). That said here are the steps you should have taken in order to debug the problem. Use the ...
André's user avatar
  • 2,455
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

How to change consensus engine from PoA to PoS?

I changed the consensus engine from PoA to PoS for the substrate-node-template when it was Substrate version 3.0.0 about a year ago with the changes shown here. To make the change using a more recent ...
Luke Schoen's user avatar
  • 2,346
5 votes
Accepted

How to properly split logic between block verifier and block import?

The idea of Verifier was that it is only being used to verify the block in isolation as you said. This means for POS for example that you only verify the seal of a block. Currently that isn't the case,...
bkchr's user avatar
  • 11.5k
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

Is there a substrate node that contains pallet-contracts and uses instant seal consensus?

The substrate contracts node already uses instant seal. Just update to the latest version.
Alexander Theißen's user avatar
5 votes

How to revert a bricked chain due to bad setCode

I figured out how to revert some blocks: ./{chain executable} revert --base-path /home/ubuntu/chains --chain {chain name}--keep-blocks 351284 --pruning archive For options: ./{chain executable} ...
twhitehead's user avatar
5 votes
Accepted

How Does Substrate Implement Modular & Hot-Swappable Consensus

Hot-swappable consensus was an item on the roadmap for a while but has been indefinitely postponed because it's very involved and doesn't provide much real-world utility. Substrate enables modular ...
rob's user avatar
  • 2,126
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

How to change consensus engine from PoA to PoS?

To make a PoS chain based on node template, you need to make these changes step by step, use BABE to produce blocks, since Aura is for test purpose or permissioned network. use staking, session, ...
Kaichao Sun's user avatar
4 votes

Runtime panic when peering with node:

The issue might be that initial_authorities accounts don't have any funds, and therefore they don't exist. The error you see comes from the staking module, presumably because it didn't get any valid ...
André's user avatar
  • 2,455
4 votes

For staking pallet, what options do I have for ElectionProvider?

Also, please note, that if you use the latest version of substrate, there are 2 newly introduced structs onchain::BoundedExecution , and onchain::UnboundedExecution. As its name implies, ...
Georges's user avatar
  • 41
4 votes
Accepted

Is it possible to integrate node-authorization pallet after genesis?

I am not sure if your node will break including the pallet without a genesis, but there are a few functions like: /// Reset all the well known nodes. This will not remove the ownership and additional /...
Shawn Tabrizi's user avatar
  • 16.1k
4 votes
Accepted

<wasm:stripped> printed when logging from the runtime

When a type derives RuntimeDebug instead of Debug, then this string literal is printed ONLY in wasm. You have two options here: Run native via --execution Native. Change the derive, and make sure the ...
kianenigma's user avatar
  • 2,799
4 votes
Accepted

how to get the current block author?

You can do so by implementing the pallet_authorship::EventHandler. pallet-collator-selection does exactly this, which is a pretty straightforward example. Then, in the top level runtime, any pallet ...
kianenigma's user avatar
  • 2,799
4 votes
Accepted

Why we should choose DPOS over NPOS or NPOS over DPOS?

As explained in a recent talk at Polkadot Decoded, NPoS performs better in terms of economic security (how much stake is behind the active validator set), capital efficiency (the ratio between overall ...
gpestana's user avatar
  • 263
3 votes
Accepted

What are the various consensus mechanism and how are they best leveraged

There is a short nice write up on consensus here: https://docs.substrate.io/fundamentals/consensus https://wiki.polkadot.network/docs/learn-consensus If you're looking for more detailed info: PoW ...
Bruno's user avatar
  • 8,315
3 votes
Accepted

Verify storage entry with getReadProof

You can use the read_proof_check method: read_proof_check(relay_chain_storage_root, proof, keys); However that only works on the node side. If you need to do it in the runtime, you can do something ...
bkchr's user avatar
  • 11.5k
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,346
3 votes

Validator not being onboarded due to Election NoFallback error, possibly

2022-03-08 22:34:48.034 DEBUG offchain-worker runtime::election-provider: [#199] 🗳 pre-dispatch checks failed for mined solution: Module { index: 19, error: 1, message: Some("...
kianenigma's user avatar
  • 2,799
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

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