class IbftCommitSealsValidationRule implements AttachedBlockHeaderValidationRule {

  @Override
  public boolean validate(
      final BlockHeader header, final BlockHeader parent, final ProtocolContext protocolContext) {
    final ValidatorProvider validatorProvider =
        protocolContext
            .getConsensusState(IbftContext.class)
            .getVoteTallyCache()
            .getVoteTallyAfterBlock(parent);
    final IbftExtraData ibftExtraData = IbftExtraData.decode(header);

    final List<Address> committers =
        IbftBlockHashing.recoverCommitterAddresses(header, ibftExtraData);
    final List<Address> committersWithoutDuplicates = new ArrayList<>(new HashSet<>(committers));

    if (committers.size() != committersWithoutDuplicates.size()) {
      LOGGER.trace("Duplicated seals found in header.");
      return false;
    }

    return validateCommitters(committersWithoutDuplicates, validatorProvider.getValidators());
  }

}