plugeth/p2p/discover
Felix Lange 9123eceb0f p2p, p2p/discover: misc connectivity improvements (#16069)
* p2p: add DialRatio for configuration of inbound vs. dialed connections

* p2p: add connection flags to PeerInfo

* p2p/netutil: add SameNet, DistinctNetSet

* p2p/discover: improve revalidation and seeding

This changes node revalidation to be periodic instead of on-demand. This
should prevent issues where dead nodes get stuck in closer buckets
because no other node will ever come along to replace them.

Every 5 seconds (on average), the last node in a random bucket is
checked and moved to the front of the bucket if it is still responding.
If revalidation fails, the last node is replaced by an entry of the
'replacement list' containing recently-seen nodes.

Most close buckets are removed because it's very unlikely we'll ever
encounter a node that would fall into any of those buckets.

Table seeding is also improved: we now require a few minutes of table
membership before considering a node as a potential seed node. This
should make it less likely to store short-lived nodes as potential
seeds.

* p2p/discover: fix nits in UDP transport

We would skip sending neighbors replies if there were fewer than
maxNeighbors results and CheckRelayIP returned an error for the last
one. While here, also resolve a TODO about pong reply tokens.
2018-02-12 14:36:09 +02:00
..
database_test.go all: gofmt -w -s 2017-01-06 15:52:03 +01:00
database.go p2p/discover: fix leaked goroutine in data expiration 2017-12-18 09:16:54 +01:00
node_test.go p2p: add network simulation framework (#14982) 2017-09-25 10:08:07 +02:00
node.go p2p, p2p/discover: misc connectivity improvements (#16069) 2018-02-12 14:36:09 +02:00
ntp.go p2p, p2p/discover, p2p/nat: rework logging using context keys 2017-02-28 10:20:29 +01:00
table_test.go p2p, p2p/discover: misc connectivity improvements (#16069) 2018-02-12 14:36:09 +02:00
table.go p2p, p2p/discover: misc connectivity improvements (#16069) 2018-02-12 14:36:09 +02:00
udp_test.go p2p, p2p/discover: misc connectivity improvements (#16069) 2018-02-12 14:36:09 +02:00
udp.go p2p, p2p/discover: misc connectivity improvements (#16069) 2018-02-12 14:36:09 +02:00