Commit Graph

56 Commits

Author SHA1 Message Date
Brian Tiger Chow
c114b04ae1 feat(bitswap): synchronous close 2015-02-01 21:54:19 -08:00
Juan Batiz-Benet
64191c1b31 bitswap: removed dubious error check test. 2015-01-29 01:10:01 -08:00
Juan Batiz-Benet
958cc61647 epictest: added test for bitswap wo routing 2015-01-28 23:55:30 -08:00
Brian Tiger Chow
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
Juan Batiz-Benet
1ab9588cba p2p/test: bogus key pair for faster tests 2015-01-05 05:48:15 -08:00
Brian Tiger Chow
0172e4f2bb style(testutil) rename testutil.Peer -> testutil.Identity
cc @jbenet
2014-12-24 09:59:24 -05:00
Brian Tiger Chow
ca32a83394 wip with DHT
@whyrusleeping @jbenet this is a WIP with the DHT.

wip

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	epictest/addcat_test.go
	exchange/bitswap/testnet/peernet.go
	exchange/bitswap/testutils.go
	routing/mock/centralized_server.go
	routing/mock/centralized_test.go
	routing/mock/interface.go

fix(routing/mock) fill in function definition
2014-12-24 09:31:19 -05:00
Brian Tiger Chow
27dc9594ba refactor(bitswap) bitswap.Network now abstracts ipfs.Network + ipfs.Routing
@jbenet @whyrusleeping

the next commit will change bitswap.Network.FindProviders to only deal
with IDs
2014-12-23 09:19:21 -08:00
Brian Tiger Chow
3f9c1263ec fix: data race in test
https://build.protocol-dev.com/job/race/9352/console

@jbenet @whyrusleeping

pinging you guys to spread awareness about the delay.D type for
configurable delays

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:59:40 -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
Jeromy
029e305f19 tasklist queue for bitswap tasks 2014-12-17 23:44:41 -08:00
Jeromy
57e7dd7b8b extracted ledgerset from strategy, cleaned up a few comments from the PR 2014-12-17 23:44:40 -08:00
Jeromy
5b6a5e807f implement bitswap roundWorker
make vendor
2014-12-17 23:44:39 -08:00
Brian Tiger Chow
3ecdec985f refactor(mockrouting) misc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:30:33 -08:00
Brian Tiger Chow
193004a061 refac(bs/test) provide a shared net delay constant
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:17:16 -08:00
Brian Tiger Chow
3c44ad1fd1 feat(bs/testnet) use delay in virtual network
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:17:16 -08:00
Brian Tiger Chow
8e0c8a7a7e refactor(mdag, bserv, bs) mocks, etc.
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:17:16 -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
432eee651f remove unnecessary concurrency in last commit 2014-12-05 20:53:33 +00:00
Brian Tiger Chow
7a3819a528 refactor(util) move block generator
@whyrusleeping @jbenet

Putting the block generator in a util dir until blocks.

Can't put it in util/testutil because the util/testutil/dag-generator
imports blockservice and blockservice uses the generator.

Tough problem. This'll do for now.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:31 +00:00
Brian Tiger Chow
19de3041fb fix(bitswap) build-breaking compilation errors
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:30 +00:00
Jeromy
07bb901ed5 add a test to blockservice to demonstate GetBlocks failure. 2014-12-05 20:53:29 +00:00
Jeromy
6d217b5311 ensure sending of wantlist to friendly peers 2014-12-05 20:53:29 +00:00
Jeromy
9120d107c3 a little more correctness on the new bitswap impl 2014-12-05 20:53:27 +00:00
Jeromy
d53deebada wire GetBlocks into blockservice 2014-12-05 20:53:26 +00:00
Brian Tiger Chow
ab201c15bb test(bitswap) Close (but skip for now)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:25 +00:00
Brian Tiger Chow
eb0bde052e rename
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:23 +00:00
Brian Tiger Chow
5babfb975d tests(bitswap) share code between the two large tests
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:23 +00:00
Brian Tiger Chow
81a3ba0677 tests(bitswap) share constructor between tests
@whyrusleeping i hope this makes it a bit easier to work with tests

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:22 +00:00
Jeromy
19da05701d remove buffer timing in bitswap in favor of manual batching 2014-12-05 20:53:21 +00:00
Jeromy
4d1447589c added a new test for a dhthell scenario that was failing 2014-12-05 20:53:21 +00:00
Brian Tiger Chow
e5983cbe7d some renaming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:20 +00:00
Brian Tiger Chow
cfd7d5369b test(bitswap)
@whyrusleeping This appears to be a timing issue. The asynchronous
nature of the new structure provides has the bitswap waiting on the
context a bit more. This isn't a problem at all, but in this test, it
makes the functions return in an inconveniently timely manner.

TODO don't let the test depend on time.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:18 +00:00
Jeromy
5be35a83f1 beginnings of a bitswap refactor 2014-12-05 20:53:18 +00: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
Brian Tiger Chow
45b1929342 fix(bitswap_test) race cond
https://github.com/jbenet/go-ipfs/issues/270#issuecomment-61826022
2014-11-05 10:01:22 -08:00
Brian Tiger Chow
715f5f4a19 fix(blockstore, bitswap) enforce threadsafety in blockstore
fixes data race detected in a testnet test
2014-10-24 16:16:41 -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
7c5679536c bugfix: use consistent interface
We'll want a `type blocks.Block interface {}` later, but
for now, make sure Blockstore uses ptrs for both Get and Put.

+ fix NewBlock output compile error
2014-10-07 21:32:17 -07:00
Jeromy
6e0cfb3273 removed error from return type of blocks.NewBlock() 2014-10-07 20:46:01 +00:00
Juan Batiz-Benet
77fccaa2f3 Obviated need for .ID.Pretty() all over the place. 2014-10-06 04:23:55 -07:00
Jeromy
414ff34194 change back to using Client method 2014-09-23 18:23:46 -04:00
Jeromy
c45cc8c448 implement a mock dht for use in testing 2014-09-23 18:23:46 -04:00
Brian Tiger Chow
9d7ae40003 feat(bitswap) expose ability to toggle "niceness"
true -> always send to peer

false -> use ledger-based strategy described in IPFS paper draft 3
2014-09-22 04:06:19 -07:00
Brian Tiger Chow
767d6ca633 refac(bitswap, util) extract KeySet 2014-09-22 04:06:19 -07:00
Brian Tiger Chow
faee10effe test(bitswap) send entire wantlist to peers
fix(bitswap) pass go vet

fixes #97

https://github.com/jbenet/go-ipfs/issues/97
2014-09-22 04:06:19 -07:00
Brian Tiger Chow
b806270e5d test(bitswap) test sending wantlist to peers 2014-09-22 04:06:18 -07:00
Brian Tiger Chow
b7b046582b test(bitswap) test with swarm of ~500 instances
test(bitswap) run synchronously to aid the scheduler
2014-09-22 04:06:16 -07:00