discv4/discv4_enr_response.hpp¶
Namespaces¶
| Name |
|---|
| discv4 |
Classes¶
| Name | |
|---|---|
| struct | discv4::ForkId Fork identifier per EIP-2124. |
| struct | discv4::discv4_enr_response Parsed ENRResponse — discv4 wire type 0x06 (EIP-868). |
Source code¶
// Copyright 2026 Genius Ventures, Inc.
// SPDX-License-Identifier: MIT
#ifndef EVMRELAY_INCLUDE_DISCV4_DISCV4_ENR_RESPONSE_HPP
#define EVMRELAY_INCLUDE_DISCV4_DISCV4_ENR_RESPONSE_HPP
#include <array>
#include <cstdint>
#include <vector>
#include <rlp/common.hpp>
#include <rlp/rlp_decoder.hpp>
#include <discv4/discv4_constants.hpp>
namespace discv4 {
struct ForkId
{
std::array<uint8_t, 4U> hash{};
uint64_t next{};
bool operator==( const ForkId& other ) const noexcept
{
return hash == other.hash && next == other.next;
}
};
struct discv4_enr_response
{
std::array<uint8_t, kWireHashSize> request_hash{};
std::vector<uint8_t> record_rlp{};
[[nodiscard]] static rlp::Result<discv4_enr_response> Parse( rlp::ByteView raw ) noexcept;
[[nodiscard]] rlp::Result<ForkId> ParseEthForkId() const noexcept;
};
} // namespace discv4
#endif // EVMRELAY_INCLUDE_DISCV4_DISCV4_ENR_RESPONSE_HPP
Updated on 2026-06-05 at 17:22:18 -0700