@Override
  public boolean validate(
      final BlockHeader header, final BlockHeader parent, final ProtocolContext context) {
    if (!extraDataValidatorsAndVoteMustBeEmpty) {
      // delegate to common BftValidatorsValidationRule
      return bftValidatorsValidationRule.validate(header, parent, context);
    }

    // validators and votes must be empty if they are supplied by a contract.
    try {
      final BftContext bftContext = context.getConsensusContext(BftContext.class);
      final BftExtraData bftExtraData = bftContext.getBlockInterface().getExtraData(header);

      if (!bftExtraData.getValidators().isEmpty()) {
        LOGGER.info(
            "Invalid block header: Validators in extra data expected to be empty but got {}",
            bftExtraData.getValidators());
        return false;
      }

      if (bftExtraData.getVote().isPresent()) {
        LOGGER.info(
            "Invalid block header: Vote in extra data expected to be empty but got {}",
            bftExtraData.getVote().get());
        return false;
      }
    } catch (final RLPException ex) {
      LOGGER.info(
          "Invalid block header: ExtraData field was unable to be deserialized into an BFT Struct.",
          ex);
      return false;
    } catch (final IllegalArgumentException ex) {
      LOGGER.info("Invalid block header: Failed to verify extra data", ex);
      return false;
    }

    return true;
  }
Instantiates a new Qbft validators validation rule.

@param extraDataValidatorsAndVoteMustBeEmpty the extra data validators and vote must be empty
consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/headervalidationrules/QbftValidatorsValidationRule.java