-
Notifications
You must be signed in to change notification settings - Fork 5
Remove Decided Messages from QBFT Consensus #63
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
Draft
alan-ssvlabs
wants to merge
2
commits into
main
Choose a base branch
from
decided_message
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| | Author | Title | Category | Status | Date | | ||
| |-------------|-------------------------|----------|---------------------|------------| | ||
| | Alan Li | Remove decided message | Core | open-for-discussion | 2025-05-23 | | ||
|
|
||
| ## Summary | ||
| In QBFT consensus, decided message is a protocol message that consists of at least a quorum of valid commit messages. Operators can instantly terminate consensus if a valid decided message is received. However, it is an optional message to help nodes to terminate consensus. Operators are able to terminate consensus as long as a quorum of valid commit messages is received. This SIP proposes to remove the decided message from the consensus protocol. | ||
|
|
||
| ## Motivation | ||
| Since it is not a required message, removing the decided message will reduce the processing overhead to an operator. Currently, decided messages accounted for 6.3% of the bandwidth and 3.7% of the messages in the network. Removing the decided message will reduce the bandwidth and the messages by 6.3% and 3.7% respectively. | ||
|
|
||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe it is a good idea to explain why it isn't required:
|
||
| <p align="center"> | ||
| <img src="./images/remove_decided_msg/curr_bandwidth.png" width="45%" height="10%"> | ||
| <img src="./images/remove_decided_msg/curr_msgs.png" width="45%" height="10%"> | ||
| </p> | ||
|
|
||
| ## Specification | ||
| There will be two stages of changes to remove the decided message. | ||
|
|
||
| ### Stage 1: Stop broadcasting decided messages | ||
| Operators will stop broadcasting decided messages when the consensus is terminated. | ||
|
|
||
| ```go | ||
| func (c *Controller) UponExistingInstanceMsg(msg *ProcessingMessage) (*types.SignedSSVMessage, error) { | ||
|
|
||
| inst := c.InstanceForHeight(msg.QBFTMessage.Height) | ||
| if inst == nil { | ||
| return nil, errors.New("instance not found") | ||
| } | ||
|
|
||
| prevDecided, _ := inst.IsDecided() | ||
|
|
||
| // if previously decided, we don't process more messages | ||
| if prevDecided { | ||
| return nil, errors.New("not processing consensus message since instance is already decided") | ||
| } | ||
|
|
||
| decided, _, decidedMsg, err := inst.ProcessMsg(msg) | ||
| if err != nil { | ||
| return nil, errors.Wrap(err, "could not process msg") | ||
| } | ||
|
|
||
| // save the highest Decided | ||
| if !decided { | ||
| return nil, nil | ||
| } | ||
|
|
||
| // ---------- below is removed to stop broadcasting decided messages ---------- | ||
|
|
||
| // if err := c.broadcastDecided(decidedMsg); err != nil { | ||
| // // no need to fail processing instance deciding if failed to save/ broadcast | ||
| // fmt.Printf("%s\n", err.Error()) | ||
| // } | ||
| // return decidedMsg, nil | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ### Stage 2: Stop processing decided messages | ||
| Operators will also stop processing decided messages. All codes related to decided messages will be removed. | ||
|
|
||
| ## Backwards Compatibility | ||
| It is backwards compatible to implement the first stage of changes of stop broadcasting decided messages, but it is not backwards compatible to implement the second stage of changes of stop processing decided messages. | ||
|
|
||
| The first stage of changes can be implemented in a non-forked update and the second stage of changes can be implemented in a fork. | ||
|
|
||
| But even if a decided message is received after the update, it will not damage the security or liveness of the consensus. | ||
|
|
||
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.
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.
are we sure the numbers are correct?
In https://github.com/ssvlabs/knowledge-base-internal/discussions/15 we have different numbers (but those are before committee-based consensus).
Just wondering if you looked only at data that takes aggregator duties into account