-
Notifications
You must be signed in to change notification settings - Fork 55
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
Pipelining #78
base: master
Are you sure you want to change the base?
Pipelining #78
Conversation
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. I've requested some changes. Looks like you already refer to the number of views as the type hotstuff.View
:
// PipelinedViews returns the number of concurrently executed views.
PipelinedViews() hotstuff.View
This makes it seem reasonable that the Synchronizer
struct should also represent it as a hotstuff.View
instead of a uint8
.
Looks like some of the tests are failing now. Please take a look. |
twins/network.go
Outdated
@@ -130,6 +130,13 @@ func (n *Network) createTwinsNodes(nodes []NodeID, scenario Scenario, consensusN | |||
return err | |||
} | |||
|
|||
if pipelinedViews < 1 || consensusName != "chainedhotstuff" { |
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.
This should not be done in the loop, and it is also more complex than necessary. Adding this at line 124 should suffice:
if pipelinedViews > 1 && consensusName != "chainedhotstuff" {
return fmt.Errorf("pipelining currently only supported for chainedhotstuff")
}
if pipelinedViews < 1 {
pipelinedViews = 1
}
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.
fixed in fb04815
I also added a similar error in internal/cli/run.go
func checkFlags() error {
consensus := viper.GetString("consensus")
pipelinedViews := viper.GetInt("pipelined-views")
if pipelinedViews > 1 && consensus != "chainedhotstuff" {
return errors.New("piplining only supported for chainedhotstuff consensus")
}
return nil
}
internal/mocks/synchronizer_mock.go
Outdated
func (mr *MockSynchronizerMockRecorder) PipelinedViews() *gomock.Call { | ||
mr.mock.ctrl.T.Helper() | ||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PipelinedViews", reflect.TypeOf((*MockSynchronizer)(nil).PipelinedViews)) | ||
} |
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.
Missing newline
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.
fixed in fb04815
In 7e59d24 I revised the approach. Now the synchronizer has both a |
@leandernikolaus I tried to merge master into this branch (locally) in an attempt to resolve the conflicts. However, the current synchronizer no longer has a |
This implements pipelining for chained hotstuff.
Pipelined blocks still form a single chain, but need not include the certificate for their direct parent.
Commit rule is updated to commit requests if there is a depth 3 confirmation chain and all intermediate blocks are confirmed as well.