aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/handshake.go
Commit message (Collapse)AuthorAgeFilesLines
* p2p: new dialer, peer management without locksFelix Lange2015-05-251-448/+0
| | | | | | | | | | | | | | | | | | The most visible change is event-based dialing, which should be an improvement over the timer-based system that we have at the moment. The dialer gets a chance to compute new tasks whenever peers change or dials complete. This is better than checking peers on a timer because dials happen faster. The dialer can now make more precise decisions about whom to dial based on the peer set and we can test those decisions without actually opening any sockets. Peer management is easier to test because the tests can inject connections at checkpoints (after enc handshake, after protocol handshake). Most of the handshake stuff is now part of the RLPx code. It could be exported or move to its own package because it is no longer entangled with Server logic.
* p2p: fix disconnect at capacityFelix Lange2015-05-081-12/+12
| | | | | | | 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.
* eth, p2p: add trusted node list beside static listPéter Szilágyi2015-05-041-7/+7
|
* eth, p2p: rename trusted nodes to static, drop inbound extra slotsPéter Szilágyi2015-05-011-7/+7
|
* p2p: add trust check to handshake, test privileged connectivityPéter Szilágyi2015-04-301-7/+7
| | | | | Conflicts: p2p/server_test.go
* p2p: fix goroutine leak when handshake read failsFelix Lange2015-04-131-1/+1
| | | | This regression was introduced in b3c058a9e4e9.
* p2p: improve disconnect signaling at handshake timeFelix Lange2015-04-101-26/+42
| | | | | | | 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.
* p2p: fix Peer shutdown deadlocksFelix Lange2015-04-101-1/+1
| | | | | | | | | | There were multiple synchronization issues in the disconnect handling, all caused by the odd special-casing of Peer.readLoop errors. Remove the special handling of read errors and make readLoop part of the Peer WaitGroup. Thanks to @Gustav-Simonsson for pointing at arrows in a diagram and playing rubber-duck.
* p2p: use package rlp to encode messagesFelix Lange2015-03-191-6/+2
| | | | | | | | | | 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.
* p2p: restore read/write timeoutsFelix Lange2015-03-041-5/+3
| | | | They got lost in the transition to rlpxFrameRW.
* p2p: verify protocol handshake node IDFelix Lange2015-03-041-0/+3
|
* p2p: make encryption handshake code easier to followFelix Lange2015-03-041-242/+207
| | | | | | | | | This mostly changes how information is passed around. Instead of using many function parameters and return values, put the entire state in a struct and pass that. This also adds back derivation of ecdhe-shared-secret. I deleted it by accident in a previous refactoring.
* p2p: use RLPx frames for messagingFelix Lange2015-03-041-17/+10
|
* p2p: encrypted and authenticated RLPx frame I/OFelix Lange2015-03-041-57/+100
|
* p2p: disable encryption handshakeFelix Lange2015-02-191-0/+434
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.