private static Optional<Bytes> readMaybeRevertReason(
      final RLPInput input, final boolean revertReasonAllowed) {
    final Optional<Bytes> revertReason;
    if (input.isEndOfCurrentList()) {
      revertReason = Optional.empty();
    } else {
      if (!revertReasonAllowed) {
        throw new RLPException("Unexpected value at end of TransactionReceipt");
      }
      revertReason = Optional.of(input.readBytes());
    }
    return revertReason;
  }
Creates a transaction receipt for the given RLP

@param rlpInput the RLP-encoded transaction receipt
@param revertReasonAllowed whether the rlp input is allowed to have a revert reason
@return the transaction receipt
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/receipt/TransactionReceiptDecoder.java