I'm trying to implement Layer 2 to Substrate. Substrate node runs BABE and GRANDPA to produce blocks and finalize.
Layer 2 comes built into the Substrate (planning to develop this way). It will have a faster slot-based block production and maybe finalization as well.
I'm thinking of having 2 consensus algorithms in parallel built into the Substrate node. Let's say that layer 2 produces 6 blocks for every block time for the Substrate node and sends the block proofs via runtime-api (or rpc).
I've hacked the Substrate to achieve this. First, added AURA to the node that has BABE. I separated the tasks so block production and finalization wouldn't affect different consensus algorithms. I didn't count for Prometheus. It compiled ok but got this error
Failed to register proposer prometheus metrics: Duplicate metrics collector registration attempted. Essential task
basic-block-import-worker
failed. Shutting down service.
I haven't dug more after this. I'm questioning the possibility of this at this point.
- Should there be 2 separate runtimes? Or is the node's runtime enough?
- How would block finalization be done?