-
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
IPC: Abstract common consensus functions and consensus interface #9481
IPC: Abstract common consensus functions and consensus interface #9481
Conversation
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
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.
Looks mostly good, just 1 small comment + CI is failing gen checks
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.
Looks good, just needs conflicts resolved
Conflicts should be fixed. CI is not happy but maybe it is a flaky test? It passed the last time it ran. Let me know if you need anything else from my side 🙏 |
@magik6k @jennijuju, are we still planning to get this merged? We want to make |
@adlrocha seems like magik is okay with this PR, i just need to wait for either @magik6k / @arajasek to get this a final pass and put a ✅ on it, both of them are still OOO until later this week. We also have to prioritize on some blockers for nv18 & confirm branch management for nv18 release before we can work on landing this in master. Can we target next Friday, Jan 13th - does it work for your project? |
Sure, no problem. I just wanted an estimate so we can pipeline the work. Thanks 🙏 |
Related Issues
consensus-shipyard/lotus#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.