Skip to content

Commit

Permalink
fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Feb 6, 2025
1 parent 7b6e822 commit afee01a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func IsEpochChangeBlockForFlagActivation(header data.HeaderHandler, enableEpochs
return isStartOfEpochBlock && isBlockInActivationEpoch
}

// IsEpochStartProofAfterFlagActivation returns true if the provided proof is the proof of the epoch start block after the activation epoch of equivalent messages
func IsEpochStartProofAfterFlagActivation(proof consensus.ProofHandler, enableEpochsHandler EnableEpochsHandler) bool {
// IsEpochStartProofForFlagActivation returns true if the provided proof is the proof of the epoch start block on the activation epoch of equivalent messages
func IsEpochStartProofForFlagActivation(proof consensus.ProofHandler, enableEpochsHandler EnableEpochsHandler) bool {
isStartOfEpochProof := proof.GetIsStartOfEpoch()
isProofInActivationEpoch := proof.GetHeaderEpoch() >= enableEpochsHandler.GetActivationEpoch(EquivalentMessagesFlag)
isProofInActivationEpoch := proof.GetHeaderEpoch() == enableEpochsHandler.GetActivationEpoch(EquivalentMessagesFlag)

return isStartOfEpochProof && isProofInActivationEpoch
}
Expand Down
4 changes: 2 additions & 2 deletions process/headerCheck/headerSignatureVerify.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (hsv *HeaderSigVerifier) VerifyHeaderWithProof(header data.HeaderHandler) e
}

prevProof := header.GetPreviousProof()
if common.IsEpochStartProofAfterFlagActivation(prevProof, hsv.enableEpochsHandler) {
if common.IsEpochStartProofForFlagActivation(prevProof, hsv.enableEpochsHandler) {
return hsv.verifyHeaderProofAtTransition(prevProof)
}

Expand Down Expand Up @@ -369,7 +369,7 @@ func (hsv *HeaderSigVerifier) VerifyHeaderProof(proofHandler data.HeaderProofHan
return fmt.Errorf("%w for flag %s", process.ErrFlagNotActive, common.EquivalentMessagesFlag)
}

if common.IsEpochStartProofAfterFlagActivation(proofHandler, hsv.enableEpochsHandler) {
if common.IsEpochStartProofForFlagActivation(proofHandler, hsv.enableEpochsHandler) {
return hsv.verifyHeaderProofAtTransition(proofHandler)
}

Expand Down

0 comments on commit afee01a

Please sign in to comment.