Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | p2p/nat: fix concurrent access to autodisc Interface | Felix Lange | 2015-05-14 | 2 | -17/+63 |
| | | | | | | | | | | | | Concurrent calls to Interface methods on autodisc could return a "not discovered" error if the discovery did not finish before the call. autodisc.wait expected the done channel to carry the found Interface but it was closed instead. The fix is to use sync.Once for now, which is easier to get right. And there is a test. Finally. This will have to change again when we introduce re-discovery. | ||||
* | p2p/discover: fix out-of-bounds slicing for chunked neighbors packets | Felix Lange | 2015-05-14 | 2 | -32/+49 |
| | | | | | The code assumed that Table.closest always returns at least 13 nodes. This is not true for small tables (e.g. during bootstrap). | ||||
* | fix test. | subtly | 2015-05-14 | 1 | -1/+1 |
| | |||||
* | Manual send of multiple neighbours packets. Test receiving multiple ↵ | subtly | 2015-05-14 | 2 | -3/+19 |
| | | | | neighbours packets. | ||||
* | UDP Interop. Limit datagrams to 1280bytes. | subtly | 2015-05-14 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't have a UDP which specifies any messages that will be 4KB. Aside from being implemented for months and a necessity for encryption and piggy-backing packets, 1280bytes is ideal, and, means this TODO can be completed! Why 1280 bytes? * It's less than the default MTU for most WAN/LAN networks. That means fewer fragmented datagrams (esp on well-connected networks). * Fragmented datagrams and dropped packets suck and add latency while OS waits for a dropped fragment to never arrive (blocking readLoop()) * Most of our packets are < 1280 bytes. * 1280 bytes is minimum datagram size and MTU for IPv6 -- on IPv6, a datagram < 1280bytes will *never* be fragmented. UDP datagrams are dropped. A lot! And fragmented datagrams are worse. If a datagram has a 30% chance of being dropped, then a fragmented datagram has a 60% chance of being dropped. More importantly, we have signed packets and can't do anything with a packet unless we receive the entire datagram because the signature can't be verified. The same is true when we have encrypted packets. So the solution here to picking an ideal buffer size for receiving datagrams is a number under 1400bytes. And the lower-bound value for IPv6 of 1280 bytes make's it a non-decision. On IPv4 most ISPs and 3g/4g/let networks have an MTU just over 1400 -- and *never* over 1500. Never -- that means packets over 1500 (in reality: ~1450) bytes are fragmented. And probably dropped a lot. Just to prove the point, here are pings sending non-fragmented packets over wifi/ISP, and a second set of pings via cell-phone tethering. It's important to note that, if *any* router between my system and the EC2 node has a lower MTU, the message would not go through: On wifi w/normal ISP: localhost:Debug $ ping -D -s 1450 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1450 data bytes 1458 bytes from 52.6.250.242: icmp_seq=0 ttl=42 time=104.831 ms 1458 bytes from 52.6.250.242: icmp_seq=1 ttl=42 time=119.004 ms ^C --- 52.6.250.242 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 104.831/111.918/119.004/7.087 ms localhost:Debug $ ping -D -s 1480 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1480 data bytes ping: sendto: Message too long ping: sendto: Message too long Request timeout for icmp_seq 0 ping: sendto: Message too long Request timeout for icmp_seq 1 Tethering to O2: localhost:Debug $ ping -D -s 1480 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1480 data bytes ping: sendto: Message too long ping: sendto: Message too long Request timeout for icmp_seq 0 ^C --- 52.6.250.242 ping statistics --- 2 packets transmitted, 0 packets received, 100.0% packet loss localhost:Debug $ ping -D -s 1450 52.6.250.242 PING 52.6.250.242 (52.6.250.242): 1450 data bytes 1458 bytes from 52.6.250.242: icmp_seq=0 ttl=42 time=107.844 ms 1458 bytes from 52.6.250.242: icmp_seq=1 ttl=42 time=105.127 ms 1458 bytes from 52.6.250.242: icmp_seq=2 ttl=42 time=120.483 ms 1458 bytes from 52.6.250.242: icmp_seq=3 ttl=42 time=102.136 ms | ||||
* | removed redundant newlines in import block | Bas van Kervel | 2015-05-12 | 1 | -1/+1 |
| | |||||
* | replaced several path.* with filepath.* which is platform independent | Bas van Kervel | 2015-05-12 | 1 | -2/+2 |
| | |||||
* | p2p: drop connections with no matching protocols | Felix Lange | 2015-05-08 | 2 | -4/+21 |
| | |||||
* | p2p: use maxDialingConns instead of maxAcceptConns as dial limit | Felix Lange | 2015-05-08 | 1 | -1/+1 |
| | |||||
* | p2p: fix disconnect at capacity | Felix Lange | 2015-05-08 | 4 | -33/+46 |
| | | | | | | | 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. | ||||
* | p2p: increase the handshake timeout in the tests | Péter Szilágyi | 2015-05-07 | 1 | -2/+2 |
| | |||||
* | cmd, eth, p2p: introduce pending peer cli arg, add tests | Péter Szilágyi | 2015-05-07 | 2 | -7/+148 |
| | |||||
* | p2p: reduce the concurrent handshakes to 10/10 in/out | Péter Szilágyi | 2015-05-07 | 1 | -2/+2 |
| | |||||
* | p2p: fix dial throttling race condition | Péter Szilágyi | 2015-05-07 | 1 | -1/+1 |
| | |||||
* | p2p: fix a dialing race in the throttler | Péter Szilágyi | 2015-05-07 | 1 | -1/+1 |
| | |||||
* | p2p: limit the outbound dialing too | Péter Szilágyi | 2015-05-07 | 1 | -1/+11 |
| | |||||
* | Merge pull request #866 from fjl/p2p-last-minute | Jeffrey Wilcke | 2015-05-07 | 4 | -19/+16 |
|\ | | | | | Last minute p2p fixes | ||||
| * | p2p: stop dialing at half the maximum peer count | Felix Lange | 2015-05-07 | 1 | -1/+1 |
| | | |||||
| * | p2p, whisper: use glog for peer-level logging | Felix Lange | 2015-05-07 | 1 | -13/+8 |
| | | |||||
| * | p2p/discover: bump packet timeouts to 500ms | Felix Lange | 2015-05-07 | 1 | -2/+2 |
| | | |||||
| * | p2p/nat: less confusing error logging | Felix Lange | 2015-05-07 | 1 | -3/+5 |
| | | |||||
* | | fixed merge issue | obscuren | 2015-05-07 | 4 | -30/+263 |
|\ \ | |/ |/| | |||||
| * | eth, p2p: add trusted node list beside static list | Péter Szilágyi | 2015-05-04 | 4 | -39/+47 |
| | | |||||
| * | p2p: add static node dialing test | Péter Szilágyi | 2015-05-04 | 2 | -13/+108 |
| | | |||||
| * | p2p: correct a leftover trusted -> static | Péter Szilágyi | 2015-05-01 | 1 | -4/+4 |
| | | |||||
| * | eth, p2p: rename trusted nodes to static, drop inbound extra slots | Péter Szilágyi | 2015-05-01 | 4 | -46/+48 |
| | | |||||
| * | cmd, eth, p2p: fix review issues enumerated by Felix | Péter Szilágyi | 2015-04-30 | 2 | -21/+12 |
| | | |||||
| * | p2p: add trust check to handshake, test privileged connectivity | Péter Szilágyi | 2015-04-30 | 4 | -15/+88 |
| | | | | | | | | | | Conflicts: p2p/server_test.go | ||||
| * | p2p: reduce the severity of a debug log | Péter Szilágyi | 2015-04-30 | 1 | -1/+1 |
| | | |||||
| * | cmd/geth, cmd/mist, cmd/utils, eth, p2p: support trusted peers | Péter Szilágyi | 2015-04-30 | 2 | -14/+78 |
| | | |||||
* | | p2p/discover: new distance metric based on sha3(id) | Felix Lange | 2015-05-06 | 6 | -106/+354 |
| | | | | | | | | | | | | | | 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. | ||||
* | | p2p/discover: track sha3(ID) in Node | Felix Lange | 2015-04-30 | 8 | -99/+166 |
| | | |||||
* | | p2p, p2p/discover: protocol version 4 | Felix Lange | 2015-04-30 | 2 | -2/+2 |
| | | |||||
* | | p2p/discover: new endpoint format | Felix Lange | 2015-04-30 | 10 | -127/+158 |
|/ | | | | | | 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. | ||||
* | p2p: added received at to peer message | obscuren | 2015-04-30 | 2 | -3/+5 |
| | | | | | p2p.Msg.ReceivedAt can be used for determining block propagation from begining to end. | ||||
* | p2p/discover: fix api issues caused by leveldb update | Péter Szilágyi | 2015-04-28 | 1 | -4/+6 |
| | |||||
* | p2p/discover: fix goroutine leak due to blocking on sync.Once | Péter Szilágyi | 2015-04-28 | 2 | -13/+24 |
| | |||||
* | p2p/discover: add node expirer and related tests | Péter Szilágyi | 2015-04-27 | 3 | -4/+116 |
| | |||||
* | p2p/discover: parametrize nodedb version, add persistency tests | Péter Szilágyi | 2015-04-27 | 3 | -11/+62 |
| | |||||
* | p2p/discover: drop a superfluous warning | Péter Szilágyi | 2015-04-27 | 1 | -1/+1 |
| | |||||
* | p2p/discover: wrap the pinger to update the node db too | Péter Szilágyi | 2015-04-27 | 1 | -4/+15 |
| | |||||
* | p2p/discover: use iterator based seeding, drop old protocol test | Péter Szilágyi | 2015-04-27 | 2 | -45/+118 |
| | |||||
* | p2p/discover: write the basic tests, catch RLP bug | Péter Szilágyi | 2015-04-27 | 3 | -8/+150 |
| | |||||
* | p2p/discovery: fix issues raised in the nodeDb PR | Péter Szilágyi | 2015-04-27 | 2 | -36/+32 |
| | |||||
* | cmd/bootnode, eth, p2p, p2p/discover: use a fancier db design | Péter Szilágyi | 2015-04-24 | 7 | -160/+277 |
| | |||||
* | cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth. | Péter Szilágyi | 2015-04-24 | 7 | -140/+157 |
| | |||||
* | p2p/discovery: fix broken tests due to API update | Péter Szilágyi | 2015-04-24 | 2 | -4/+4 |
| | |||||
* | p2p/discovery: use the seed table for finding nodes, auto drop stale ones | Péter Szilágyi | 2015-04-24 | 2 | -5/+38 |
| | |||||
* | cmd, eth, p2p, p2p/discover: init and clean up the seed cache | Péter Szilágyi | 2015-04-24 | 4 | -8/+26 |
| | |||||
* | p2p/discover: store nodes in leveldb | Felix Lange | 2015-04-24 | 2 | -13/+73 |
| | |||||
* | p2p: return zero node from Self if the server is not running | Felix Lange | 2015-04-22 | 1 | -1/+6 |
| | | | | This helps with fixing the tests for cmd/geth to run without networking. | ||||
* | p2p: make DiscReason bigger than byte | Felix Lange | 2015-04-17 | 1 | -1/+1 |
| | | | | | 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. | ||||
* | p2p/discover: use rlp.DecodeBytes | Felix Lange | 2015-04-17 | 1 | -1/+1 |
| | |||||
* | cmd/rlpdump, cmd/utils, eth, p2p, whisper: use rlp input limit | Felix Lange | 2015-04-17 | 1 | -1/+2 |
| | |||||
* | p2p: fix the dial timer | Felix Lange | 2015-04-17 | 1 | -3/+8 |
| | | | | | The dial timer was not reset properly when the peer count reached MaxPeers. | ||||
* | p2p: added limiter function to limit package broadcasting | obscuren | 2015-04-14 | 1 | -0/+13 |
| | |||||
* | p2p/discover: improve timer handling for reply timeouts | Felix Lange | 2015-04-14 | 1 | -2/+3 |
| | |||||
* | p2p/discover: remove unused field Node.activeStamp | Felix Lange | 2015-04-13 | 2 | -16/+0 |
| | |||||
* | p2p: fix unsynchronized map access during Server shutdown | Felix Lange | 2015-04-13 | 1 | -0/+2 |
| | | | | removePeer can be called even after listenLoop and dialLoop have returned. | ||||
* | p2p: fix yet another disconnect hang | Felix Lange | 2015-04-13 | 1 | -22/+8 |
| | | | | | | | | | 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. | ||||
* | p2p: fix goroutine leak when handshake read fails | Felix Lange | 2015-04-13 | 1 | -1/+1 |
| | | | | This regression was introduced in b3c058a9e4e9. | ||||
* | p2p: limit number of lingering inbound pre-handshake connections | Felix Lange | 2015-04-10 | 1 | -1/+19 |
| | | | | | | | 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. | ||||
* | p2p: use RLock instead of Lock for pre-dial checks | Felix Lange | 2015-04-10 | 1 | -10/+12 |
| | |||||
* | p2p: improve disconnect signaling at handshake time | Felix Lange | 2015-04-10 | 4 | -35/+111 |
| | | | | | | | 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: don't mess with the socket deadline in Peer.readLoop | Felix Lange | 2015-04-10 | 1 | -1/+0 |
| | | | | netWrapper already sets a read deadline in ReadMsg. | ||||
* | p2p: properly decrement peer wait group counter for setup errors | Felix Lange | 2015-04-10 | 1 | -0/+11 |
| | |||||
* | p2p: fix Peer shutdown deadlocks | Felix Lange | 2015-04-10 | 4 | -78/+139 |
| | | | | | | | | | | 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: improve peer selection logic | Felix Lange | 2015-04-10 | 1 | -56/+61 |
| | | | | | | | This commit introduces a new (temporary) peer selection strategy based on random lookups. While we're here, also implement the TODOs in dialLoop. | ||||
* | p2p/discover: don't log packet content | Felix Lange | 2015-04-10 | 1 | -3/+4 |
| | |||||
* | p2p/discover: make packet processing less concurrent | Felix Lange | 2015-04-10 | 1 | -6/+4 |
| | |||||
* | Updated logging | obscuren | 2015-04-07 | 3 | -29/+27 |
| | |||||
* | p2p/discover: fix off by one error causing buckets to contain duplicates | Felix Lange | 2015-04-01 | 2 | -1/+43 |
| | |||||
* | p2p/discover: implement node bonding | Felix Lange | 2015-04-01 | 5 | -383/+649 |
| | | | | | | | | | | | | | | | | This a fix for an attack vector where the discovery protocol could be used to amplify traffic in a DDOS attack. A malicious actor would send a findnode request with the IP address and UDP port of the target as the source address. The recipient of the findnode packet would then send a neighbors packet (which is 16x the size of findnode) to the victim. Our solution is to require a 'bond' with the sender of findnode. If no bond exists, the findnode packet is not processed. A bond between nodes α and β is created when α replies to a ping from β. This (initial) version of the bonding implementation might still be vulnerable against replay attacks during the expiration time window. We will add stricter source address validation later. | ||||
* | p2p/discover: add version number to ping packet | Felix Lange | 2015-04-01 | 1 | -0/+8 |
| | | | | | | The primary motivation for doing this right now is that old PoC 8 nodes and newer PoC 9 nodes keep discovering each other, causing handshake failures. | ||||
* | fix p2p/testlog_test | zelig | 2015-03-24 | 1 | -5/+2 |
| | |||||
* | Merge branch 'develop' into conversion | obscuren | 2015-03-21 | 2 | -3/+3 |
|\ | |||||
| * | %#x => %x | obscuren | 2015-03-20 | 2 | -3/+3 |
| | | |||||
* | | p2p: interrupt MsgPipe payload read/write | Felix Lange | 2015-03-19 | 1 | -3/+6 |
| | | | | | | | | | | | | This is better because protocols might not actually read the payload for some errors (msg too big, etc.) which can be a pain to test with the old behaviour. | ||||
* | | p2p: log disconnect requests | Felix Lange | 2015-03-19 | 1 | -0/+1 |
| | | | | | | | | This helps a lot with debugging. | ||||
* | | p2p: use package rlp to encode messages | Felix Lange | 2015-03-19 | 8 | -68/+64 |
| | | | | | | | | | | | | | | | | | | | | 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: export ExpectMsg (for eth protocol testing) | Felix Lange | 2015-03-19 | 2 | -32/+32 |
|/ | |||||
* | Merge branch 'frontier/js' into frontier/nodeadmin.js | zelig | 2015-03-16 | 2 | -5/+5 |
|\ | |||||
| * | Moved ethutil => common | obscuren | 2015-03-16 | 2 | -5/+5 |
| | | |||||
* | | p2p: server>discover table Self=Node exported | zelig | 2015-03-15 | 2 | -8/+12 |
|/ | |||||
* | Move MakeName to ethutil | Taylor Gerring | 2015-03-12 | 1 | -9/+1 |
| | |||||
* | eth, p2p: delete p2p.Blacklist | Felix Lange | 2015-03-04 | 1 | -59/+0 |
| | | | | | It is unused and untested right now. We can bring it back later if required. | ||||
* | p2p: reject messages that cannot be written as simple RLPx frames | Felix Lange | 2015-03-04 | 1 | -0/+5 |
| | | | | | Until chunked frames are implemented we cannot send messages with a size overflowing uint24. | ||||
* | p2p: restore read/write timeouts | Felix Lange | 2015-03-04 | 5 | -37/+37 |
| | | | | They got lost in the transition to rlpxFrameRW. | ||||
* | p2p: msg.Payload contains list data | Felix Lange | 2015-03-04 | 7 | -75/+25 |
| | | | | | | | | | 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. | ||||
* | p2p: verify protocol handshake node ID | Felix Lange | 2015-03-04 | 1 | -0/+3 |
| | |||||
* | p2p: make encryption handshake code easier to follow | Felix Lange | 2015-03-04 | 2 | -302/+272 |
| | | | | | | | | | 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/discover: add NodeID.Pubkey | Felix Lange | 2015-03-04 | 2 | -0/+33 |
| | |||||
* | p2p: make RLPx frame MAC 16 bytes as defined in the spec | Felix Lange | 2015-03-04 | 2 | -13/+19 |
| | |||||
* | p2p: delete frameRW | Felix Lange | 2015-03-04 | 2 | -184/+0 |
| | |||||
* | p2p: use RLPx frames for messaging | Felix Lange | 2015-03-04 | 6 | -50/+73 |
| | |||||
* | p2p: encrypted and authenticated RLPx frame I/O | Felix Lange | 2015-03-04 | 4 | -172/+197 |
| | |||||
* | p2p: add basic RLPx frame I/O | Felix Lange | 2015-03-04 | 2 | -0/+252 |
| | |||||
* | p2p: emit JSON connect/disconnect events | Felix Lange | 2015-02-20 | 1 | -0/+13 |
| | |||||
* | p2p: initialize Server.ourHandshake before accepting connections | Felix Lange | 2015-02-20 | 1 | -8/+9 |
| | |||||
* | p2p: enable devp2p ping | Felix Lange | 2015-02-19 | 1 | -11/+26 |
| | | | | This should prevent connection drops. | ||||
* | p2p: disable encryption handshake | Felix Lange | 2015-02-19 | 7 | -313/+273 |
| | | | | | | 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. | ||||
* | Merge pull request #325 from fjl/deps-cleanup | Jeffrey Wilcke | 2015-02-18 | 2 | -4/+4 |
|\ | | | | | Cleanup imports | ||||
| * | p2p/nat: switch to github.com/huin/goupnp | Felix Lange | 2015-02-17 | 1 | -3/+3 |
| | | | | | | | | My temporary fix was merged upstream. | ||||
| * | p2p: fix ecies dependency in tests | Felix Lange | 2015-02-17 | 1 | -1/+1 |
| | | | | | | | | | | We forgot to update this reference when moving ecies into the go-ethereum repo. | ||||
* | | p2p/discover: fix pending replies iteration | Felix Lange | 2015-02-17 | 1 | -1/+2 |
|/ | | | | | | Range expressions capture the length of the slice once before the first iteration. A range expression cannot be used here since the loop modifies the slice variable (including length changes). | ||||
* | Use a mutex write-lock for a write operation | obscuren | 2015-02-15 | 1 | -4/+4 |
| | |||||
* | Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop | obscuren | 2015-02-14 | 1 | -0/+6 |
|\ | |||||
| * | p2p: print Cap as name/version | Felix Lange | 2015-02-14 | 1 | -0/+6 |
| | | |||||
* | | Moved ECIES to repo & added secondary title for webview | obscuren | 2015-02-14 | 1 | -1/+1 |
|/ | | | | | * ECIES moved from obscuren to ethereum * Added html META[name=badge] to reflect menuItem.secondaryTitle | ||||
* | p2p: bump devp2p protcol version to 3 | Felix Lange | 2015-02-13 | 1 | -1/+1 |
| | | | | For compatibility with cpp-ethereum | ||||
* | p2p: handle disconnect before protocol handshake | Felix Lange | 2015-02-13 | 1 | -0/+7 |
| | |||||
* | p2p/discover: fix race in ListenUDP | Felix Lange | 2015-02-13 | 1 | -24/+17 |
| | | | | | udp.Table was assigned after the readLoop started, so packets could arrive and be processed before the Table was there. | ||||
* | p2p: ensure we don't dial ourself | Felix Lange | 2015-02-13 | 1 | -1/+4 |
| | | | | | addPeer doesn't allow self connects, but we can avoid opening connections in the first place. | ||||
* | p2p: add I/O timeout for encrytion handshake | Felix Lange | 2015-02-13 | 1 | -1/+3 |
| | |||||
* | p2p: fix goroutine leak for invalid peers | Felix Lange | 2015-02-13 | 1 | -6/+5 |
| | | | | | The deflect logic called Disconnect on the peer, but the peer never ran and wouldn't process the disconnect request. | ||||
* | p2p: improve read deadlines | Felix Lange | 2015-02-13 | 2 | -15/+27 |
| | | | | | | | | There are now two deadlines, frameReadTimeout and payloadReadTimeout. The frame timeout is longer and allows for connections that are idle. The message timeout is still short and ensures that we don't get stuck in the middle of a message. | ||||
* | p2p/discover: map listening port using configured mechanism | Felix Lange | 2015-02-13 | 3 | -15/+25 |
| | |||||
* | p2p/discover: code review fixes | Felix Lange | 2015-02-13 | 3 | -7/+9 |
| | |||||
* | cmd/ethereum, cmd/mist, eth, p2p: use package p2p/nat | Felix Lange | 2015-02-13 | 4 | -478/+11 |
| | | | | This deletes the old NAT implementation. | ||||
* | p2p/nat: new package for port mapping stuff | Felix Lange | 2015-02-13 | 3 | -0/+499 |
| | | | | | | I have verified that UPnP and NAT-PMP work against an older version of the MiniUPnP daemon running on pfSense. This code is kind of hard to test automatically. | ||||
* | p2p/discover: deflake UDP tests | Felix Lange | 2015-02-09 | 4 | -59/+123 |
| | |||||
* | cmd/ethereum, cmd/mist: add flag for discovery bootstrap nodes | Felix Lange | 2015-02-07 | 2 | -3/+3 |
| | |||||
* | cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions | Felix Lange | 2015-02-07 | 2 | -3/+3 |
| | |||||
* | p2p: fixes for actual connections | Felix Lange | 2015-02-07 | 6 | -29/+38 |
| | | | | The unit test hooks were turned on 'in production'. | ||||
* | p2p/discover: add node URL functions, distinguish TCP/UDP ports | Felix Lange | 2015-02-07 | 8 | -326/+532 |
| | | | | | The discovery RPC protocol does not yet distinguish TCP and UDP ports. But it can't hurt to do so in our internal model. | ||||
* | p2p: integrate p2p/discover | Felix Lange | 2015-02-06 | 15 | -1659/+1056 |
| | | | | | | | | | | | | Overview of changes: - ClientIdentity has been removed, use discover.NodeID - Server now requires a private key to be set (instead of public key) - Server performs the encryption handshake before launching Peer - Dial logic takes peers from discover table - Encryption handshake code has been cleaned up a bit - baseProtocol is gone because we don't exchange peers anymore - Some parts of baseProtocol have moved into Peer instead | ||||
* | p2p/discover: add some helper functions | Felix Lange | 2015-02-06 | 4 | -20/+41 |
| | |||||
* | p2p/discover: new package implementing the Node Discovery Protocol | Felix Lange | 2015-02-06 | 4 | -0/+1428 |
| | |||||
* | key generation abstracted out, for testing with deterministic keys | zelig | 2015-02-06 | 2 | -12/+92 |
| | |||||
* | fix clientidentity test after privkey removed | zelig | 2015-02-06 | 1 | -6/+2 |
| | |||||
* | get rid of Private Key in ClientIdentity | zelig | 2015-02-06 | 1 | -5/+3 |
| | |||||
* | make crypto handshake calls package level, store privateKey on peer + tests ok | zelig | 2015-02-06 | 3 | -87/+52 |
| | |||||
* | apply handshake related improvements from p2p.crypto branch | zelig | 2015-02-06 | 3 | -29/+31 |
| | |||||
* | add temporary forced session token generation | zelig | 2015-02-06 | 2 | -0/+8 |
| | |||||
* | peer-level integration test for crypto handshake | zelig | 2015-02-06 | 3 | -15/+71 |
| | | | | | | | | | - add const length params for handshake messages - add length check to fail early - add debug logs to help interop testing (!ABSOLUTELY SHOULD BE DELETED LATER) - wrap connection read/writes in error check - add cryptoReady channel in peer to signal when secure session setup is finished - wait for cryptoReady or timeout in TestPeersHandshake | ||||
* | chop first byte when cryptoid.PubKeyS is set from identity.Pubkey() since ↵ | zelig | 2015-02-06 | 1 | -1/+11 |
| | | | | this is directly copied in the auth message | ||||
* | add initial peer level test (failing) | zelig | 2015-02-06 | 1 | -1/+52 |
| | |||||
* | add code documentation | zelig | 2015-02-06 | 1 | -15/+47 |
| | |||||
* | changes that fix it all: | zelig | 2015-02-06 | 2 | -57/+146 |
| | | | | | | | | | | | - set proper public key serialisation length in pubLen = 64 - reset all sizes and offsets - rename from DER to S (we are not using DER encoding) - add remoteInitRandomPubKey as return value to respondToHandshake - add ImportPublicKey with error return to read both EC golang.elliptic style 65 byte encoding and 64 byte one - add ExportPublicKey falling back to go-ethereum/crypto.FromECDSAPub() chopping off the first byte - add Import - Export tests - all tests pass | ||||
* | important fix for peer pubkey. when taken from identity, chop first format byte! | zelig | 2015-02-06 | 1 | -1/+1 |
| | |||||
* | add equality check for nonce and remote nonce | zelig | 2015-02-06 | 1 | -0/+6 |
| | |||||
* | add minor comments to the test | zelig | 2015-02-06 | 1 | -0/+4 |
| | |||||
* | first stab at integrating crypto in our p2p | zelig | 2015-02-06 | 3 | -44/+79 |
| | | | | | | | - abstract the entire handshake logic in cryptoId.Run() taking session-relevant parameters - changes in peer to accomodate how the encryption layer would be switched on - modify arguments of handshake components - fixed test getting the wrong pubkey but it till crashes on DH in newSession() | ||||
* | integrate cryptoId into peer and connection lifecycle | zelig | 2015-02-06 | 2 | -3/+33 |
| | |||||
* | completed the test. FAIL now. it crashes at diffie-hellman. ECIES -> ↵ | zelig | 2015-02-06 | 2 | -43/+57 |
| | | | | secp256k1-go panics | ||||
* | handshake test to crypto | zelig | 2015-02-06 | 1 | -1/+1 |
| | |||||
* | handshake test to crypto | zelig | 2015-02-06 | 2 | -2/+54 |
| | |||||
* | fix crash | zelig | 2015-02-06 | 1 | -22/+29 |
| | | | | | | - add session token check and fallback to shared secret in responder call too - use explicit length for the types of new messages - fix typo resp[resLen-1] = tokenFlag | ||||
* | rewrite to comply with latest spec | zelig | 2015-02-06 | 1 | -53/+138 |
| | | | | | | | | - correct sizes for the blocks : sec signature 65, ecies sklen 16, keylength 32 - added allocation to Xor (should be optimized later) - no pubkey reader needed, just do with copy - restructuring now into INITIATE, RESPOND, COMPLETE -> newSession initialises the encryption/authentication layer - crypto identity can be part of client identity, some initialisation when server created | ||||
* | add crypto auth logic to p2p | zelig | 2015-02-06 | 1 | -0/+174 |
| | |||||
* | fix protocol to accomodate privkey | zelig | 2015-02-06 | 2 | -1/+14 |
| | |||||
* | add privkey to clientIdentity + tests | zelig | 2015-02-06 | 2 | -5/+21 |
| | |||||
* | initial hook for crypto handshake (void, off by default) | zelig | 2015-02-06 | 1 | -0/+26 |
| | |||||
* | Moved `obscuren` secp256k1-go | obscuren | 2015-01-22 | 1 | -1/+1 |
| | |||||
* | Moved connection errors to DebugDetail level | obscuren | 2015-01-19 | 1 | -2/+2 |
| | |||||
* | p2p: improve test for peers message | Felix Lange | 2015-01-06 | 1 | -21/+43 |
| | | | | | The test now checks that the number of of addresses is correct and terminates cleanly. | ||||
* | p2p: move peerList back into baseProtocol | Felix Lange | 2015-01-06 | 2 | -23/+23 |
| | | | | It had been moved to Peer, probably for debugging. | ||||
* | eth, p2p: remove EncodeMsg from p2p.MsgWriter | Felix Lange | 2015-01-06 | 5 | -23/+21 |
| | | | | | | | | | | | | ...and make it a top-level function instead. The original idea behind having EncodeMsg in the interface was that implementations might be able to encode RLP data to their underlying writer directly instead of buffering the encoded data. The encoder will buffer anyway, so that doesn't matter anymore. Given the recent problems with EncodeMsg (copy-pasted implementation bug) I'd rather implement once, correctly. | ||||
* | Merge | obscuren | 2015-01-06 | 8 | -54/+144 |
| | |||||
* | Cleaned up some of that util | obscuren | 2015-01-04 | 2 | -2/+25 |
| | |||||
* | p2p: fix call to Server.removePeer (might help with #209) | Felix Lange | 2014-12-16 | 1 | -7/+2 |
| | |||||
* | made mist in a compilable, workable state using the new refactored packages | obscuren | 2014-12-15 | 1 | -0/+1 |
| | |||||
* | Merge pull request #204 from fjl/fix-p2p-disconnect | Jeffrey Wilcke | 2014-12-15 | 7 | -8/+277 |
|\ | | | | | p2p: fix decoding of disconnect reason | ||||
| * | p2p: add test for base protocol disconnect | Felix Lange | 2014-12-15 | 1 | -0/+58 |
| | | |||||
| * | p2p: use an error type for disconnect requests | Felix Lange | 2014-12-15 | 2 | -2/+10 |
| | | | | | | | | Test-tastic. | ||||
| * | p2p: add MsgPipe for protocol testing | Felix Lange | 2014-12-15 | 2 | -0/+140 |
| | | |||||
| * | p2p: improve and test eofSignal | Felix Lange | 2014-12-12 | 2 | -5/+68 |
| | | |||||
| * | p2p: fix decoding of disconnect reason (fixes #200) | Felix Lange | 2014-12-12 | 1 | -2/+2 |
| | | |||||
* | | Fixed tests | obscuren | 2014-12-10 | 1 | -1/+1 |
|/ | |||||
* | p2p: add test for NewPeer | Felix Lange | 2014-11-27 | 1 | -0/+15 |
| | |||||
* | p2p: make Disconnect not hang for peers created with NewPeer | Felix Lange | 2014-11-27 | 1 | -0/+1 |
| | |||||
* | p2p: remove Msg.Value and MsgLoop | Felix Lange | 2014-11-25 | 3 | -49/+19 |
| | |||||
* | p2p: use package rlp for baseProtocol | Felix Lange | 2014-11-25 | 4 | -58/+71 |
| | |||||
* | p2p: use package rlp | Felix Lange | 2014-11-25 | 3 | -67/+31 |
| | |||||
* | p2p: API cleanup and PoC 7 compatibility | Felix Lange | 2014-11-22 | 17 | -1902/+1665 |
| | | | | | Whoa, one more big commit. I didn't manage to untangle the changes while working towards compatibility. | ||||
* | p2p: disable failing Server tests for now | Felix Lange | 2014-11-22 | 1 | -0/+3 |
| | |||||
* | p2p: fix issues found during review | Felix Lange | 2014-11-22 | 4 | -53/+96 |
| | |||||
* | p2p: rework protocol API | Felix Lange | 2014-11-22 | 14 | -1282/+1017 |
| | |||||
* | Implemented new miner w/ ui interface for merged mining. Closes #177 | obscuren | 2014-11-07 | 3 | -3/+4 |
| | | | | | | | | * Miner has been rewritten * Added new miner pane * Added option for local txs * Added option to read from MergeMining contract and list them for merged mining | ||||
* | all: fix rename breakage | Felix Lange | 2014-11-01 | 1 | -2/+2 |
| | |||||
* | initial commit of p2p package | zelig | 2014-10-23 | 19 | -0/+3015 |