• Felix Lange's avatar
    p2p, p2p/discover: misc connectivity improvements (#16069) · 9123eceb
    Felix Lange authored
    * 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.
    9123eceb
Name
Last commit
Last update
.github Loading commit data...
accounts Loading commit data...
bmt Loading commit data...
build Loading commit data...
cmd Loading commit data...
common Loading commit data...
compression/rle Loading commit data...
consensus Loading commit data...
console Loading commit data...
containers Loading commit data...
contracts Loading commit data...
core Loading commit data...
crypto Loading commit data...
dashboard Loading commit data...
eth Loading commit data...
ethclient Loading commit data...
ethdb Loading commit data...
ethstats Loading commit data...
event Loading commit data...
internal Loading commit data...
les Loading commit data...
light Loading commit data...
log Loading commit data...
metrics Loading commit data...
miner Loading commit data...
mobile Loading commit data...
node Loading commit data...
p2p Loading commit data...
params Loading commit data...
rlp Loading commit data...
rpc Loading commit data...
swarm Loading commit data...
tests Loading commit data...
trie Loading commit data...
vendor Loading commit data...
whisper Loading commit data...
.dockerignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Dockerfile Loading commit data...
Dockerfile.alltools Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
appveyor.yml Loading commit data...
circle.yml Loading commit data...
interfaces.go Loading commit data...