Skip to content

discv4::discv4_enr_response

Parsed ENRResponse — discv4 wire type 0x06 (EIP-868). More...

#include <discv4_enr_response.hpp>

Public Functions

Name
rlp::Result< discv4_enr_response > Parse(rlp::ByteView raw)
Parse a full discv4 wire packet into a discv4_enr_response.
rlp::Result< ForkId > ParseEthForkId() const
Extract the ForkId from the eth ENR entry in record_rlp.

Public Attributes

Name
std::array< uint8_t, kWireHashSize > request_hash
Hash of the originating ENRRequest packet (the ReplyTok field).
std::vector< uint8_t > record_rlp

Detailed Description

struct discv4::discv4_enr_response;

Parsed ENRResponse — discv4 wire type 0x06 (EIP-868).

Mirrors go-ethereum v4wire.ENRResponse:

ENRResponse struct {
    ReplyTok []byte   // Hash of the ENRRequest packet.
    Record   enr.Record
    Rest []rlp.RawValue `rlp:"tail"`
}

Wire layout (incoming): hash(32) || sig(65) || type(1) || RLP([reply_tok(32), record_rlp])

Public Functions Documentation

function Parse

static rlp::Result< discv4_enr_response > Parse(
    rlp::ByteView raw
)

Parse a full discv4 wire packet into a discv4_enr_response.

Parameters:

  • raw Full wire bytes: hash(32) || sig(65) || type(1) || RLP_payload.

Return: Parsed response on success, decoding error on failure.

function ParseEthForkId

rlp::Result< ForkId > ParseEthForkId() const

Extract the ForkId from the eth ENR entry in record_rlp.

Return: ForkId if the eth entry is present and well-formed, error otherwise.

ENR record (EIP-778): RLP([signature, seq, key0, val0, key1, val1, ...]) eth value wire encoding: RLP(enrEntry) = RLP([ [hash4, next_uint64] ])

Public Attributes Documentation

variable request_hash

std::array< uint8_t, kWireHashSize > request_hash {};

Hash of the originating ENRRequest packet (the ReplyTok field).

variable record_rlp

std::vector< uint8_t > record_rlp {};

Raw RLP bytes of the remote ENR record (EIP-778), including the RLP list header. Format: RLP([signature, seq, key0, val0, key1, val1, ...])


Updated on 2026-04-13 at 23:22:46 -0700