Commit Graph

174 Commits

Author SHA1 Message Date
Felix Lange
d4f0a67323 p2p: drop connections with no matching protocols 2015-05-08 16:09:55 +02:00
Felix Lange
9c0f36c46d p2p: use maxDialingConns instead of maxAcceptConns as dial limit 2015-05-08 16:09:55 +02:00
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.
2015-05-08 16:09:54 +02:00
Péter Szilágyi
8735e5addd p2p: increase the handshake timeout in the tests 2015-05-07 15:30:56 +03:00
Péter Szilágyi
4d5a719f25 cmd, eth, p2p: introduce pending peer cli arg, add tests 2015-05-07 15:30:56 +03:00
Péter Szilágyi
af93217775 p2p: reduce the concurrent handshakes to 10/10 in/out 2015-05-07 15:22:09 +03:00
Péter Szilágyi
2060bc8bac p2p: fix dial throttling race condition 2015-05-07 15:22:08 +03:00
Péter Szilágyi
29fef349ef p2p: fix a dialing race in the throttler 2015-05-07 15:22:08 +03:00
Péter Szilágyi
3953bf0031 p2p: limit the outbound dialing too 2015-05-07 15:22:08 +03:00
Jeffrey Wilcke
a0cb1945ae Merge pull request #866 from fjl/p2p-last-minute
Last minute p2p fixes
2015-05-06 14:49:52 -07:00
Felix Lange
3e2a928caa p2p: stop dialing at half the maximum peer count 2015-05-06 23:44:51 +02:00
Felix Lange
6a2fec5309 p2p, whisper: use glog for peer-level logging 2015-05-06 23:19:14 +02:00
Felix Lange
bcfd788661 p2p/discover: bump packet timeouts to 500ms 2015-05-06 22:59:00 +02:00
Felix Lange
fd4b75cfa8 p2p/nat: less confusing error logging 2015-05-06 22:58:03 +02:00
obscuren
062fa049d0 fixed merge issue 2015-05-06 22:54:21 +02:00
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.
2015-05-06 16:10:41 +02:00
Péter Szilágyi
4accc187d5 eth, p2p: add trusted node list beside static list 2015-05-04 13:59:51 +03:00
Péter Szilágyi
54db54931e p2p: add static node dialing test 2015-05-04 13:08:42 +03:00
Péter Szilágyi
e82ddd9198 p2p: correct a leftover trusted -> static 2015-04-30 19:34:33 +03:00
Péter Szilágyi
413ace37d3 eth, p2p: rename trusted nodes to static, drop inbound extra slots 2015-04-30 19:32:48 +03:00
Péter Szilágyi
701591b403 cmd, eth, p2p: fix review issues enumerated by Felix 2015-04-30 16:15:29 +03:00
Péter Szilágyi
1528dbc171 p2p: add trust check to handshake, test privileged connectivity
Conflicts:
	p2p/server_test.go
2015-04-30 16:06:47 +03:00
Péter Szilágyi
14f32a0c3a p2p: reduce the severity of a debug log 2015-04-30 16:04:09 +03:00
Péter Szilágyi
de0549fabb cmd/geth, cmd/mist, cmd/utils, eth, p2p: support trusted peers 2015-04-30 16:03:10 +03:00
Felix Lange
72ab6d3255 p2p/discover: track sha3(ID) in Node 2015-04-30 15:02:23 +02:00
Felix Lange
b34a8ef624 p2p, p2p/discover: protocol version 4 2015-04-30 14:57:34 +02:00
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.
2015-04-30 14:57:33 +02:00
obscuren
01e3d694a6 p2p: added received at to peer message
p2p.Msg.ReceivedAt can be used for determining block propagation from
begining to end.
2015-04-29 22:49:58 +02:00
Péter Szilágyi
b569550a39 p2p/discover: fix api issues caused by leveldb update 2015-04-28 13:57:57 +03:00
Péter Szilágyi
4992765032 p2p/discover: fix goroutine leak due to blocking on sync.Once 2015-04-28 10:28:04 +03:00
Péter Szilágyi
437cf4b3ac p2p/discover: add node expirer and related tests 2015-04-27 17:38:28 +03:00
Péter Szilágyi
a136e2bb22 p2p/discover: parametrize nodedb version, add persistency tests 2015-04-27 15:28:17 +03:00
Péter Szilágyi
75fd738dea p2p/discover: drop a superfluous warning 2015-04-27 15:06:31 +03:00
Péter Szilágyi
706da56f75 p2p/discover: wrap the pinger to update the node db too 2015-04-27 14:56:42 +03:00
Péter Szilágyi
85b4b44235 p2p/discover: use iterator based seeding, drop old protocol test 2015-04-27 14:45:35 +03:00
Péter Szilágyi
8de8f61d36 p2p/discover: write the basic tests, catch RLP bug 2015-04-27 12:33:06 +03:00
Péter Szilágyi
0201c04b95 p2p/discovery: fix issues raised in the nodeDb PR 2015-04-27 10:19:16 +03:00
Péter Szilágyi
8646365b42 cmd/bootnode, eth, p2p, p2p/discover: use a fancier db design 2015-04-24 18:04:41 +03:00
Péter Szilágyi
6def110c37 cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth. 2015-04-24 11:33:55 +03:00
Péter Szilágyi
971702e7a1 p2p/discovery: fix broken tests due to API update 2015-04-24 11:23:20 +03:00
Péter Szilágyi
af923c965f p2p/discovery: use the seed table for finding nodes, auto drop stale ones 2015-04-24 11:23:20 +03:00
Péter Szilágyi
5f735d6fce cmd, eth, p2p, p2p/discover: init and clean up the seed cache 2015-04-24 11:23:20 +03:00
Felix Lange
936c8e19ff p2p/discover: store nodes in leveldb 2015-04-24 11:23:20 +03:00
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.
2015-04-22 12:31:19 +02:00
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.
2015-04-17 14:45:10 +02:00
Felix Lange
eedbb1ee9a p2p/discover: use rlp.DecodeBytes 2015-04-17 14:45:09 +02:00
Felix Lange
56a48101dc cmd/rlpdump, cmd/utils, eth, p2p, whisper: use rlp input limit 2015-04-17 14:45:09 +02:00
Felix Lange
5528abc795 p2p: fix the dial timer
The dial timer was not reset properly when the peer count reached
MaxPeers.
2015-04-17 08:17:01 +02:00
obscuren
474aa924ca p2p: added limiter function to limit package broadcasting 2015-04-14 12:47:31 +02:00
Felix Lange
0217652d1b p2p/discover: improve timer handling for reply timeouts 2015-04-13 18:08:11 +02:00