95 Commits

Author SHA1 Message Date
Juan Batiz-Benet
dacbe3cf89 AddrManager: use addr manager with smarter TTLs
This addr manager should seriously help with the addrsplosion
problem.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
243c85a4e4 dropped down log.Errors 2015-01-26 19:13:44 -08:00
Juan Batiz-Benet
7d1b38bc68 dht: TestConnectCollision skip in Travis
+ longer timeout
2015-01-24 10:34:28 -08:00
Juan Batiz-Benet
e7f96c8b39 disable dht TestPeriodicBootstrap on CI 2015-01-24 10:30:15 -08:00
Juan Batiz-Benet
2ab1cc5644 reprovide: wait a minute before reproviding
Many times, a node will start up only to shut down immediately.
In these cases, reproviding is costly to both the node, and the
rest of the network. Also note: the probability of a node being
up another minute increases with uptime.

TODO: maybe this should be 5 * time.Minute
2015-01-23 05:25:32 -08:00
Juan Batiz-Benet
c5b1489146 core/bootstrap: CR comments 2015-01-23 02:08:30 -08:00
Juan Batiz-Benet
81867969d2 routing/dht: periodic bootstrapping #572 2015-01-23 02:08:28 -08:00
Juan Batiz-Benet
2c442e8b0b routing: record validation into record/
This commit moves the record validation/verification
from dht/ into the new record/ packaage. Validator object
-- which is merely a map of ValidatorFuncs -- with a
VerifyRecord

cc @whyrusleeping
2015-01-19 08:10:37 +00:00
Jeromy
afcd61197a add peer info after FindPeer RPC
fix ping test
2015-01-10 07:27:49 +00:00
Juan Batiz-Benet
cadecd7f5c dht/bootstrap/test: longer timeout, less bias 2015-01-05 07:19:07 -08:00
Juan Batiz-Benet
66e59acb1d bootstrap: not error to not have enough bootstrap peers
use dht bootstrap. there is an edge case where the dht
is tiny (1?) and we have 0 bootstrap peers. we should
probably _inform_ the user, but this may be more a
webui or command thing.
2015-01-05 07:13:51 -08:00
Juan Batiz-Benet
858cde0d00 dht test skips 2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
719cd7c51c swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
6bc26e01f3 net -> p2p/net
The net package is the next to move. It will be massaged
a bit still to fix the Network / "NetworkBackend" conflict.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
2b086634b2 introducing p2p pkg
I think it's time to move a lot of the peer-to-peer networking
but-not-ipfs-specific things into its own package: p2p.
This could in the future be split off into its own library.
The first thing to go is the peer.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
d0f3493671 ipfsnet -> swarmnet
swarmnet is a better name for the package, because
it's just a Network implemented with a Swarm.
(ipfsnet will be something slightly different).
2015-01-02 08:46:44 -08:00
Juan Batiz-Benet
25481a5f2f net: move Network implementation to own pkg
I needed the network implementation in its own
package, because I'll be writing several services that
will plug into _it_ that shouldn't be part of the core net
package. and then there were dependency conflicts. yay.
mux + identify are good examples of what i mean.
2015-01-02 08:46:43 -08:00
Jeromy
cf507327a4 clean up test setup interface 2015-01-02 08:33:42 +00:00
Juan Batiz-Benet
476ea4271d dht: fix TestLayeredGet
The test was occasionally passing because:
- it called `putLocal(key, val)`
- GetValue calls `getLocal(key)` optimistically.

cc @whyrusleeping
2015-01-02 07:42:08 +00:00
Jeromy
0547622e00 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
Juan Batiz-Benet
4afa4ad348 dht/test skip bootstrap test when short 2014-12-24 05:39:48 -08:00
Juan Batiz-Benet
00b9db458c dht/test: providers test id compare 2014-12-24 04:23:15 -08:00
Juan Batiz-Benet
3edab37033 dht: cleaned up dht_test.
TestProversMany still fails
2014-12-24 03:48:02 -08:00
Juan Batiz-Benet
d562a9bdee dht/dht_test: bootstrap synchronously. fares better. 2014-12-24 03:46:45 -08:00
Juan Batiz-Benet
e9b5f37b8b dht_test: better bootstrapping logging 2014-12-24 03:41:13 -08:00
Juan Batiz-Benet
2b40651f29 dht bootstrap test: rounds. do nothing
odd behavior: only one dht (the last one) is seeing
changes to its routing table.
2014-12-24 03:24:52 -08:00
Juan Batiz-Benet
b3a6834b6b respect don contexteone 2014-12-24 03:24:28 -08:00
Juan Batiz-Benet
e5502938c2 bootstrap test 2014-12-24 02:20:11 -08:00
Juan Batiz-Benet
f9b7a65024 dht_test large providers test 2014-12-24 01:49:55 -08:00
Juan Batiz-Benet
3b37c43171 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
cc3c277479 Lots of fixes. DHT tests pass 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
fac6fe1e73 Integrated new network into ipfs 2014-12-16 14:47:29 -08:00
Juan Batiz-Benet
a718944be1 dht: FindPeersConnectedToPeer 2014-12-08 20:52:46 -08:00
Juan Batiz-Benet
58f4c4c16d dht tests: dont introduce nil multiaddr
this is the type of assumption we shouldn't violate.
2014-12-08 20:52:45 -08:00
Brian Tiger Chow
2c1700b45d refactor(dht) remove extraneous return value
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 16:28:22 -08:00
Brian Tiger Chow
d65bc1951d 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
adba0baa89 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
Jeromy
1e7e59f0c4 fix validators and key prefix 2014-11-16 02:45:19 -08:00
Brian Tiger Chow
e1f81b780c 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
a45511bb19 fixed dht race #270 2014-11-05 09:26:17 -08:00
Juan Batiz-Benet
03f48e90a6 swarm + net: add explicit listen addresses 2014-11-05 04:00:49 -08:00
Juan Batiz-Benet
be52e35ed7 dht ctxcloserify 2014-10-25 21:33:59 -07:00
Juan Batiz-Benet
6998a8448e net/service now uses ctxcloser 2014-10-25 21:33:10 -07:00
Jeromy
d817b84a64 rewrite findpeer and other dht tweaks 2014-10-24 18:53:36 -07:00
Juan Batiz-Benet
15533c8fa3 dht test fix (net) 2014-10-22 05:31:49 -07:00
Juan Batiz-Benet
3b15457cf0 renamed datastore.go -> go-datastore 2014-10-21 15:10:58 -07:00
Juan Batiz-Benet
28e083b902 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
ac18a83a68 differentiate ports cause timing. 2014-10-19 06:29:18 -07:00
Juan Batiz-Benet
6e5fb41cc6 fixed tests 2014-10-19 02:05:29 -07:00
Juan Batiz-Benet
b3f19c8b72 move IDFromPubKey to peer pkg 2014-10-18 04:28:26 -07:00