@VisibleForTesting
  Bytes calculateExtraData(final BlockHeader parentHeader) {
    final List<Address> validators = Lists.newArrayList();

    final Bytes vanityDataToInsert =
        ConsensusHelpers.zeroLeftPad(
            miningConfiguration.getExtraData(), CliqueExtraData.EXTRA_VANITY_LENGTH);
    // Building ON TOP of canonical head, if the next block is epoch, include validators.
    if (epochManager.isEpochBlock(parentHeader.getNumber() + 1)) {

      final Collection<Address> storedValidators =
          protocolContext
              .getConsensusContext(CliqueContext.class)
              .getValidatorProvider()
              .getValidatorsAfterBlock(parentHeader);
      validators.addAll(storedValidators);
    }

    return CliqueExtraData.encodeUnsealed(vanityDataToInsert, validators);
  }
Calculate extra data bytes.

@param parentHeader the parent header
@return the bytes
consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueMinerExecutor.java