engine_v2: reject wrong signature earlier, close XFN-29 (#1661)

This commit is contained in:
Daniel Liu 2025-11-03 15:21:56 +08:00 committed by GitHub
parent 0f4d266b9b
commit aecb6ff7dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,6 +41,8 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
if len(header.Validator) == 0 {
// This should never happen, if it does, then it means the peer is sending us invalid data.
return consensus.ErrNoValidatorSignatureV2
} else if len(header.Validator) != 65 {
return fmt.Errorf("invalid validator signature length %d, want 65", len(header.Validator))
}
if fullVerify {