Commit Graph

2075 Commits

Author SHA1 Message Date
Jeromy
514b26e2b8 remove sigquit from handled signals 2014-12-05 20:53:33 +00:00
Jeromy
c2b497e315 switch over to using sendMessage vs sendRequest 2014-12-05 20:53:32 +00:00
Jeromy
3a6b6c6974 cleanup, use a workgroup over channels 2014-12-05 20:53:32 +00:00
Brian Tiger Chow
9835c1e335 doc(bitswap) fix duplicaduplication
@whyrusleeping

ada571425b (commitcomment-8753622)

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:32 +00:00
Jeromy
bc02b77b47 document bitswap more 2014-12-05 20:53:32 +00:00
Jeromy
f0a4fdad59 some bitswap cleanup 2014-12-05 20:53:32 +00:00
Brian Tiger Chow
1e7b7efa76 refactor(bitswap) perform Publish in HasBlock
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:32 +00:00
Brian Tiger Chow
829eac3012 fix(bitswap) pass derived context to called functions
@whyrusleeping @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:31 +00:00
Brian Tiger Chow
bb0b5f7c0b fix(notifications) prevent deadlock when context cancelled early
+ test(notifications)

cc @whyrusleeping @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:31 +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
Jeromy
d06343083e add a test in merkledag to exercise GetBlocks 2014-12-05 20:53:31 +00:00
Jeromy
4cc1780705 fix issues in merkledag 2014-12-05 20:53:31 +00:00
Brian Tiger Chow
d721c448af reset test to the way it ways before
@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:31 +00:00
Brian Tiger Chow
e27de2bfa2 fix(blockservice) respect context in GetBlocks
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:30 +00:00
Brian Tiger Chow
bef75d5061 fix(bitswap/testutils) vendor
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:30 +00:00
Brian Tiger Chow
fb5779661b fix(bs/notifications) use SubOnceEach to provide uniqueness guarantee
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

vendor forked pubsub to get SubOnceEach

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:30 +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
Brian Tiger Chow
aac3c6abbd fix(blockservice) test
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
Brian Tiger Chow
9bf1ba6ab5 fix(bs/notifications) prevent duplicates
@whyrusleeping now notifications _guarantees_ there won't be any
duplicates

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:29 +00:00
Brian Tiger Chow
20382340f5 test(bs/n) check for duplicates received
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:29 +00:00
Brian Tiger Chow
e393edcc28 Revert "hotfix(dep) duplicates TEMP DONT MERGE TO MASTER"
This reverts commit 49004e9743.
2014-12-05 20:53:29 +00:00
Brian Tiger Chow
044db5bee8 hotfix(dep) duplicates TEMP DONT MERGE TO MASTER
before merging, fork and send a PR to tuxy

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:29 +00:00
Brian Tiger Chow
e4c9731643 chore(util) remove forward
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
Brian Tiger Chow
6a5bc4b879 fix(bs/n) remove unnecessary variable
to remove ambiguity

(before it was possible to loop over either topics or keys

by only keeping keys, there's no confusing about what to use for the
loop range

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
Brian Tiger Chow
134929ac64 misc(bs/n) rm dead code
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
Brian Tiger Chow
b3d3b1dd30 refactor(bitswap) forwardN no longer needed
@whyrusleeping

now, the pubsub channel closes after sending N blocks. we got this
functionality for free from the fix. So, the forwardN wrap is no longer
required! woohoo

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
Brian Tiger Chow
a5fccaccee tests(bitswap/notifications) test niladic
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
Brian Tiger Chow
03324f7765 fix(bitswap/notifications) subscribe to many
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
Brian Tiger Chow
1fb80330da docs(bitswap/notifications)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
Jeromy
50b00eb90f use @maybebtc's ForwardBlocks function 2014-12-05 20:53:27 +00:00
Brian Tiger Chow
d5e7fd6707 test(notifications)
we expect this to fail. will be fixed in upcoming commit

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
Jeromy
9120d107c3 a little more correctness on the new bitswap impl 2014-12-05 20:53:27 +00:00
Brian Tiger Chow
a932bfdfab doc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
Brian Tiger Chow
fc820a8110 tests(forward)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
Brian Tiger Chow
be2678522e fix(dep)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:26 +00:00
Brian Tiger Chow
438ffa1dd7 feat(util) ForwardNBlocks
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:26 +00:00
Jeromy
ed4509923c tracking down a bug dhthell found, added asserts and better logging. 2014-12-05 20:53:26 +00:00
Jeromy
15d4f82945 some cleanup, and fix minor bug in dagreader from previous commit 2014-12-05 20:53:26 +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
59a32b1d0f refactor(bitswap) group the deferreds
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:25 +00:00
Jeromy
0ce6071fea revamp BatchFetch a bit 2014-12-05 20:53:25 +00:00
Brian Tiger Chow
c7c085970e fix(exchange) allow exchange to be closed
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:25 +00:00
Brian Tiger Chow
4ef780a9c9 fix(bitswap) signal termination to async'ly spawned workers
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:25 +00:00
Brian Tiger Chow
5bd3b178b6 style(bitswap) name -> loop
eh?

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +00:00
Brian Tiger Chow
f6cb4ab9a2 feat(bitswap) loop over all provided keys
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +00:00
Brian Tiger Chow
ecf62dbf3a feat(bitswap) find providers for all keys on wantlist
@jbenet @whyrusleeping

this addresses a failure case where

1) bitswap wants blocks A and B
2) partner 1 has A and partner 2 has B
3) We choose a key at random, drawing A.
4) Then, we request A, neglecting to find a provider for B.

Sending the full wantlist is meant to be used as a helpful additional
piece of data, but...

unless our hunch is support by statistical inference at runtime,
it's not safe to assume that a peer will have blocks for related keys.
Routing must be the source of truth.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +00:00
Brian Tiger Chow
7c2053c3c8 fix(bitswap/loop) add to wantlist just once
oops

set Add is idempotent but it's a waste of resources

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +00:00