mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-05 18:23:03 +01:00
Merge bitcoin/bitcoin#28170: p2p: adaptive connections services flags
27f260aa6enet: remove now unused global 'g_initial_block_download_completed' (furszy)aff7d92b15test: add coverage for peerman adaptive connections service flags (furszy)6ed53602acnet: peer manager, dynamically adjust desirable services flag (furszy)9f36e591c5net: move state dependent peer services flags (furszy)f9ac96b8d6net: decouple state independent service flags from desirable ones (furszy)97df4e3887net: store best block tip time inside PeerManager (furszy) Pull request description: Derived from #28120 discussion. By relocating the peer desirable services flags into the peer manager, we allow the connections acceptance process to handle post-IBD potential stalling scenarios. The peer manager will be able to dynamically adjust the services flags based on the node's proximity to the tip (back and forth). Allowing the node to recover from the following post-IBD scenario: Suppose the node has successfully synced the chain, but later experienced dropped connections and remained inactive for a duration longer than the limited peers threshold (the timeframe within which limited peers can provide blocks). In such cases, upon reconnecting to the network, the node might only establish connections with limited peers, filling up all available outbound slots. Resulting in an inability to synchronize the chain (because limited peers will not provide blocks older than the `NODE_NETWORK_LIMITED_MIN_BLOCKS` threshold). ACKs for top commit: achow101: ACK27f260aa6evasild: ACK27f260aa6enaumenkogs: ACK27f260aa6emzumsande: Light Code Review ACK27f260aa6eandrewtoth: ACK27f260aa6eTree-SHA512: 07befb9bcd0b60a4e7c45e4429c02e7b6c66244f0910f4b2ad97c9b98258b6f46c914660a717b5ed4ef4814d0dbfae6e18e6559fe9bec7d0fbc2034109200953
This commit is contained in:
@@ -1005,6 +1005,12 @@ public:
|
||||
/** Handle removal of a peer (clear state) */
|
||||
virtual void FinalizeNode(const CNode& node) = 0;
|
||||
|
||||
/**
|
||||
* Callback to determine whether the given set of service flags are sufficient
|
||||
* for a peer to be "relevant".
|
||||
*/
|
||||
virtual bool HasAllDesirableServiceFlags(ServiceFlags services) const = 0;
|
||||
|
||||
/**
|
||||
* Process protocol messages received from a given node
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user