Felix Lange
914e57e49b
p2p: fix disconnect at capacity
...
With the introduction of static/trusted nodes, the peer count
can go above MaxPeers. Update the capacity check to handle this.
While here, decouple the trusted nodes check from the handshake
by passing a function instead.
10 years ago
Péter Szilágyi
8735e5addd
p2p: increase the handshake timeout in the tests
10 years ago
Péter Szilágyi
4d5a719f25
cmd, eth, p2p: introduce pending peer cli arg, add tests
10 years ago
Péter Szilágyi
af93217775
p2p: reduce the concurrent handshakes to 10/10 in/out
10 years ago
Péter Szilágyi
2060bc8bac
p2p: fix dial throttling race condition
10 years ago
Péter Szilágyi
29fef349ef
p2p: fix a dialing race in the throttler
10 years ago
Péter Szilágyi
3953bf0031
p2p: limit the outbound dialing too
10 years ago
Felix Lange
3e2a928caa
p2p: stop dialing at half the maximum peer count
10 years ago
Felix Lange
6a2fec5309
p2p, whisper: use glog for peer-level logging
10 years ago
Felix Lange
bcfd788661
p2p/discover: bump packet timeouts to 500ms
10 years ago
Felix Lange
fd4b75cfa8
p2p/nat: less confusing error logging
10 years ago
Felix Lange
2adcc31bb4
p2p/discover: new distance metric based on sha3(id)
...
The previous metric was pubkey1^pubkey2, as specified in the Kademlia
paper. We missed that EC public keys are not uniformly distributed.
Using the hash of the public keys addresses that. It also makes it
a bit harder to generate node IDs that are close to a particular node.
10 years ago
Péter Szilágyi
4accc187d5
eth, p2p: add trusted node list beside static list
10 years ago
Péter Szilágyi
54db54931e
p2p: add static node dialing test
10 years ago
Péter Szilágyi
e82ddd9198
p2p: correct a leftover trusted -> static
10 years ago
Péter Szilágyi
413ace37d3
eth, p2p: rename trusted nodes to static, drop inbound extra slots
10 years ago
Péter Szilágyi
701591b403
cmd, eth, p2p: fix review issues enumerated by Felix
10 years ago
Péter Szilágyi
1528dbc171
p2p: add trust check to handshake, test privileged connectivity
...
Conflicts:
p2p/server_test.go
10 years ago
Péter Szilágyi
14f32a0c3a
p2p: reduce the severity of a debug log
10 years ago
Péter Szilágyi
de0549fabb
cmd/geth, cmd/mist, cmd/utils, eth, p2p: support trusted peers
10 years ago
Felix Lange
72ab6d3255
p2p/discover: track sha3(ID) in Node
10 years ago
Felix Lange
b34a8ef624
p2p, p2p/discover: protocol version 4
10 years ago
Felix Lange
fc747ef4a6
p2p/discover: new endpoint format
...
This commit changes the discovery protocol to use the new "v4" endpoint
format, which allows for separate UDP and TCP ports and makes it
possible to discover the UDP address after NAT.
10 years ago
obscuren
01e3d694a6
p2p: added received at to peer message
...
p2p.Msg.ReceivedAt can be used for determining block propagation from
begining to end.
10 years ago
Péter Szilágyi
b569550a39
p2p/discover: fix api issues caused by leveldb update
10 years ago
Péter Szilágyi
4992765032
p2p/discover: fix goroutine leak due to blocking on sync.Once
10 years ago
Péter Szilágyi
437cf4b3ac
p2p/discover: add node expirer and related tests
10 years ago
Péter Szilágyi
a136e2bb22
p2p/discover: parametrize nodedb version, add persistency tests
10 years ago
Péter Szilágyi
75fd738dea
p2p/discover: drop a superfluous warning
10 years ago
Péter Szilágyi
706da56f75
p2p/discover: wrap the pinger to update the node db too
10 years ago
Péter Szilágyi
85b4b44235
p2p/discover: use iterator based seeding, drop old protocol test
10 years ago
Péter Szilágyi
8de8f61d36
p2p/discover: write the basic tests, catch RLP bug
10 years ago
Péter Szilágyi
0201c04b95
p2p/discovery: fix issues raised in the nodeDb PR
10 years ago
Péter Szilágyi
8646365b42
cmd/bootnode, eth, p2p, p2p/discover: use a fancier db design
10 years ago
Péter Szilágyi
6def110c37
cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth.
10 years ago
Péter Szilágyi
971702e7a1
p2p/discovery: fix broken tests due to API update
10 years ago
Péter Szilágyi
af923c965f
p2p/discovery: use the seed table for finding nodes, auto drop stale ones
10 years ago
Péter Szilágyi
5f735d6fce
cmd, eth, p2p, p2p/discover: init and clean up the seed cache
10 years ago
Felix Lange
936c8e19ff
p2p/discover: store nodes in leveldb
10 years ago
Felix Lange
635b66acdc
p2p: return zero node from Self if the server is not running
...
This helps with fixing the tests for cmd/geth to run without networking.
10 years ago
Felix Lange
9c7281c17e
p2p: make DiscReason bigger than byte
...
We decode into [1]DiscReason in a few places. That doesn't work anymore
because package rlp no longer accepts RLP lists for byte arrays.
10 years ago
Felix Lange
eedbb1ee9a
p2p/discover: use rlp.DecodeBytes
10 years ago
Felix Lange
56a48101dc
cmd/rlpdump, cmd/utils, eth, p2p, whisper: use rlp input limit
10 years ago
Felix Lange
5528abc795
p2p: fix the dial timer
...
The dial timer was not reset properly when the peer count reached
MaxPeers.
10 years ago
obscuren
474aa924ca
p2p: added limiter function to limit package broadcasting
10 years ago
Felix Lange
0217652d1b
p2p/discover: improve timer handling for reply timeouts
10 years ago
Felix Lange
b8aeb04f6f
p2p/discover: remove unused field Node.activeStamp
10 years ago
Felix Lange
b9929d289d
p2p: fix unsynchronized map access during Server shutdown
...
removePeer can be called even after listenLoop and dialLoop have returned.
10 years ago
Felix Lange
995fab2ebc
p2p: fix yet another disconnect hang
...
Peer.readLoop will only terminate if the connection is closed. Fix the
hang by closing the connection before waiting for readLoop to terminate.
This also removes the british disconnect procedure where we're waiting
for the remote end to close the connection. I have confirmed with
@subtly that cpp-ethereum doesn't adhere to it either.
10 years ago
Felix Lange
79a6782c1c
p2p: fix goroutine leak when handshake read fails
...
This regression was introduced in b3c058a9e4
.
10 years ago