aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/server.go
Commit message (Collapse)AuthorAgeFilesLines
* p2p, dex: add debug log (#269)Sonic2019-04-091-0/+1
|
* p2p: report peer counts to datadog (#254)Cliff Lin2019-04-091-0/+2
|
* p2p, dex: rework connection management (#183)Sonic2019-04-091-120/+26
| | | | | | * p2p, dex: rework connection management * dex: refresh our node record periodically * dex: don't send new record event if no new record
* core: refactor validator and fix light node sync (#25)Wei-Ning Huang2019-04-091-1/+1
| | | | | | | | Remove custom Dexon validator by adding a new `ValidateWitnessData` method into the validator interface. This allow us to properly detect know blocks. This also allow other gdex "light" client to sync compaction chain. Also, setup a standalone RPC node for handling RPC reqeusts.
* dex: add self node meta after StartSonic2019-04-091-0/+4
|
* dex: redesign p2p network topologySonic2019-04-091-83/+188
| | | | | | | | | | - Let p2p server support direct connection and group connection. - Introduce node meta table to maintain IP of all nodes in node set, in memory and let nodes in the network can sync this table. - Let peerSet able to manage direct connections to notary set and dkg set. The mechanism to refresh the network topology when configuration round change is not done yet.
* Change import go github.com/dexon-foundation/dexonWei-Ning Huang2019-04-091-12/+12
|
* p2p: implement AddNotaryPeer and RemoveNotaryPeerSonic2019-04-091-2/+64
| | | | | | | | | | AddNotaryPeer adds node to static node set so that server will maintain the connection with the notary node. AddNotaryPeer also sets the notaryConn flag to allow the node to always connect, even if the slot are full. RemoveNotaryPeer removes node from static, then disconnect and unsets the notaryConn flag.
* p2p: use errors.New instead of fmt.Errorf (#18193)needkane2018-12-011-5/+4
|
* eth, p2p: fix comment typos (#18014)Corey Lin2018-11-081-1/+1
|
* p2p: meter peer traffic, emit metered peer events (#17695)Kurkó Mihály2018-10-161-1/+8
| | | | | | | | | This change extends the peer metrics collection: - traces the life-cycle of the peers - meters the peer traffic separately for every peer - creates event feed for the peer events - emits the peer events
* p2p, p2p/discover: add signed ENR generation (#17753)Felix Lange2018-10-121-110/+122
| | | | | | | | | | | | | | | This PR adds enode.LocalNode and integrates it into the p2p subsystem. This new object is the keeper of the local node record. For now, a new version of the record is produced every time the client restarts. We'll make it smarter to avoid that in the future. There are a couple of other changes in this commit: discovery now waits for all of its goroutines at shutdown and the p2p server now closes the node database after discovery has shut down. This fixes a leveldb crash in tests. p2p server startup is faster because it doesn't need to wait for the external IP query anymore.
* all: new p2p node representation (#17643)Felix Lange2018-09-251-81/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package p2p/enode provides a generalized representation of p2p nodes which can contain arbitrary information in key/value pairs. It is also the new home for the node database. The "v4" identity scheme is also moved here from p2p/enr to remove the dependency on Ethereum crypto from that package. Record signature handling is changed significantly. The identity scheme registry is removed and acceptable schemes must be passed to any method that needs identity. This means records must now be validated explicitly after decoding. The enode API is designed to make signature handling easy and safe: most APIs around the codebase work with enode.Node, which is a wrapper around a valid record. Going from enr.Record to enode.Node requires a valid signature. * p2p/discover: port to p2p/enode This ports the discovery code to the new node representation in p2p/enode. The wire protocol is unchanged, this can be considered a refactoring change. The Kademlia table can now deal with nodes using an arbitrary identity scheme. This requires a few incompatible API changes: - Table.Lookup is not available anymore. It used to take a public key as argument because v4 protocol requires one. Its replacement is LookupRandom. - Table.Resolve takes *enode.Node instead of NodeID. This is also for v4 protocol compatibility because nodes cannot be looked up by ID alone. - Types Node and NodeID are gone. Further commits in the series will be fixes all over the the codebase to deal with those removals. * p2p: port to p2p/enode and discovery changes This adapts package p2p to the changes in p2p/discover. All uses of discover.Node and discover.NodeID are replaced by their equivalents from p2p/enode. New API is added to retrieve the enode.Node instance of a peer. The behavior of Server.Self with discovery disabled is improved. It now tries much harder to report a working IP address, falling back to 127.0.0.1 if no suitable address can be determined through other means. These changes were needed for tests of other packages later in the series. * p2p/simulations, p2p/testing: port to p2p/enode No surprises here, mostly replacements of discover.Node, discover.NodeID with their new equivalents. The 'interesting' API changes are: - testing.ProtocolSession tracks complete nodes, not just their IDs. - adapters.NodeConfig has a new method to create a complete node. These changes were needed to make swarm tests work. Note that the NodeID change makes the code incompatible with old simulation snapshots. * whisper/whisperv5, whisper/whisperv6: port to p2p/enode This port was easy because whisper uses []byte for node IDs and URL strings in the API. * eth: port to p2p/enode Again, easy to port because eth uses strings for node IDs and doesn't care about node information in any way. * les: port to p2p/enode Apart from replacing discover.NodeID with enode.ID, most changes are in the server pool code. It now deals with complete nodes instead of (Pubkey, IP, Port) triples. The database format is unchanged for now, but we should probably change it to use the node database later. * node: port to p2p/enode This change simply replaces discover.Node and discover.NodeID with their new equivalents. * swarm/network: port to p2p/enode Swarm has its own node address representation, BzzAddr, containing both an overlay address (the hash of a secp256k1 public key) and an underlay address (enode:// URL). There are no changes to the BzzAddr format in this commit, but certain operations such as creating a BzzAddr from a node ID are now impossible because node IDs aren't public keys anymore. Most swarm-related changes in the series remove uses of NewAddrFromNodeID, replacing it with NewAddr which takes a complete node as argument. ToOverlayAddr is removed because we can just use the node ID directly.
* all: remove the duplicate 'the' in annotations (#17509)Wenbiao Zheng2018-08-271-1/+1
|
* p2p: use safe atomic operations when changing connFlags (#17325)Felföldi Zsolt2018-08-061-6/+11
|
* Merge pull request #16333 from shazow/addremovetrustedpeerFelföldi Zsolt2018-08-061-5/+57
|\ | | | | rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.
| * p2p: Wrap conn.flags ops with atomic.Load/StoreAndrey Petrov2018-06-221-4/+16
| |
| * rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.Andrey Petrov2018-06-221-3/+43
| | | | | | | | | | | | | | | | These RPC calls are analogous to Parity's parity_addReservedPeer and parity_removeReservedPeer. They are useful for adjusting the trusted peer set during runtime, without requiring restarting the server.
* | p2p: fix rare deadlock in Stop (#17260)Janoš Guljaš2018-07-301-1/+2
|/
* all: library changes for swarm-network-rewrite (#16898)Elad2018-06-141-2/+2
| | | | | | | | | | | | This commit adds all changes needed for the merge of swarm-network-rewrite. The changes: - build: increase linter timeout - contracts/ens: export ensNode - log: add Output method and enable fractional seconds in format - metrics: relax test timeout - p2p: reduced some log levels, updates to simulation packages - rpc: increased maxClientSubscriptionBuffer to 20000
* p2p: remove unused code (#16158)Ivan Daniluk2018-02-231-3/+1
| | | | | | * p2p: remove unused code * p2p: remove unused imports
* rpc: dns rebind protection (#15962)Martin Holst Swende2018-02-121-1/+1
| | | | | | | | | | | | | | | | * cmd,node,rpc: add allowedHosts to prevent dns rebinding attacks * p2p,node: Fix bug with dumpconfig introduced in r54aeb8e4c0bb9f0e7a6c67258af67df3b266af3d * rpc: add wildcard support for rpcallowedhosts + go fmt * cmd/geth, cmd/utils, node, rpc: ignore direct ip(v4/6) addresses in rpc virtual hostnames check * http, rpc, utils: make vhosts into map, address review concerns * node: change log messages to use geth standard (not sprintf) * rpc: fix spelling
* p2p, p2p/discover: misc connectivity improvements (#16069)Felix Lange2018-02-121-27/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * p2p: add DialRatio for configuration of inbound vs. dialed connections * p2p: add connection flags to PeerInfo * p2p/netutil: add SameNet, DistinctNetSet * p2p/discover: improve revalidation and seeding This changes node revalidation to be periodic instead of on-demand. This should prevent issues where dead nodes get stuck in closer buckets because no other node will ever come along to replace them. Every 5 seconds (on average), the last node in a random bucket is checked and moved to the front of the bucket if it is still responding. If revalidation fails, the last node is replaced by an entry of the 'replacement list' containing recently-seen nodes. Most close buckets are removed because it's very unlikely we'll ever encounter a node that would fall into any of those buckets. Table seeding is also improved: we now require a few minutes of table membership before considering a node as a potential seed node. This should make it less likely to store short-lived nodes as potential seeds. * p2p/discover: fix nits in UDP transport We would skip sending neighbors replies if there were fewer than maxNeighbors results and CheckRelayIP returned an error for the last one. While here, also resolve a TODO about pong reply tokens.
* p2p, p2p/discover, p2p/discv5: implement UDP port sharing (#15200)Felföldi Zsolt2018-01-221-5/+70
| | | | | | | | | | | | | | | This commit affects p2p/discv5 "topic discovery" by running it on the same UDP port where the old discovery works. This is realized by giving an "unhandled" packet channel to the old v4 discovery packet handler where all invalid packets are sent. These packets are then processed by v5. v5 packets are always invalid when interpreted by v4 and vice versa. This is ensured by adding one to the first byte of the packet hash in v5 packets. DiscoveryV5Bootnodes is also changed to point to new bootnodes that are implementing the changed packet format with modified hash. Existing and new v5 bootnodes are both running on different ports ATM.
* p2p/simulations: various stability fixes (#15198)Lewis Marshall2017-12-011-33/+51
| | | | | | | | | | | | | | | | | | | | | | | | p2p/simulations: introduce dialBan - Refactor simulations/network connection getters to support avoiding simultaneous dials between two peers If two peers dial simultaneously, the connection will be dropped to help avoid that, we essentially lock the connection object with a timestamp which serves as a ban on dialing for a period of time (dialBanTimeout). - The connection getter InitConn can be wrapped and passed to the nodes via adapters.NodeConfig#Reachable field and then used by the respective services when they initiate connections. This massively stablise the emerging connectivity when running with hundreds of nodes bootstrapping a network. p2p: add Inbound public method to p2p.Peer p2p/simulations: Add server id to logs to support debugging in-memory network simulations when multiple peers are logging. p2p: SetupConn now returns error. The dialer checks the error and only calls resolve if the actual TCP dial fails.
* p2p: add network simulation framework (#14982)Lewis Marshall2017-09-251-8/+48
| | | | | | This commit introduces a network simulation framework which can be used to run simulated networks of devp2p nodes. The intention is to use this for testing protocols, performing benchmarks and visualising emergent network behaviour.
* cmd/geth: add --config file flag (#13875)Felix Lange2017-04-121-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * p2p/discover, p2p/discv5: add marshaling methods to Node * p2p/netutil: make Netlist decodable from TOML * common/math: encode nil HexOrDecimal256 as 0x0 * cmd/geth: add --config file flag * cmd/geth: add missing license header * eth: prettify Config again, fix tests * eth: use gasprice.Config instead of duplicating its fields * eth/gasprice: hide nil default from dumpconfig output * cmd/geth: hide genesis block in dumpconfig output * node: make tests compile * console: fix tests * cmd/geth: make TOML keys look exactly like Go struct fields * p2p: use discovery by default This makes the zero Config slightly more useful. It also fixes package node tests because Node detects reuse of the datadir through the NodeDatabase. * cmd/geth: make ethstats URL settable through config file * cmd/faucet: fix configuration * cmd/geth: dedup attach tests * eth: add comment for DefaultConfig * eth: pass downloader.SyncMode in Config This removes the FastSync, LightSync flags in favour of a more general SyncMode flag. * cmd/utils: remove jitvm flags * cmd/utils: make mutually exclusive flag error prettier It now reads: Fatal: flags --dev, --testnet can't be used at the same time * p2p: fix typo * node: add DefaultConfig, use it for geth * mobile: add missing NoDiscovery option * cmd/utils: drop MakeNode This exposed a couple of places that needed to be updated to use node.DefaultConfig. * node: fix typo * eth: make fast sync the default mode * cmd/utils: remove IPCApiFlag (unused) * node: remove default IPC path Set it in the frontends instead. * cmd/geth: add --syncmode * cmd/utils: make --ipcdisable and --ipcpath mutually exclusive * cmd/utils: don't enable WS, HTTP when setting addr * cmd/utils: fix --identity
* p2p: if no nodes are connected, attempt dialing bootnodes (#13874)Péter Szilágyi2017-04-111-1/+1
|
* p2p, p2p/discover, p2p/nat: rework logging using context keysFelix Lange2017-02-281-50/+65
|
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-231-28/+27
|
* logger, pow/dagger, pow/ezp: delete dead codeFelix Lange2017-01-071-12/+0
|
* p2p, p2p/discover, p2p/discv5: add IP network restriction featureFelix Lange2016-11-231-4/+21
| | | | | | The p2p packages can now be configured to restrict all communication to a certain subset of IP networks. This feature is meant to be used for private networks.
* cmd, mobile, node, p2p: surface the discovery V5 bootnodesPéter Szilágyi2016-11-151-5/+13
|
* mobile: initial wrappers for mobile supportPéter Szilágyi2016-11-141-1/+1
|
* p2p/discv5: added new topic discovery packageZsolt Felfoldi2016-11-091-0/+20
|
* node, p2p, internal: Add ability to remove peers via admin interfaceFirescar962016-07-151-0/+20
|
* node, p2p: move network config out of ServerFelix Lange2016-05-181-6/+8
| | | | This silences a go vet message about copying p2p.Server in package node.
* p2p: improve readability of dial task scheduling codeFelix Lange2016-05-031-29/+28
|
* p2p, p2p/discover: track bootstrap state in p2p/discoverFelix Lange2015-12-181-0/+3
| | | | | | This change simplifies the dial scheduling logic because it no longer needs to track whether the discovery table has been bootstrapped.
* p2p: always allow dynamic dials if network not disabledPéter Szilágyi2015-12-031-1/+1
|
* eth, p2p, rpc/api: polish protocol info gatheringPéter Szilágyi2015-10-281-0/+63
|
* Merge pull request #1694 from obscuren/hide-fdtrackJeffrey Wilcke2015-08-201-2/+1
|\ | | | | fdtrack: hide message
| * Revert "fdtrack: temporary hack for tracking file descriptor usage"Jeffrey Wilcke2015-08-201-2/+1
| | | | | | | | This reverts commit 5c949d3b3ba81ea0563575b19a7b148aeac4bf61.
* | p2p: continue listening after temporary errorsFelix Lange2015-08-191-6/+25
|/
* fdtrack: temporary hack for tracking file descriptor usageFelix Lange2015-08-041-1/+2
| | | | | Package fdtrack logs statistics about open file descriptors. This should help identify the source of #1549.
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: add some godoc synopsis commentsFelix Lange2015-07-071-0/+1
|
* all: update license informationFelix Lange2015-07-071-0/+16
|
* p2p: instrument P2P networking layerPéter Szilágyi2015-06-241-2/+4
|
* p2p: throttle all discovery lookupsFelix Lange2015-06-221-0/+1
| | | | | | | | | | | | | | Lookup calls would spin out of control when network connectivity was lost. The throttling that was in place only took effect when the table returned zero results, which doesn't happen very often. The new throttling should not have a negative impact when the host is online. Lookups against the network take some time and dials for all results must complete or hit the cache before a new one is started. This usually takes longer than four seconds, leaving online lookups unaffected. Fixes #1296
* p2p: bump global write timeout to 20sFelix Lange2015-06-091-1/+1
| | | | | The previous value of 5 seconds causes timeouts for legitimate messages if large messages are sent.
* p2p: fix Self() panic if listening is disabledPéter Szilágyi2015-05-271-0/+9
|
* cmd/geth, cmd/utils, eth, p2p: pass and honor a no discovery flagPéter Szilágyi2015-05-271-8/+29
|
* eth, p2p: start the p2p server even if maxpeers == 0Péter Szilágyi2015-05-261-3/+0
|
* p2p: decrease frameReadTimeout to 30sFelix Lange2015-05-251-4/+5
| | | | | This detects hanging connections sooner. We send a ping every 15s and other implementation have similar limits.
* p2p: new dialer, peer management without locksFelix Lange2015-05-251-305/+361
| | | | | | | | | | | | | | | | | | 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: delete Server.BroadcastFelix Lange2015-05-251-41/+0
|
* p2p: bump maxAcceptConns and defaultDialTimoutFelix Lange2015-05-141-2/+2
| | | | | On the test network, we've seen that it becomes harder to connect if the queues are so short.
* p2p: drop connections with no matching protocolsFelix Lange2015-05-081-4/+9
|
* p2p: use maxDialingConns instead of maxAcceptConns as dial limitFelix Lange2015-05-081-1/+1
|
* p2p: fix disconnect at capacityFelix Lange2015-05-081-12/+17
| | | | | | | 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.
* cmd, eth, p2p: introduce pending peer cli arg, add testsPéter Szilágyi2015-05-071-7/+18
|
* p2p: reduce the concurrent handshakes to 10/10 in/outPéter Szilágyi2015-05-071-2/+2
|
* p2p: fix dial throttling race conditionPéter Szilágyi2015-05-071-1/+1
|
* p2p: fix a dialing race in the throttlerPéter Szilágyi2015-05-071-1/+1
|
* p2p: limit the outbound dialing tooPéter Szilágyi2015-05-071-1/+11
|
* Merge pull request #866 from fjl/p2p-last-minuteJeffrey Wilcke2015-05-071-1/+1
|\ | | | | Last minute p2p fixes
| * p2p: stop dialing at half the maximum peer countFelix Lange2015-05-071-1/+1
| |
* | fixed merge issueobscuren2015-05-071-18/+101
|\ \ | |/ |/|
| * eth, p2p: add trusted node list beside static listPéter Szilágyi2015-05-041-11/+21
| |
| * p2p: add static node dialing testPéter Szilágyi2015-05-041-13/+20
| |
| * p2p: correct a leftover trusted -> staticPéter Szilágyi2015-05-011-4/+4
| |
| * eth, p2p: rename trusted nodes to static, drop inbound extra slotsPéter Szilágyi2015-05-011-32/+32
| |
| * cmd, eth, p2p: fix review issues enumerated by FelixPéter Szilágyi2015-04-301-20/+11
| |
| * p2p: add trust check to handshake, test privileged connectivityPéter Szilágyi2015-04-301-3/+14
| | | | | | | | | | Conflicts: p2p/server_test.go
| * p2p: reduce the severity of a debug logPéter Szilágyi2015-04-301-1/+1
| |
| * cmd/geth, cmd/mist, cmd/utils, eth, p2p: support trusted peersPéter Szilágyi2015-04-301-13/+77
| |
* | p2p/discover: new endpoint formatFelix Lange2015-04-301-1/+1
|/ | | | | | 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.
* cmd/bootnode, eth, p2p, p2p/discover: use a fancier db designPéter Szilágyi2015-04-241-4/+4
|
* cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth.Péter Szilágyi2015-04-241-3/+3
|
* cmd, eth, p2p, p2p/discover: init and clean up the seed cachePéter Szilágyi2015-04-241-1/+5
|
* p2p: return zero node from Self if the server is not runningFelix Lange2015-04-221-1/+6
| | | | This helps with fixing the tests for cmd/geth to run without networking.
* p2p: fix the dial timerFelix Lange2015-04-171-3/+8
| | | | | The dial timer was not reset properly when the peer count reached MaxPeers.
* p2p: added limiter function to limit package broadcastingobscuren2015-04-141-0/+13
|
* p2p: fix unsynchronized map access during Server shutdownFelix Lange2015-04-131-0/+2
| | | | removePeer can be called even after listenLoop and dialLoop have returned.
* p2p: limit number of lingering inbound pre-handshake connectionsFelix Lange2015-04-101-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 checksFelix Lange2015-04-101-10/+12
|
* p2p: improve disconnect signaling at handshake timeFelix Lange2015-04-101-6/+10
| | | | | | | 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: properly decrement peer wait group counter for setup errorsFelix Lange2015-04-101-0/+11
|
* p2p: improve peer selection logicFelix Lange2015-04-101-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.
* Updated loggingobscuren2015-04-071-12/+12
|
* p2p: use package rlp to encode messagesFelix Lange2015-03-191-3/+8
| | | | | | | | | | 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.
* Merge branch 'frontier/js' into frontier/nodeadmin.jszelig2015-03-161-3/+3
|\
| * Moved ethutil => commonobscuren2015-03-161-3/+3
| |
* | p2p: server>discover table Self=Node exportedzelig2015-03-151-5/+9
|/
* Move MakeName to ethutilTaylor Gerring2015-03-121-9/+1
|
* eth, p2p: delete p2p.BlacklistFelix Lange2015-03-041-59/+0
| | | | | It is unused and untested right now. We can bring it back later if required.
* p2p: restore read/write timeoutsFelix Lange2015-03-041-3/+15
| | | | They got lost in the transition to rlpxFrameRW.
* p2p: msg.Payload contains list dataFelix Lange2015-03-041-1/+2
| | | | | | | | | 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: use RLPx frames for messagingFelix Lange2015-03-041-3/+4
|
* p2p: emit JSON connect/disconnect eventsFelix Lange2015-02-201-0/+13
|
* p2p: initialize Server.ourHandshake before accepting connectionsFelix Lange2015-02-201-8/+9
|
* p2p: disable encryption handshakeFelix Lange2015-02-191-16/+22
| | | | | | 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.
* Use a mutex write-lock for a write operationobscuren2015-02-151-4/+4
|
* p2p: ensure we don't dial ourselfFelix Lange2015-02-131-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 handshakeFelix Lange2015-02-131-1/+3
|
* p2p: fix goroutine leak for invalid peersFelix Lange2015-02-131-6/+5
| | | | | The deflect logic called Disconnect on the peer, but the peer never ran and wouldn't process the disconnect request.
* p2p/discover: map listening port using configured mechanismFelix Lange2015-02-131-2/+1
|
* cmd/ethereum, cmd/mist, eth, p2p: use package p2p/natFelix Lange2015-02-131-59/+11
| | | | This deletes the old NAT implementation.
* cmd/ethereum, cmd/mist: add flag for discovery bootstrap nodesFelix Lange2015-02-071-1/+1
|
* cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestionsFelix Lange2015-02-071-2/+2
|
* p2p: fixes for actual connectionsFelix Lange2015-02-071-1/+3
| | | | The unit test hooks were turned on 'in production'.
* p2p/discover: add node URL functions, distinguish TCP/UDP portsFelix Lange2015-02-071-3/+4
| | | | | 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/discoverFelix Lange2015-02-061-159/+184
| | | | | | | | | | | | 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
* Moved connection errors to DebugDetail levelobscuren2015-01-191-2/+2
|
* Mergeobscuren2015-01-061-1/+5
|
* p2p: fix call to Server.removePeer (might help with #209)Felix Lange2014-12-161-7/+2
|
* made mist in a compilable, workable state using the new refactored packagesobscuren2014-12-151-0/+1
|
* p2p: API cleanup and PoC 7 compatibilityFelix Lange2014-11-221-367/+346
| | | | | Whoa, one more big commit. I didn't manage to untangle the changes while working towards compatibility.
* p2p: rework protocol APIFelix Lange2014-11-221-73/+77
|
* all: fix rename breakageFelix Lange2014-11-011-2/+2
|
* initial commit of p2p packagezelig2014-10-231-0/+484