Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net] Connman options encapsulation #2632

Merged
merged 11 commits into from
Dec 7, 2021

Conversation

furszy
Copy link

@furszy furszy commented Nov 5, 2021

@furszy furszy self-assigned this Nov 5, 2021
@furszy furszy added this to the 6.0.0 milestone Nov 8, 2021
Marko Bencun and others added 9 commits November 22, 2021 10:28
  Part of a series of changes to clean up the instantiation of connman by decoupling the command line arguments.

  Coming from btc@ce79f3251851f6177f38009341802e6065cb70af
Part of a series of changes to clean up the instantiation of connman by decoupling the command line arguments.  We also now abort with an error when explicit binds are set with -listen=0.

Coming from btc@ce79f3251851f6177f38009341802e6065cb70af
Start of a series of changes to clean up the instantiation of connman by decoupling the command line arguments.
Split the "-connect" argument parsing out of CConnman and put it into AppInitMain().
@furszy furszy force-pushed the 2021_connman_options_encapsulation branch from f48da39 to 8c02b59 Compare November 22, 2021 13:28
@furszy
Copy link
Author

furszy commented Nov 22, 2021

rebased on master after 2586 and 2587 merges.

@random-zebra
Copy link

Looking good. Just one thing: most of these CConnman members are being initialized without the required locks. You could include bitcoin#11744 to this list of backports.

@furszy
Copy link
Author

furszy commented Nov 26, 2021

sounds good, adding it..

* writing variable 'nTotalBytesRecv' requires holding mutex 'cs_totalBytesRecv' exclusively
* writing variables 'nTotalBytesSent' require holding mutex 'cs_totalBytesSent' exclusively
* writing variable 'vAddedNodes' requires holding mutex 'cs_vAddedNodes' exclusively

Backports btc@63f21d27ee463dafc32982d1ac50a1032449dd36 without the nMaxOut* variable changes that we don't have.
@furszy
Copy link
Author

furszy commented Nov 26, 2021

Added bitcoin#11744 without the outbound members changes as we don't have them yet.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK e1d12d3

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e1d12d3

@furszy furszy merged commit 97728e5 into PIVX-Project:master Dec 7, 2021
furszy added a commit that referenced this pull request Jan 19, 2022
…rk layer

ac014fb RPC: document getpeerinfo quorum members values (furszy)
b39f275 test: add coverage for regular peers disconnecting after receiving an authenticated connection. (furszy)
758e19f p2p: do not send MN connection flag and challenge in the version msg if the connection is not meant to be a DMN-to-DMN. (furszy)
cb34b51 Define constants for MN metadata manager filename and magic string. (furszy)
b1a9637 Speed up functional tests decreasing the regtest tierTwo chain sync check up to the minimum. (furszy)
693bff6 mn_net: store local DMN protxhash instead of access the activeMnManager object. (furszy)
6015d90 mnsync: decouple IsBlockchainSync into a publicly available g_tiertwo_sync_state class which only stores the final value. (furszy)
038191c net_mn: extract cs_main/Misbehaving from mnauth::ProcessMessage to net_processing. (furszy)
a38fdf3 add -pushversion help message (furszy)
de436d3 net_processing: add missing return to the process verack msg flow. (furszy)
747f838 net_processing: try to update iqr member field if "qsendrecsigs" is received. (furszy)
a2b478f net_mn: don't try to connect to ourselves. (furszy)
6b4d616 Node stats: add m_masternode_iqr_connection and m_masternode_probe_connection. (furszy)
13440cc net_mn: use string connection instead of addr to bypass the single IP conn requirement. (furszy)
72ef11d Test: add MN-to-MN, MN-to-quorum, MN-to-relay_members and probe MN connection test coverage (furszy)
80d7d6b bump protocol version to 70925 (furszy)
acefaa8 RPC: add verified DMN connection info to 'getpeerinfo' (furszy)
3897ae5 net_mn: cache MN quorum relay members + let them know that we are interested in plain LLMQ recovered signatures. (furszy)
1c16a2f protocol: introduce QSENDRECSIGS net message. (furszy)
01ba363 net_mn: decouple g_args from the MN networking sources. (furszy)
934dd8c net_mn: add single MN connection process. (furszy)
15d70e7 net_mn: connect MN probing connections functionality. (furszy)
b5074b4 net_mn: add MN probe connection workflow. (furszy)
a0ef04e rpc: use snake_case for 'protx_list' verbose response json keys. (furszy)
4aa7bfd rpc: add MN meta info to the 'protx_list' verbose response. (furszy)
12bd6a3 net_mn: add mn-only connections cleanup process (furszy)
026ec74 net: if we are a MN, don't accept incoming connections until the node is fully synced. (furszy)
e7e44f1 net_mn: protect verified MN connections from eviction + don't try to connect to already connected MNs. (furszy)
cfa0238 net: introduce and connect MN authentication workflow. (furszy)
e7c8892 net_mn: implement and connect new tier two connections manager. (furszy)
26a3cf5 net: introduce masternode-only connections. (furszy)
711b874 Introduce masternode net metadata manager (furszy)
c724137 Introduce generic flatdb implementation (furszy)

Pull request description:

  Built on top of #2607, #2632 and #2639. Focused on implementing the Masternode quorums network communication layer.

  This layer is in charge of:
  1) Open MN-to-MN, MN-to-Quorum, MN-to-MN_iqr (intra-quorum relay) and MN-to-MN-probe connections.
  2) Implement a challenge-based connection authentication for MNs (new network message `mnauth` introduced).
  3) Cache and store MN connections metadata such as the last successful connection time and the last connection attempt time.
  4) Protect verified MN connections from eviction while they are part of the active quorum.
  5) Send interest in plain LLMQ recovered sigs (`QSENDRECSIGS` net message).

  Plus, added a new functional test `p2p_quorum_connect.py` which basically verifies the proper functioning of most of this points (except the eviction process).

  And finally, bumped the protocol version to 70925 so peers can know to whom they can, or not, send the new p2p messages.

ACKs for top commit:
  random-zebra:
    utACK ac014fb
  Fuzzbawls:
    ACK ac014fb

Tree-SHA512: 16af1e43ee8f225968accbfa9c628eead9e61f7c9ff656b205f3c936ccc6e4df205940ff756c807ad507942605bb9ff0c5d97b458af798b12311b6bfd9f49c1a
@Fuzzbawls Fuzzbawls modified the milestones: 6.0.0, 5.5.0 Sep 11, 2022
@furszy furszy deleted the 2021_connman_options_encapsulation branch November 29, 2022 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants