Commit Graph

18 Commits

Author SHA1 Message Date
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
d399a932fe peer/queue/sync: remove buffering 2014-12-23 08:32:53 -08:00
Juan Batiz-Benet
f952275bf2 shorter queue test (reloaded) 2014-12-10 21:06:07 -08:00
Juan Batiz-Benet
0f12f4b245 shorter peer queue test 2014-12-10 21:03:31 -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
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
9ca87fbb93 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
f3ae0e8e1b u.Hash - error
the u.Hash error can be safely ignored (panic) because multihash
only fails from the selection of hash function. If the fn + length
are valid, it won't error.

cc @whyrusleeping
2014-10-06 02:26:52 -07:00
Juan Batiz-Benet
2507680d77 ok fixed queue test 2014-09-26 03:26:48 -07:00
Juan Batiz-Benet
943c3df416 increment time for queue test
it's failing when machine slow (travis)
2014-09-26 02:52:41 -07:00
Juan Batiz-Benet
8ed04cfe23 fixed test 2014-09-22 04:06:17 -07:00
Juan Batiz-Benet
98c3afeecf clean up channel use 2014-09-22 04:05:22 -07:00
Juan Batiz-Benet
551c40930e chan queue 2014-09-22 04:05:21 -07:00
Juan Batiz-Benet
ae1f7688aa separate to ensure sync safety 2014-09-22 04:05:21 -07:00
Juan Batiz-Benet
9e2c3fb8fc expose Len on PQ 2014-09-22 04:05:21 -07:00
Juan Batiz-Benet
51eeec1a79 sync safety to pq 2014-09-22 04:05:21 -07:00
Juan Batiz-Benet
a21c1b6b62 PeerQueue (based on XOR distance metric) 2014-09-22 04:05:21 -07:00