class IbftBlockHeaderValidationRulesetFactory {

  public static BlockHeaderValidator.Builder ibftBlockHeaderValidator(
      final long secondsBetweenBlocks) {
    return new BlockHeaderValidator.Builder()
        .addRule(new AncestryValidationRule())
        .addRule(new GasUsageValidationRule())
        .addRule(new GasLimitRangeAndDeltaValidationRule(5000, 0x7fffffffffffffffL))
        .addRule(new TimestampBoundedByFutureParameter(1))
        .addRule(new TimestampMoreRecentThanParent(secondsBetweenBlocks))
        .addRule(
            new ConstantFieldValidationRule<>(
                "MixHash", BlockHeader::getMixHash, IbftHelpers.EXPECTED_MIX_HASH))
        .addRule(
            new ConstantFieldValidationRule<>(
                "OmmersHash", BlockHeader::getOmmersHash, Hash.EMPTY_LIST_HASH))
        .addRule(
            new ConstantFieldValidationRule<>(
                "Difficulty", BlockHeader::getDifficulty, UInt256.ONE))
        .addRule(new ConstantFieldValidationRule<>("Nonce", BlockHeader::getNonce, 0L))
        .addRule(new IbftValidatorsValidationRule())
        .addRule(new IbftCoinbaseValidationRule())
        .addRule(new IbftCommitSealsValidationRule());
  }

}