@Override
  public Optional<ExceptionalHaltReason> validate(
      final Bytes contractCode, final MessageFrame frame, final EVM evm) {
    final int contractCodeSize = contractCode.size();
    if (contractCodeSize <= maxCodeSize) {
      return Optional.empty();
    } else {
      LOG.trace(
          "Contract creation error: code size {} exceeds code size limit {}",
          contractCodeSize,
          maxCodeSize);
      return Optional.of(ExceptionalHaltReason.CODE_TOO_LARGE);
    }
  }
Instantiates a new Max code size rule.

@param maxCodeSize the max code size
evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/MaxCodeSizeRule.java