• Martin Holst Swende's avatar
    p2p/msgrate: be more lenient when calculating 'mean' (#25653) · 06151eb5
    Martin Holst Swende authored
    The p2p msgrate tracker is a thing which tries to estimate some mean round-trip times. However, it did so in a very curious way: if a node had 200 peers, it would sort their 200 respective rtt estimates, and then it would pick item number 2 as the mean. So effectively taking third fastest and calling it mean. This probably works "ok" when the number of peers are low (there are other factors too, such as ttlScaling which takes some of the edge off this) -- however when the number of peers is high, it becomes very skewed.
    
    This PR instead bases the 'mean' on the square root of the length of the list. Still pretty harsh, but a bit more lenient.
    06151eb5
Name
Last commit
Last update
..
discover Loading commit data...
dnsdisc Loading commit data...
enode Loading commit data...
enr Loading commit data...
msgrate Loading commit data...
nat Loading commit data...
netutil Loading commit data...
nodestate Loading commit data...
rlpx Loading commit data...
simulations Loading commit data...
tracker Loading commit data...
dial.go Loading commit data...
dial_test.go Loading commit data...
message.go Loading commit data...
message_test.go Loading commit data...
metrics.go Loading commit data...
peer.go Loading commit data...
peer_error.go Loading commit data...
peer_test.go Loading commit data...
protocol.go Loading commit data...
server.go Loading commit data...
server_test.go Loading commit data...
transport.go Loading commit data...
transport_test.go Loading commit data...
util.go Loading commit data...
util_test.go Loading commit data...