1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 03:19:47 +08:00

2068 Commits

Author SHA1 Message Date
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
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
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
d06343083e add a test in merkledag to exercise GetBlocks 2014-12-05 20:53:31 +00:00
4cc1780705 fix issues in merkledag 2014-12-05 20:53:31 +00:00
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
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
bef75d5061 fix(bitswap/testutils) vendor
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:30 +00:00
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
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
aac3c6abbd fix(blockservice) test
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:30 +00:00
07bb901ed5 add a test to blockservice to demonstate GetBlocks failure. 2014-12-05 20:53:29 +00:00
6d217b5311 ensure sending of wantlist to friendly peers 2014-12-05 20:53:29 +00:00
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
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
e393edcc28 Revert "hotfix(dep) duplicates TEMP DONT MERGE TO MASTER"
This reverts commit 49004e9743110ba69c07852c3a105dac2e01e1c4.
2014-12-05 20:53:29 +00:00
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
e4c9731643 chore(util) remove forward
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:28 +00:00
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
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
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
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
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
1fb80330da docs(bitswap/notifications)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
50b00eb90f use @maybebtc's ForwardBlocks function 2014-12-05 20:53:27 +00:00
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
9120d107c3 a little more correctness on the new bitswap impl 2014-12-05 20:53:27 +00:00
a932bfdfab doc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
fc820a8110 tests(forward)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:27 +00:00
be2678522e fix(dep)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:26 +00:00
438ffa1dd7 feat(util) ForwardNBlocks
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:26 +00:00
ed4509923c tracking down a bug dhthell found, added asserts and better logging. 2014-12-05 20:53:26 +00:00
15d4f82945 some cleanup, and fix minor bug in dagreader from previous commit 2014-12-05 20:53:26 +00:00
d53deebada wire GetBlocks into blockservice 2014-12-05 20:53:26 +00:00
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
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
0ce6071fea revamp BatchFetch a bit 2014-12-05 20:53:25 +00:00
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
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
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
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
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
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
d0304def6b refactor(blockstore, blockservice) use Blockstore and offline.Exchange
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +00:00
04a8a6133c rename exchange
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +00:00
eb0bde052e rename
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:23 +00:00
918c8e274e refactor(blockstore) mv under blocks/
@jbenet @whyrusleeping

the pyramids were built one brick at a time

addresses: https://github.com/jbenet/go-ipfs/issues/370

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:23 +00:00
b1b42a5609 change BatchFetch to return indices 2014-12-05 20:53:23 +00:00
99ae432021 start working getBlocks up the call chain 2014-12-05 20:53:23 +00:00
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