forked from algorand/go-algorand
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update network disconnection logic (algorand#668)
Gossip networks connections in previous releases were randomly selected, stable connections. That approach has its advantages, but is also susceptible to two major problems : inefficient connections and clique formation. This PR attempt to address both of the above issues. In this PR, we add an "attribute" to each outgoing connection called "throttled connection". A throttled connection is a connection who's performance is being tested continuously. The performance comparison is always done over the set of outgoing connections. Once we complete the performance test, we disconnect the throttled connection who performed the worse. That would allow us to continuously attempt to "improve" our outgoing connections pool for the fastest relays. Unfortunately, the above would also expedite the formation of cliques. Prior to this PR, our response for cliques formation was to restart the node. In this PR, we have two separate mechanisms to handle cliques: Avoidance; When creating a relay node, we configure only half of it's outgoing connections to be throttled connections. That reduce the likelihood of clique formation. For a non-relay, that's not an issue. Fix existing clique; This PR add a dedicated feedback between the agreement service and the network layer. The network layer is exposing a watchdog-style handler that is being invoked by the agreement service. That allows the network library to determine if it's unable to make progress. When that happens, a random outgoing connection is being disconnected.
- Loading branch information
1 parent
25d0d6e
commit 7b17012
Showing
11 changed files
with
616 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.