Felix Lange
7efeb4bd96
p2p: bump maxAcceptConns and defaultDialTimout
...
On the test network, we've seen that it becomes harder to connect
if the queues are so short.
10 years ago
Felix Lange
d4f0a67323
p2p: drop connections with no matching protocols
10 years ago
Felix Lange
9c0f36c46d
p2p: use maxDialingConns instead of maxAcceptConns as dial limit
10 years ago
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
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
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
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
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
5f735d6fce
cmd, eth, p2p, p2p/discover: init and clean up the seed cache
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
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
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
c5332537f5
p2p: limit number of lingering inbound pre-handshake connections
...
This is supposed to apply some back pressure so Server is not accepting
more connections than it can actually handle. The current limit is 50.
This doesn't really need to be configurable, but we'll see how it
behaves in our test nodes and adjust accordingly.
10 years ago
Felix Lange
56977c225e
p2p: use RLock instead of Lock for pre-dial checks
10 years ago
Felix Lange
b3c058a9e4
p2p: improve disconnect signaling at handshake time
...
As of this commit, p2p will disconnect nodes directly after the
encryption handshake if too many peer connections are active.
Errors in the protocol handshake packet are now handled more politely
by sending a disconnect packet before closing the connection.
10 years ago
Felix Lange
145330fdf2
p2p: properly decrement peer wait group counter for setup errors
10 years ago
Felix Lange
22d1f0faf1
p2p: improve peer selection logic
...
This commit introduces a new (temporary) peer selection
strategy based on random lookups.
While we're here, also implement the TODOs in dialLoop.
10 years ago
obscuren
688d118c7e
Updated logging
10 years ago
Felix Lange
5ba51594c7
p2p: use package rlp to encode messages
...
Message encoding functions have been renamed to catch any uses.
The switch to the new encoder can cause subtle incompatibilities.
If there are any users outside of our tree, they will at least be
alerted that there was a change.
NewMsg no longer exists. The replacements for EncodeMsg are called
Send and SendItems.
10 years ago
obscuren
b523441361
Moved ethutil => common
10 years ago
zelig
e150832734
p2p: server>discover table Self=Node exported
10 years ago
Taylor Gerring
485e37e889
Move MakeName to ethutil
10 years ago
Taylor Gerring
9723191b19
Undo client_version changes
10 years ago
Felix Lange
215c763d53
eth, p2p: delete p2p.Blacklist
...
It is unused and untested right now. We can
bring it back later if required.
10 years ago
Felix Lange
22659a7fea
p2p: restore read/write timeouts
...
They got lost in the transition to rlpxFrameRW.
10 years ago
Felix Lange
7964f30dcb
p2p: msg.Payload contains list data
...
With RLPx frames, the message code is contained in the
frame and is no longer part of the encoded data.
EncodeMsg, Msg.Decode have been updated to match.
Code that decodes RLP directly from Msg.Payload will need
to change.
10 years ago
Felix Lange
736e632215
p2p: use RLPx frames for messaging
10 years ago
Taylor Gerring
e7b33e9ae7
Move p2p.MakeName to ethutil.MakeVersion
10 years ago
Felix Lange
3719db352a
p2p: emit JSON connect/disconnect events
10 years ago
Felix Lange
dd871e791c
p2p: initialize Server.ourHandshake before accepting connections
10 years ago
Felix Lange
73f94f3755
p2p: disable encryption handshake
...
The diff is a bit bigger than expected because the protocol handshake
logic has moved out of Peer. This is necessary because the protocol
handshake will have custom framing in the final protocol.
10 years ago
obscuren
09e53367a2
Use a mutex write-lock for a write operation
10 years ago
Felix Lange
5cc1256fd6
p2p: ensure we don't dial ourself
...
addPeer doesn't allow self connects, but we can avoid opening
connections in the first place.
10 years ago
Felix Lange
7101f44998
p2p: add I/O timeout for encrytion handshake
10 years ago
Felix Lange
22ee366ed6
p2p: fix goroutine leak for invalid peers
...
The deflect logic called Disconnect on the peer, but the peer never ran
and wouldn't process the disconnect request.
10 years ago
Felix Lange
170eb3ac68
p2p/discover: map listening port using configured mechanism
10 years ago