Commit Graph

88 Commits

Author SHA1 Message Date
Juan Batiz-Benet
8acfcebd67 use yamux as go-peerstream transport
go-peerstream update to use github.com/hashicorp/yamux
2015-01-01 23:24:09 -08:00
Juan Batiz-Benet
6ad158dd14 swarm test: reporting errors fix 2015-01-01 07:05:39 -08:00
Juan Batiz-Benet
a2abf108a0 peerstream update
peerstream was updated to use pluggable transports, including
muxado. The interface was also simplified slightly.
2015-01-01 07:05:39 -08:00
Brian Tiger Chow
a85aa9b5da refactor: rename testutil func 2014-12-24 09:31:17 -05:00
Juan Batiz-Benet
fd2875f2ed fixing race in swarm 2014-12-23 17:59:24 -08:00
Juan Batiz-Benet
b61b281eae net/conns better printing of connections 2014-12-23 08:53:28 -08:00
Juan Batiz-Benet
c84a714b16 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	peer: added a PeerInfo struct
  PeerInfo is a small struct used to pass around a peer with
 	a set of addresses and keys. This is not meant to be a
 	complete view of the system, but rather to model updates to
 	the peerstore. It is used by things like the routing system.
-	updated peer/queue + peerset
-	latency metrics
-	testutil: use crand for PeerID gen
 	RandPeerID generates random "valid" peer IDs. it does not
 	NEED to generate keys because it is as if we lost the key
 	right away. fine to read some randomness and hash it. to
 	generate proper keys and an ID, use:
 	  sk, pk, _ := testutil.RandKeyPair()
 	  id, _ := peer.IDFromPublicKey(pk)
 	Also added RandPeerIDFatal helper
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
Juan Batiz-Benet
2ae9b27859 moved net/swarm2 -> swarm 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
c63ffdd0ae removed old network 2014-12-16 05:10:46 -08:00
Juan Batiz-Benet
d94593a955 new swarm with io and router 2014-12-16 05:10:44 -08:00
Juan Batiz-Benet
5341379f9d net/conn: io, not channels
This commit changes the connections to use io.ReadWriters
instead of channels (+ async workers). This is a pretty
big change -- away from csp -- in the name of performance
(and predictable flow control).

It also uses the brand new secio, which is spipe's successor.
2014-12-16 05:10:44 -08:00
Juan Batiz-Benet
f15ab8eec3 net: add LocalPeer funcs 2014-12-08 20:52:45 -08:00
Brian Tiger Chow
5313c1ae22 fix(swarm) Dial panic
+/- if len(addresses) is 0, connSetup will be called with nil value for c.
+/- avoid variable reassignment

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
c67286774c silence verbose output
for higher SnR at IPFS_LOGGING=info

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
74eb03231d fix(core, peer) helpers to testutil, err handling
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 14:32:52 -08:00
Brian Tiger Chow
d77c4bb5e0 refactor(peer): create peer through peerstore
for safety!

use mockpeer.WithID methods to create peers in tests

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Brian Tiger Chow
73a89e161d refactor(peerstore) s/Get/FindOrCreate
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Jeromy
ed4509923c tracking down a bug dhthell found, added asserts and better logging. 2014-12-05 20:53:26 +00:00
Brian Tiger Chow
0fc95d5add log(swarm, netmessage) Event: connSetup(begin|success)
+ netmessage is now loggable

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:40 -08:00
Juan Batiz-Benet
f99117bcd2 swarm: try all peer's addresses
For simplicity this is sequential. This will be bad latency given
RTTs for all the handshakes, etc. Later on can make async or
at least open based on some priority of the channel.
2014-11-20 09:14:49 -08:00
Juan Batiz-Benet
c7fd1d9ddb swarm: refactored multiconn creation 2014-11-20 09:14:49 -08:00
Juan Batiz-Benet
fc6bab7b73 net/conn: moved zero addr error 2014-11-20 01:27:18 -08:00
Juan Batiz-Benet
43452fdeb7 updated multiaddr + multiaddr-net
I broke out multiaddr/net to its own package so
that multiaddr parsing could remain lean. multiaddr-net
will vendor special implementations of protocols (like utp)
2014-11-20 00:58:48 -08:00
Brian Tiger Chow
6fec76d93e fix(imports) misc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
25c98e8e61 refactor(eventlog) elog -> eventlog
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
eb46fbed82 perform some swarm logging
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
ed4a8eb782 chore(tests) add Short() -> SkipNow() to slowest tests
vanilla:
    21.57 real        45.14 user         8.51 sys

short:
    14.40 real        31.13 user         5.56 sys

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-15 02:10:53 -08:00
Juan Batiz-Benet
1bde67ddf1 bugfix: swarm resolveUnspecAddr idiocy 2014-11-09 19:45:28 -08:00
Jeromy
be5d01b6a6 more doc comments 2014-11-08 22:44:37 -08:00
Jeromy
36a4ee7087 prevent NAT check if given nil multiaddr 2014-11-08 12:24:17 -08:00
Juan Batiz-Benet
d26fd58182 ctx closer races #270 2014-11-05 09:26:17 -08:00
Juan Batiz-Benet
4989dcafed swarm + handshake: better observed addr check
The check needed knowledge of the _listen_ addresses,
not just the interface addresses. Also, the handshake now
sends out all the addresses we accumulate about ourselves.
(this may be bad in the long run, but useful now to test)
2014-11-05 04:01:38 -08:00
Juan Batiz-Benet
0135e3ebbe swarm + net: add explicit listen addresses 2014-11-05 04:00:49 -08:00
Jeromy
05817373d0 Clear up naming around zero address 2014-11-03 20:42:40 +00:00
Jeromy
402fdd2db9 changes from PR 2014-11-03 01:45:45 +00:00
Brian Tiger Chow
cea398b8a7 fix(all) log.Debug -> log.Debugf 2014-10-30 06:35:29 -07:00
Jeromy
d92db12460 lots of logging 2014-10-26 00:45:40 +00:00
Jeromy
ab7491f809 logging, logging, and some minor logging 2014-10-25 14:50:22 -07:00
Juan Batiz-Benet
184c25430b go-vet friendly codebase
- distinguish log.Error and log.Errorf functions
- Initialize structs with field names
- A bit of unreachable code (defers)
2014-10-25 03:46:39 -07:00
Juan Batiz-Benet
701035d5b0 handshake3 (addrs) 2014-10-22 05:25:31 -07:00
Juan Batiz-Benet
ac62d13e42 peerstore Put -> Add
Changed lots of peer use, and changed the peerstore to ensure
there is only ever one peer in use.

Fixed #174
2014-10-20 06:37:12 -07:00
Juan Batiz-Benet
9ca87fbb93 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
3d2ba37445 moved ctxcloser to own pkg 2014-10-19 06:38:13 -07:00
Juan Batiz-Benet
d17292a4c2 differentiate ports cause timing. 2014-10-19 06:29:18 -07:00
Juan Batiz-Benet
aa70bbaf15 evil deadlock that wasn't.
important to always reread your code.
2014-10-19 06:21:08 -07:00
Juan Batiz-Benet
29ab6dec60 added msg counters to logs 2014-10-19 05:49:07 -07:00
Juan Batiz-Benet
63d6ee6daa multiconn in swarm 2014-10-19 05:05:28 -07:00
Juan Batiz-Benet
4783332b11 fixed tests 2014-10-19 02:05:29 -07:00
Juan Batiz-Benet
f8d70f344b simultaneous open should work for now
It's a patch, really. it's not the full multiconn fix.
2014-10-18 20:01:27 -07:00
Juan Batiz-Benet
f2e428d41b moved versionhandshake to conn 2014-10-18 04:52:45 -07:00