Skip to content

discovery/discovered_peer.hpp

Namespaces

Name
discovery

Classes

Name
struct discovery::ForkId
Ethereum EIP-2124 fork identifier used for chain-correctness filtering.
struct discovery::ValidatedPeer
Minimal peer descriptor produced by both discv4 and discv5 crawlers.

Types

Name
using std::array< uint8_t, 64 > NodeId
Node identifier — 64-byte uncompressed secp256k1 public key (without the 0x04 prefix).

Types Documentation

using NodeId

using discovery::NodeId = std::array<uint8_t, 64>;

Node identifier — 64-byte uncompressed secp256k1 public key (without the 0x04 prefix).

Source code

// Copyright 2025 GeniusVentures
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <array>
#include <chrono>
#include <cstdint>
#include <optional>
#include <string>

namespace discovery
{

using NodeId = std::array<uint8_t, 64>;

struct ForkId
{
    std::array<uint8_t, 4> hash{};  
    uint64_t               next{};  
};

struct ValidatedPeer
{
    NodeId                  node_id{};           
    std::string             ip{};                
    uint16_t                udp_port{};          
    uint16_t                tcp_port{};          
    std::chrono::steady_clock::time_point
                            last_seen{};         
    std::optional<ForkId>   eth_fork_id{};       
};

} // namespace discovery

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