From df9738f7a7b57bd2934267f0cbc607658c7fbaf7 Mon Sep 17 00:00:00 2001 From: frstrtr Date: Sat, 20 Jun 2026 01:18:10 +0000 Subject: [PATCH 1/2] dgb: pin NodeP2P handshake constants to DigiByte Core (70019 / port 12024) Reconcile the two P2P-handshake constants p2p_node.hpp carried verbatim from the BTC module against DigiByte Core source (../digibyte): - protocol_version 70016 -> 70019 (src/version.h PROTOCOL_VERSION). WTXID_RELAY_VERSION is 70018 < 70019, so BIP 339 wtxidrelay stays active; advertising the BTC 70016 understated our version to a DGB peer. - advertised addr_from port 8333 -> 12024 (kernel/chainparams.cpp:178, DGB mainnet; testnet 12026 / regtest 18444). The real connect target is still supplied by run_node via NetService. Resolves the M3 [decision-needed] TODO. P2P-layer only, no consensus value; fenced to src/impl/dgb. Producer NodeP2P construct+connect in run_node is the follow-on slice (gated on a reachable digibyted). --- src/impl/dgb/coin/p2p_node.hpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/impl/dgb/coin/p2p_node.hpp b/src/impl/dgb/coin/p2p_node.hpp index c9efef005..376654d19 100644 --- a/src/impl/dgb/coin/p2p_node.hpp +++ b/src/impl/dgb/coin/p2p_node.hpp @@ -3,11 +3,13 @@ // DGB embedded P2P node. 1:1 mirror of src/impl/btc/coin/p2p_node.hpp (NON-MWEB). // Speaks the DigiByte Core wire protocol to the embedded daemon; Scrypt-only. // -// TODO(M3 / [decision-needed]): two P2P-handshake constants are carried from BTC -// and MUST be reconciled against DigiByte Core params before mainnet wiring: -// - protocol_version (70016 here) -> confirm DigiByte Core PROTOCOL_VERSION -// - advertised NetService port (8333 here) -> DGB mainnet default is 12024 -// Neither is consensus; both are P2P-layer and should ultimately come from config. +// P2P-handshake constants RECONCILED against DigiByte Core source (../digibyte): +// - protocol_version = 70019 (src/version.h PROTOCOL_VERSION; NOT BTC 70016). +// WTXID_RELAY_VERSION = 70018 < 70019, so BIP 339 wtxidrelay still applies. +// - DGB mainnet P2P default port = 12024 (kernel/chainparams.cpp:178; testnet +// 12026, regtest 18444). The connect target is supplied by run_node via +// NetService; the advertised addr_from port is set to 12024 to match. +// Neither is consensus; both are P2P-layer. run_node passes the real target. #include "p2p_messages.hpp" #include "p2p_connection.hpp" @@ -150,19 +152,19 @@ class NodeP2P : public core::ICommunicator, public core::INetwork, public core:: // BTC service flags + protocol version: // BTC: NODE_NETWORK | NODE_WITNESS (no MWEB; LTC-only). - // Protocol 70016 = BIP 339 wtxidrelay activation point (Bitcoin Core 0.21+). + // DGB Core PROTOCOL_VERSION 70019 (>= WTXID_RELAY_VERSION 70018 => BIP 339 active). // (LTC-DOGE conditional removed; this is the BTC-specific module.) static constexpr uint64_t NODE_NETWORK = 1; static constexpr uint64_t NODE_WITNESS = (1 << 3); uint64_t our_services = NODE_NETWORK | NODE_WITNESS; - uint32_t protocol_version = 70016; + uint32_t protocol_version = 70019; // DigiByte Core PROTOCOL_VERSION (src/version.h) auto msg_version = message_version::make_raw( protocol_version, our_services, core::timestamp(), addr_t{our_services, m_peer->get_addr()}, - addr_t{our_services, NetService{"192.168.0.1", 8333}}, + addr_t{our_services, NetService{"192.168.0.1", 12024}}, core::random::random_nonce(), "c2pool-btc", 0 From 2619cb5783f8340fa1f1fa65fa3c7c3e1ba5bc1a Mon Sep 17 00:00:00 2001 From: frstrtr Date: Sat, 20 Jun 2026 01:54:25 +0000 Subject: [PATCH 2/2] dgb: reconcile NodeP2P user-agent c2pool-btc -> c2pool-dgb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Third BTC-leftover in the embedded coin-daemon version handshake, same class as the proto/port constants this PR already pinned: connected() advertised subversion "c2pool-btc" to digibyted. A DGB embedded node must identify as c2pool-dgb. P2P-layer only, no consensus value; fenced to src/impl/dgb. Verified against live regtest digibyted (DigiByte:8.26.2, getnetworkinfo protocolversion=70019 — matches the proto pin). --- src/impl/dgb/coin/p2p_node.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/impl/dgb/coin/p2p_node.hpp b/src/impl/dgb/coin/p2p_node.hpp index 376654d19..dcf17bdef 100644 --- a/src/impl/dgb/coin/p2p_node.hpp +++ b/src/impl/dgb/coin/p2p_node.hpp @@ -166,7 +166,7 @@ class NodeP2P : public core::ICommunicator, public core::INetwork, public core:: addr_t{our_services, m_peer->get_addr()}, addr_t{our_services, NetService{"192.168.0.1", 12024}}, core::random::random_nonce(), - "c2pool-btc", + "c2pool-dgb", // user-agent (subversion): DGB node, not the BTC mirror it forked from 0 );