Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | 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 |