-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract common consensus functions and consensus interface #9405
Closed
adlrocha
wants to merge
9
commits into
filecoin-project:experimental/fvm-m2
from
consensus-shipyard:adlrocha/cns-iface-fvm-m2
Closed
Abstract common consensus functions and consensus interface #9405
adlrocha
wants to merge
9
commits into
filecoin-project:experimental/fvm-m2
from
consensus-shipyard:adlrocha/cns-iface-fvm-m2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
magik6k
reviewed
Oct 4, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First really quick review pass, will do one more careful one tomorrow;
Generally everything looks good, should be easy to land this.
Closing in favor of #9481 that already targets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
#1
Proposed Changes
This PR extends the consensus interface in order to prepare it for the implementation of other consensus algorithms. It also extracts from
FilecoinEC
common logic that will be shared by all consensus implementations.ValidatedPubSub
as a common function.compute_state
as common code for all consensus algorithms.Integration of the interface
To illustrate how this interface can be integrated for the implementation of alternative consensus algorithm, I will share how I imagine it to work and be implemented for Mir:
CreateBlock
runs the block proposal logic for Mir in Lotus. InCreateBlock
Lotus validators pull unverified messages from the mempool, and send them to Mir for ordering. Once the ordered batch is output by Mir, a new Filecoin block is assembled and broadcast through GossipSub to the network.block
topic. When a new block is received, GossipSub triggersValidateBlockHeader
before delivering the block to the node. If the validation succeeds, the block is passed to the syncer which runsValidateBlock
to perform a full block validation to determine if the block is valid and can be executed. As part of these verifications,VerifyBlockSignature
may be called.RewardFunc
that parametrized how should block rewards be distributed among validators.