-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix - Future decided no instance nil check #342
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.
LGTM
return ssvMessage | ||
} | ||
|
||
multiSpecTest := &tests.MultiMsgProcessingSpecTest{ |
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.
we don't need this test for proposer?
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.
The proposer and blinded proposer tests are in the end of the file
ssv/runner.go
Outdated
@@ -196,7 +196,7 @@ func (b *BaseRunner) basePartialSigMsgProcessing( | |||
// didDecideCorrectly returns true if the expected consensus instance decided correctly | |||
func (b *BaseRunner) didDecideCorrectly(prevDecided bool, decidedMsg *qbft.SignedMessage) (bool, error) { | |||
decided := decidedMsg != nil |
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.
I suggest to write it differently, this is how we write stuff lie this in go and I also think is more readable and easier to reason about
if decidedMsg == nil {
return false, nil
}
if b.State.RunningInstance == nil {
return false, errors.New("decided wrong instance")
}
if decidedMsg.Message.Height != b.State.RunningInstance.GetHeight() {
return false, errors.New("decided wrong instance")
}
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.
let me know what you guys think, I know its not a part of this PR but I couldn't help but see this
@MatheusFranco99 , @GalRogozinski , @moshe-blox . its ok also to decide not to do it here.
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.
I 100% agree. @GalRogozinski what do you think?
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.
small code style comment, approved in case you don't want to do it now
491ccef
to
a775ca0
Compare
if !decidedRunningInstance { | ||
|
||
if b.State.RunningInstance == nil { | ||
return false, errors.New("decided wrong instance") |
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.
we should return different err message here
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.
I agree
Fix #235 by adding a
nil
check.New test: