consensus-shipyard / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
7 stars 3 forks source link

Mir/Lotus syncing protocol #4

Closed adlrocha closed 1 year ago

adlrocha commented 1 year ago

Goal

Support for full-nodes when running Mir as a consensus algorithm,

Description

With the Mir-based BFT consensus, the nodes can only receive a trusted block from the ordering layer. Basically the ordering layer outputs 2 things: new blocks (not signed by anyone); checkpoints - representations of state snapshots that do contain a quorum of signatures.

Peers need to be able to join the network and sync with the latest state of the chain from scratch. With Filecoin EC this is easy, as the validity of blocks can be verified in isolation, this is not the case for Mir. In Mir, we may have to rely on checkpoints to sync with the latest state and ensure the validity of the history.

This needs further design before it can be implemented.

For BuilderNet, SPs are running full-nodes but they may not be running a Mir validator. For the seamless operation of SPs, is not enough for them to receive checkpoints with a summary of previous blocks, they need per-block updates, and the ability to verify the validity of this block when received through the network.

As suggested off-band by @matejpavlovic, and @sergefdrv, we can add an additional communication round to Mir in order to include validator signatures of individual blocks. Alternatively, we may also use some kind "hash-magic" to enable per-block verification.

An alternative approach proposed by @vukolic is to use learner nodes to implement full-nodes. We can probably leverage GossipSub for this. Acceptors can broadcast their accepts, and full-nodes (i.e. learners) wait for a majority of acceptors before delivering the block.

Related issues: #8, https://github.com/hyperledger/fabric-rfcs/pull/48

matejpavlovic commented 1 year ago

Yes this is crucial. I'm taking the task of making an initial sketch of block verification that Mir could support. Will post it here for you to review and continue designing.

This issue, as I see it, largely overlaps with #9

matejpavlovic commented 1 year ago

Hi, here is a high-level description of how I imagine the block syncing and verification to work. Please comment :-)

adlrocha commented 1 year ago

Implemented an available in spacenet.