bsc修改了defaultEpochLength以后,会导致从头验证区块异常,
func (p *Parlia) verifyHeader(chain consensus.ChainHeaderReader, header *types.Header, parents []*types.Header) error {
// Ensure that the extra-data contains a signer list on checkpoint, but none otherwise
signersBytes := getValidatorBytesFromHeader(header, p.chainConfig, epochLength)
isEpoch := number%epochLength == 0
if !isEpoch && len(signersBytes) != 0 {
return errExtraValidators
}
if isEpoch && len(signersBytes) == 0 {
return errInvalidSpanValidators
}
验证头部header和epoch是关系的,所以不能任意修改defaultEpochLength,需要采用硬分叉升级

浙公网安备 33010602011771号