Commit Graph

96 Commits

Author SHA1 Message Date
Juan Batiz-Benet
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00
Juan Batiz-Benet
e908effb4b 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
45e4352c9c dropped down log.Errors 2015-01-26 19:13:44 -08:00
Juan Batiz-Benet
66503701ac dht: TestConnectCollision skip in Travis
+ longer timeout
2015-01-24 10:34:28 -08:00
Juan Batiz-Benet
8037235c6d disable dht TestPeriodicBootstrap on CI 2015-01-24 10:30:15 -08:00
Juan Batiz-Benet
4a5f5e2e2b 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
dd9c1b6243 core/bootstrap: CR comments 2015-01-23 02:08:30 -08:00
Juan Batiz-Benet
82d38a2692 routing/dht: periodic bootstrapping #572 2015-01-23 02:08:28 -08:00
Juan Batiz-Benet
56ae2fd0a8 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
50c8561bdd add peer info after FindPeer RPC
fix ping test
2015-01-10 07:27:49 +00:00
Juan Batiz-Benet
1d9977c850 dht/bootstrap/test: longer timeout, less bias 2015-01-05 07:19:07 -08:00
Juan Batiz-Benet
dfcea4c6f1 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
41af4f4ea1 dht test skips 2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
8fb5cf9578 swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
e2698a8733 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
89f5cd4c94 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
49cb135ca2 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
4807127def 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
da04d26779 clean up test setup interface 2015-01-02 08:33:42 +00:00
Juan Batiz-Benet
2ad23f0579 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
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
Juan Batiz-Benet
989d3d4ce5 dht/test skip bootstrap test when short 2014-12-24 05:39:48 -08:00
Juan Batiz-Benet
60c869d401 dht/test: providers test id compare 2014-12-24 04:23:15 -08:00
Juan Batiz-Benet
923c082d66 dht: cleaned up dht_test.
TestProversMany still fails
2014-12-24 03:48:02 -08:00
Juan Batiz-Benet
57510d2fec dht/dht_test: bootstrap synchronously. fares better. 2014-12-24 03:46:45 -08:00
Juan Batiz-Benet
b5cbc8b6fa dht_test: better bootstrapping logging 2014-12-24 03:41:13 -08:00
Juan Batiz-Benet
ef0c25f463 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
ccf6f79aa0 respect don contexteone 2014-12-24 03:24:28 -08:00
Juan Batiz-Benet
f8c523fc3b bootstrap test 2014-12-24 02:20:11 -08:00
Juan Batiz-Benet
04f9805d5d dht_test large providers test 2014-12-24 01:49:55 -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
bc2d35fd4d Lots of fixes. DHT tests pass 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
41751b4938 Integrated new network into ipfs 2014-12-16 14:47:29 -08:00
Juan Batiz-Benet
e0f11dff24 dht: FindPeersConnectedToPeer 2014-12-08 20:52:46 -08:00
Juan Batiz-Benet
26e7656164 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
b799ddef58 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
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
Jeromy
cb23d5b2ae fix validators and key prefix 2014-11-16 02:45:19 -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
70f796afd6 fixed dht race #270 2014-11-05 09:26:17 -08:00
Juan Batiz-Benet
0135e3ebbe swarm + net: add explicit listen addresses 2014-11-05 04:00:49 -08:00
Juan Batiz-Benet
d79ebe68d2 dht ctxcloserify 2014-10-25 21:33:59 -07:00
Juan Batiz-Benet
f2b8803a57 net/service now uses ctxcloser 2014-10-25 21:33:10 -07:00
Jeromy
762faa7421 rewrite findpeer and other dht tweaks 2014-10-24 18:53:36 -07:00
Juan Batiz-Benet
a8adf2ff2c dht test fix (net) 2014-10-22 05:31:49 -07:00
Juan Batiz-Benet
f7c1ed39e0 renamed datastore.go -> go-datastore 2014-10-21 15:10:58 -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
d17292a4c2 differentiate ports cause timing. 2014-10-19 06:29:18 -07:00
Juan Batiz-Benet
4783332b11 fixed tests 2014-10-19 02:05:29 -07:00