@VisibleForTesting
  public static BlockHeaderValidator.Builder cliqueBlockHeaderValidator(
      final long secondsBetweenBlocks,
      final boolean createEmptyBlocks,
      final EpochManager epochManager,
      final Optional<BaseFeeMarket> baseFeeMarket,
      final boolean isMergeEnabled) {

    final BlockHeaderValidator.Builder builder =
        new BlockHeaderValidator.Builder()
            .addRule(new AncestryValidationRule())
            .addRule(new TimestampBoundedByFutureParameter(10))
            .addRule(
                new GasLimitRangeAndDeltaValidationRule(
                    DEFAULT_MIN_GAS_LIMIT, DEFAULT_MAX_GAS_LIMIT, baseFeeMarket))
            .addRule(
                new ConstantFieldValidationRule<>(
                    "OmmersHash", BlockHeader::getOmmersHash, Hash.EMPTY_LIST_HASH))
            .addRule(new CliqueExtraDataValidationRule(epochManager))
            .addRule(new CliqueDifficultyValidationRule())
            .addRule(new SignerRateLimitValidationRule())
            .addRule(new CoinbaseHeaderValidationRule(epochManager))
            .addRule(new GasUsageValidationRule());

    if (baseFeeMarket.isPresent()) {
      builder.addRule(new BaseFeeMarketBlockHeaderGasPriceValidationRule(baseFeeMarket.get()));
    }

    if (!createEmptyBlocks) {
      builder.addRule(new CliqueNoEmptyBlockValidationRule());
    }

    var mixHashRule =
        new ConstantFieldValidationRule<>("MixHash", BlockHeader::getMixHash, Hash.ZERO);
    var voteValidationRule = new VoteValidationRule();
    var cliqueTimestampRule = new TimestampMoreRecentThanParent(secondsBetweenBlocks);

    if (isMergeEnabled) {
      builder
          .addRule(new AttachedComposedFromDetachedRule(mixHashRule))
          .addRule(new AttachedComposedFromDetachedRule(voteValidationRule))
          .addRule(new AttachedComposedFromDetachedRule(cliqueTimestampRule));
    } else {
      builder.addRule(mixHashRule).addRule(voteValidationRule).addRule(cliqueTimestampRule);
    }

    return builder;
  }
Clique block header validator. Visible for testing.

@param secondsBetweenBlocks the seconds between blocks
@param createEmptyBlocks whether clique should allow the creation of empty blocks.
@param epochManager the epoch manager
@param baseFeeMarket the base fee market
@param isMergeEnabled the is merge enabled
@return the block header validator . builder
consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/BlockHeaderValidationRulesetFactory.java