Commit Graph

17 Commits

Author SHA1 Message Date
Jeromy
07b064010e rewrite of provides to better select peers to send RPCs to
refactor test peer creation to be deterministic and reliable

a bit of cleanup trying to figure out TestGetFailure

add test to verify deterministic peer creation

switch put RPC over to use getClosestPeers

rm 0xDEADC0DE

fix queries not searching peer if its not actually closer
2015-01-02 07:42:07 +00:00
Brian Tiger Chow
0587342591 doc: specify iteration order randomization 2014-12-28 06:51:33 -05:00
Juan Batiz-Benet
a5018fcc0b net/mock: interface addresses 2014-12-23 09:23:32 -08:00
Juan Batiz-Benet
497297b243 net/mocknet: fixed listenaddrs (misrepresenting)
some dht tests signaled "sending peer empty addresses"
which would then cause a failure. this was a misrepresentation
on the part of mocknet. it has been corrected.
2014-12-23 08:42:12 -08:00
Juan Batiz-Benet
4fe1dd9b62 net: have an explicit IdentifyConn on dial
- Make sure we call IdentifyConn on dialed out conns
- we wait until the identify is **done** before return
- on listening case, we can also wait.
- tests now make sure dial does wait.
- tests now make sure we can wait on listening case.
2014-12-23 08:40:52 -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
4da261001f mocknet printer for printing 2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
b573d66208 mocknet: internals test
Found bugs with it :)
2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
f354fa849e mocknet: FullMesh connects to self too.
@maybebtc thoughts on this? dialing self should be
**possible**, so we should in general test that we do
consider that case, but not sure if this is good to expose
to clients. thoughts?

Btw, on why dialing self should be possible, we may create
little protocols which we may have a node connect to self,
say across its interfaces to test connectivity, etc...
think of it like:

> server localhost:1234 &
> curl localhost:1234
2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
b0a36aabcb mocknet: bugfix on opening conns + printer 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
f1fc09ccee mocknet: printing internal mocknet state 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
5d019ad300 mocknet add test 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
de6eef9178 mv net/mock2 -> net/mock 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
58510640fa rm old mock 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
bc2d35fd4d Lots of fixes. DHT tests pass 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
7fdafaf1e5 stress test 2014-12-16 14:47:30 -08:00
Juan Batiz-Benet
fd3cd399e5 mock network 2014-12-16 14:47:29 -08:00