. #33976

pull SmartDever02 wants to merge 2 commits into bitcoin:master from SmartDever02:33958-net-split changing 4 files +196 −56
  1. SmartDever02 commented at 1:11 am on December 1, 2025: none
    .
  2. net: Move connection state from CNode to Peer structure
    This is the first step in reducing PeerManager's dependency on CNode
    implementation details. We move commonly accessed connection-related
    state from CNode to the Peer structure:
    
    - m_connected: Connection time used for eviction logic
    - m_last_block_time: Last block time used for eviction
    - m_disconnect: Disconnect flag
    - m_pause_send: Pause send flag
    - m_bip152_highbandwidth_to: BIP152 high bandwidth flag
    
    These fields are initialized in InitializeNode() and kept in sync
    with CNode where necessary. This allows PeerManager to operate
    more independently of CNode's implementation details.
    
    Part of #33958
    709bf81fe0
  3. net: Phase 2 - Move message handling loop to PeerManager (partial)
    - Added ProcessAllPeers() method to PeerManager that iterates over Peer objects
    - Updated ThreadMessageHandler to delegate to PeerManager::ProcessAllPeers()
    - Created NodeInterface to abstract CNode operations
    - Made CNode implement NodeInterface
    - Updated ProcessMessages/SendMessages signatures to take NodeId (partial)
    
    This is work in progress for Phase 2 and 3 of the net split refactoring.
    Many functions still need to be updated to use NodeId instead of CNode*.
    
    Part of #33958
    e8f550f9ed
  4. DrahtBot added the label P2P on Dec 1, 2025
  5. DrahtBot commented at 1:11 am on December 1, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33976.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  6. pinheadmz commented at 1:53 am on December 1, 2025: member
    You closed that entire issue? All four of these “phases”… in two commits? You are ranked #2 on Gittensor, what is that
  7. pinheadmz commented at 1:58 am on December 1, 2025: member

    Did you get all these compile errors when you built this code locally for testing as well? Or is it just me

     0In file included from /home/pinheadmz/Desktop/work/bitcoin/src/netmessagemaker.h:9,
     1                 from /home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.h:9,
     2                 from /home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.cpp:5:
     3/home/pinheadmz/Desktop/work/bitcoin/src/net.h:676:1: error: expected class-name before { token
     4  676 | {
     5      | ^
     6/home/pinheadmz/Desktop/work/bitcoin/src/net.h:957:49: error: std::optional<std::pair<CNetMessage, bool> > CNode::PollMessage() cannot be overloaded with std::optional<std::pair<CNetMessage, bool> > CNode::PollMessage()
     7  957 |     std::optional<std::pair<CNetMessage, bool>> PollMessage() override
     8      |                                                 ^~~~~~~~~~~
     9/home/pinheadmz/Desktop/work/bitcoin/src/net.h:757:49: note: previous declaration std::optional<std::pair<CNetMessage, bool> > CNode::PollMessage()
    10  757 |     std::optional<std::pair<CNetMessage, bool>> PollMessage()
    11      |                                                 ^~~~~~~~~~~
    12/home/pinheadmz/Desktop/work/bitcoin/src/net.h:959:21: error: const CAddress& CNode::GetAddress() const marked override, but does not override
    13  959 |     const CAddress& GetAddress() const override { return addr; }
    14      |                     ^~~~~~~~~~
    15/home/pinheadmz/Desktop/work/bitcoin/src/net.h:960:24: error: const std::string& CNode::GetAddrName() const marked override, but does not override
    16  960 |     const std::string& GetAddrName() const override { return m_addr_name; }
    17      |                        ^~~~~~~~~~~
    18/home/pinheadmz/Desktop/work/bitcoin/src/net.h:961:17: error: std::string CNode::ConnectionTypeAsString() const marked override, but does not override
    19  961 |     std::string ConnectionTypeAsString() const override { return ::ConnectionTypeAsString(m_conn_type); }
    20      |                 ^~~~~~~~~~~~~~~~~~~~~~
    21/home/pinheadmz/Desktop/work/bitcoin/src/net.h:962:10: error: void CNode::PushMessage(CSerializedNetMsg&&) marked override, but does not override
    22  962 |     void PushMessage(CSerializedNetMsg&& msg) override;
    23      |          ^~~~~~~~~~~
    24/home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.h: In member function bool ConnmanTestMsg::ProcessMessagesOnce(CNode&):
    25/home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.h:102:43: error: invalid conversion from CNode* to NodeId {aka long int} [-fpermissive]
    26  102 |         return m_msgproc->ProcessMessages(&node, flagInterruptMsgProc);
    27      |                                           ^~~~~
    28      |                                           |
    29      |                                           CNode*
    30/home/pinheadmz/Desktop/work/bitcoin/src/net.h:1072:41: note:   initializing argument 1 of virtual bool NetEventsInterface::ProcessMessages(NodeId, std::atomic<bool>&)
    31 1072 |     virtual bool ProcessMessages(NodeId node_id, std::atomic<bool>& interrupt) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex) = 0;
    32      |                                  ~~~~~~~^~~~~~~
    33/home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.cpp: In member function void ConnmanTestMsg::Handshake(CNode&, bool, ServiceFlags, ServiceFlags, int32_t, bool):
    34/home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.cpp:34:26: error: invalid conversion from CNode* to NodeId {aka long int} [-fpermissive]
    35   34 |     peerman.SendMessages(&node);
    36      |                          ^~~~~
    37      |                          |
    38      |                          CNode*
    39/home/pinheadmz/Desktop/work/bitcoin/src/net.h:1080:38: note:   initializing argument 1 of virtual bool NetEventsInterface::SendMessages(NodeId)
    40 1080 |     virtual bool SendMessages(NodeId node_id) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex) = 0;
    41      |                               ~~~~~~~^~~~~~~
    42/home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.cpp:55:26: error: invalid conversion from CNode* to NodeId {aka long int} [-fpermissive]
    43   55 |     peerman.SendMessages(&node);
    44      |                          ^~~~~
    45      |                          |
    46      |                          CNode*
    47/home/pinheadmz/Desktop/work/bitcoin/src/net.h:1080:38: note:   initializing argument 1 of virtual bool NetEventsInterface::SendMessages(NodeId)
    48 1080 |     virtual bool SendMessages(NodeId node_id) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex) = 0;
    49      |                               ~~~~~~~^~~~~~~
    50/home/pinheadmz/Desktop/work/bitcoin/src/test/util/net.cpp:69:30: error: invalid conversion from CNode* to NodeId {aka long int} [-fpermissive]
    51   69 |         peerman.SendMessages(&node);
    52      |                              ^~~~~
    53      |                              |
    54      |                              CNode*
    55/home/pinheadmz/Desktop/work/bitcoin/src/net.h:1080:38: note:   initializing argument 1 of virtual bool NetEventsInterface::SendMessages(NodeId)
    56 1080 |     virtual bool SendMessages(NodeId node_id) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex) = 0;
    57      |                               ~~~~~~~^~~~~~~
    58gmake[2]: *** [src/test/util/CMakeFiles/test_util.dir/build.make:160: src/test/util/CMakeFiles/test_util.dir/net.cpp.o] Error 1
    
  8. SmartDever02 commented at 2:32 am on December 1, 2025: none

    @pinheadmz Thank you for your feedback, when I built this on my locally, it worked as well. Let me check again…

    Btw, @fanquake Could you please check?

  9. achow101 commented at 3:57 am on December 1, 2025: member
    ai slop
  10. achow101 closed this on Dec 1, 2025

  11. SmartDever02 deleted the branch on Dec 1, 2025
  12. fanquake renamed this:
    net: Complete net/net_processing split refactoring
    .
    on Dec 1, 2025
  13. DrahtBot removed the label P2P on Dec 1, 2025
  14. bitcoin locked this on Dec 1, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-01 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me