-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: Merge bitcoin#28172, 28464 #7186
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -645,7 +645,7 @@ void SetupServerArgs(ArgsManager& argsman) | |||||||
| argsman.AddArg("-forcednsseed", strprintf("Always query for peer addresses via DNS lookup (default: %u)", DEFAULT_FORCEDNSSEED), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-listen", strprintf("Accept connections from outside (default: %u if no -proxy, -connect or -maxconnections=0)", DEFAULT_LISTEN), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-listenonion", strprintf("Automatically create Tor onion service (default: %d)", DEFAULT_LISTEN_ONION), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> connections to peers (temporary service connections excluded) (default: %u). This limit does not apply to connections manually added via -addnode or the addnode RPC, which have a separate limit of %u.", DEFAULT_MAX_PEER_CONNECTIONS, MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> automatic connections to peers (temporary service connections excluded) (default: %u). This limit does not apply to connections manually added via -addnode or the addnode RPC, which have a separate limit of %u.", DEFAULT_MAX_PEER_CONNECTIONS, MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-maxreceivebuffer=<n>", strprintf("Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXRECEIVEBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-maxsendbuffer=<n>", strprintf("Maximum per-connection memory usage for the send buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXSENDBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
| argsman.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by outbound peers forward or backward by this amount (default: %u seconds).", DEFAULT_MAX_TIME_ADJUSTMENT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||||||
|
|
@@ -2512,12 +2512,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) | |||||||
|
|
||||||||
| CConnman::Options connOptions; | ||||||||
| connOptions.nLocalServices = nLocalServices; | ||||||||
| connOptions.nMaxConnections = nMaxConnections; | ||||||||
| connOptions.m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, connOptions.nMaxConnections); | ||||||||
| connOptions.m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, connOptions.nMaxConnections-connOptions.m_max_outbound_full_relay); | ||||||||
| connOptions.m_max_outbound_onion = std::min(MAX_DESIRED_ONION_CONNECTIONS, connOptions.nMaxConnections / 2); | ||||||||
| connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS; | ||||||||
| connOptions.nMaxFeeler = MAX_FEELER_CONNECTIONS; | ||||||||
| connOptions.m_max_automatic_connections = nMaxConnections; | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: bitcoin#28464 merge resolution drops Dash's onion outbound-limit calculation New in the latest delta, superseding the assignment-order mechanism reported by prior-1, prior-2, and prior-4. Before this backport,
Suggested change
source: ['codex']
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved in this update — bitcoin#28464 merge resolution drops Dash's onion outbound-limit calculation no longer present. Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread. |
||||||||
| connOptions.uiInterface = &uiInterface; | ||||||||
|
knst marked this conversation as resolved.
|
||||||||
| connOptions.m_banman = node.banman.get(); | ||||||||
| connOptions.m_msgproc = node.peerman.get(); | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1218,12 +1218,8 @@ friend class CNode; | |||||
| struct Options | ||||||
| { | ||||||
| ServiceFlags nLocalServices = NODE_NONE; | ||||||
| int nMaxConnections = 0; | ||||||
| int m_max_outbound_full_relay = 0; | ||||||
| int m_max_outbound_block_relay = 0; | ||||||
| int m_max_outbound_onion = 0; | ||||||
| int nMaxAddnode = 0; | ||||||
| int nMaxFeeler = 0; | ||||||
| int m_max_automatic_connections = 0; | ||||||
| CClientUIInterface* uiInterface = nullptr; | ||||||
| NetEventsInterface* m_msgproc = nullptr; | ||||||
| BanMan* m_banman = nullptr; | ||||||
|
|
@@ -1252,14 +1248,13 @@ friend class CNode; | |||||
| AssertLockNotHeld(m_total_bytes_sent_mutex); | ||||||
|
|
||||||
| nLocalServices = connOptions.nLocalServices; | ||||||
| nMaxConnections = connOptions.nMaxConnections; | ||||||
| m_max_outbound_full_relay = std::min(connOptions.m_max_outbound_full_relay, connOptions.nMaxConnections); | ||||||
| m_max_outbound_block_relay = connOptions.m_max_outbound_block_relay; | ||||||
| m_max_automatic_connections = connOptions.m_max_automatic_connections; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this newly-derived automatic limit is set, Useful? React with 👍 / 👎. |
||||||
| m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, m_max_automatic_connections); | ||||||
| m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, m_max_automatic_connections - m_max_outbound_full_relay); | ||||||
| m_max_automatic_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + m_max_feeler; | ||||||
| m_max_inbound = std::max(0, m_max_automatic_connections - m_max_automatic_outbound); | ||||||
| m_max_outbound_onion = connOptions.m_max_outbound_onion; | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: bitcoin#28464 merge resolution drops Dash's onion outbound-limit calculation Before this backport,
Suggested change
source: ['codex'] |
||||||
| m_use_addrman_outgoing = connOptions.m_use_addrman_outgoing; | ||||||
| nMaxAddnode = connOptions.nMaxAddnode; | ||||||
| nMaxFeeler = connOptions.nMaxFeeler; | ||||||
| m_max_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + nMaxFeeler; | ||||||
| m_client_interface = connOptions.uiInterface; | ||||||
| m_banman = connOptions.m_banman; | ||||||
| m_msgproc = connOptions.m_msgproc; | ||||||
|
|
@@ -1874,7 +1869,18 @@ friend class CNode; | |||||
|
|
||||||
| std::unique_ptr<CSemaphore> semOutbound; | ||||||
| std::unique_ptr<CSemaphore> semAddnode; | ||||||
| int nMaxConnections; | ||||||
|
|
||||||
| /** | ||||||
| * Maximum number of automatic connections permitted, excluding manual | ||||||
| * connections but including inbounds. May be changed by the user and is | ||||||
| * potentially limited by the operating system (number of file descriptors). | ||||||
| */ | ||||||
| int m_max_automatic_connections; | ||||||
|
|
||||||
| /* | ||||||
| * Maximum number of peers by connection type. Might vary from defaults | ||||||
| * based on -maxconnections init value. | ||||||
| */ | ||||||
|
|
||||||
| // How many full-relay (tx, block, addr) outbound peers we want | ||||||
| int m_max_outbound_full_relay; | ||||||
|
|
@@ -1883,12 +1889,14 @@ friend class CNode; | |||||
| // We do not relay tx or addr messages with these peers | ||||||
| int m_max_outbound_block_relay; | ||||||
|
|
||||||
| // How many onion outbound peers we want; don't care if full or block only; does not increase m_max_outbound | ||||||
| // How many onion outbound peers we want; don't care if full or block only; does not increase m_max_automatic_outbound | ||||||
| int m_max_outbound_onion; | ||||||
|
|
||||||
| int nMaxAddnode; | ||||||
| int nMaxFeeler; | ||||||
| int m_max_outbound; | ||||||
| int m_max_addnode{MAX_ADDNODE_CONNECTIONS}; | ||||||
| int m_max_feeler{MAX_FEELER_CONNECTIONS}; | ||||||
| int m_max_automatic_outbound; | ||||||
| int m_max_inbound; | ||||||
|
|
||||||
| bool m_use_addrman_outgoing; | ||||||
| CClientUIInterface* m_client_interface; | ||||||
| NetEventsInterface* m_msgproc; | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.