-
Notifications
You must be signed in to change notification settings - Fork 204
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 consensus check #6760
Fix consensus check #6760
Conversation
@@ -290,25 +294,43 @@ func (hsv *HeaderSigVerifier) VerifySignatureForHash(header data.HeaderHandler, | |||
return multiSigVerifier.VerifyAggregatedSig(pubKeysSigners, hash, signature) | |||
} | |||
|
|||
// VerifyHeaderWithProof checks if the proof on the header is correct | |||
func (hsv *HeaderSigVerifier) VerifyHeaderWithProof(header data.HeaderHandler) error { | |||
// VerifyHeaderWithPrevProof checks if the proof on the header is correct |
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.
update comment as well.. or maybe consider unexporting this method? it is only used internally now
// VerifyHeaderWithProof checks if the proof on the header is correct | ||
func (hsv *HeaderSigVerifier) VerifyHeaderWithProof(header data.HeaderHandler) error { | ||
// VerifyHeaderWithPrevProof checks if the proof on the header is correct | ||
func (hsv *HeaderSigVerifier) VerifyHeaderWithPrevProof(header data.HeaderHandler) error { | ||
// first block for transition to equivalent proofs consensus does not have a previous proof |
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 comment can be removed
err := verifyPrevProofForHeaderIntegrity(header) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
prevProof := header.GetPreviousProof() | ||
if common.IsEpochChangeBlockForFlagActivation(header, hsv.enableEpochsHandler, common.EquivalentMessagesFlag) { | ||
return hsv.verifyHeaderProofAtTransition(header, prevProof) |
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 don't think this would ever be called, as this method, VerifyHeaderWithPrevProof
, is called only if ShouldBlockHavePrevProof
, but if block should have proof, it means it is not the epoch change block for flag activation, thus VerifySignature
would go through L238-L250 for the epoch start block
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?