public static EthereumNodeRecord fromRLP(final Bytes rlp) {
    if (rlp.size() > 300) {
      throw new IllegalArgumentException("Record too long");
    }
    var data = new HashMap<String, Bytes>();

    // rlp: sig, sequence, k1,v1, k2,v2, k3, [v3, vn]...
    var input = new BytesValueRLPInput(rlp, false);
    input.enterList();

    input.skipNext(); // skip signature
    input.skipNext(); // skip sequence

    // go through rest of the list
    while (!input.isEndOfCurrentList()) {
      var key = new String(input.readBytes().toArrayUnsafe(), StandardCharsets.UTF_8);
      if (input.nextIsList()) {
        // skip list as we currently don't need any of these complex structures
        input.skipNext();
      } else {
        data.put(key, input.readBytes());
      }
    }

    input.leaveList();

    var publicKey = initPublicKeyBytes(data);

    return new EthereumNodeRecord(rlp, publicKey, initIPAddr(data), initTCP(data), initUDP(data));
  }
Creates an ENR from its serialized form as a RLP list

@param rlp the serialized form of the ENR
@return the ENR
@throws IllegalArgumentException if the rlp bytes length is longer than 300 bytes
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/dns/EthereumNodeRecord.java