docs: def consume_length_prefix(rlp, start):
      """Read a length prefix from an RLP string.
  
      :param rlp: the rlp byte string to read from
      :param start: the position at which to start reading
      :returns: a tuple ``(prefix, type, length, end)``, where ``type`` is either ``str``
                or ``list`` depending on the type of the following payload,
                ``length`` is the length of the payload in bytes, and ``end`` is
                the position of the first payload byte in the rlp string
      """
      b0 = rlp[start]
      if b0 < 128:  # single byte
          return (b'', bytes, 1, start)
      elif b0 < SHORT_STRING:  # short string
          if b0 - 128 == 1 and rlp[start + 1] < 128:
              raise DecodingError('Encoded as short string although single byte was possible', rlp)
          return (rlp[start:start + 1], bytes, b0 - 128, start + 1)
      elif b0 < 192:  # long string
          ll = b0 - 183  # - (128 + 56 - 1)
          if rlp[start + 1:start + 2] == b'\x00':
              raise DecodingError('Length starts with zero bytes', rlp)
          len_prefix = rlp[start + 1:start + 1 + ll]
          l = big_endian_to_int(len_prefix)  # noqa: E741
          if l < 56:
              raise DecodingError('Long string prefix used for short string', rlp)
          return (rlp[start:start + 1] + len_prefix, bytes, l, start + 1 + ll)
      elif b0 < 192 + 56:  # short list
          return (rlp[start:start + 1], list, b0 - 192, start + 1)
      else:  # long list
          ll = b0 - 192 - 56 + 1
          if rlp[start + 1:start + 2] == b'\x00':
              raise DecodingError('Length starts with zero bytes', rlp)
          len_prefix = rlp[start + 1:start + 1 + ll]
          l = big_endian_to_int(len_prefix)  # noqa: E741
          if l < 56:
              raise DecodingError('Long list prefix used for short list', rlp)
          return (rlp[start:start + 1] + len_prefix, list, l, start + 1 + ll)