I'm new to the substrate. I'm trying to improve the availability of block generation of permissioned networks by substituting Aura with Raft/PBFT like consensus algorithm. I'm referring to an algorithm that solves the "who can generate blocks" problem by electing a leader (via libp2p
) among authorized nodes.
After running the tutorials and viewing Aura's source code, I'm still confused about if it is possible to do that. some of the questions are below:
- Is that possible to implement leader selection off-chain, and get the result in runtime? (It seems that an off-chain worker can only submit a transaction. but how can runtime reading data from that?)
- How to communicate the off-chain worker of another node in the current off-chain worker? It seems that
sc-network
has the ability to do that. - Why does Aura's implementation have code in both
sc-consensus-aura
andframe-aura
. What does theclient
do insc-consensus-aura
? - Here says "Polkadot uses a hybrid PBFT / Aurand consensus mechanism", is that mean a yes to my question? And somehow I can not find related code.
And if that is possible, is there any work/example I can learn from?
Thanks for your help!