Commit Graph

346 Commits

Author SHA1 Message Date
Brian Tiger Chow
acc714823b rename to peerRequestQueue
this opens up the possibility of having multiple queues. And for all
outgoing messages to be managed by the decision engine

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
Brian Tiger Chow
1d23e94f16 rm empty file
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
Brian Tiger Chow
5bd0b95462 rename to strategy.LedgerManager to decision.Engine
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
bef622222d refactor: wantlist splits into WL and ThreadSafe WL
bitswap keeps the threadsafe version. observing the ledger shows that it
doesn't need it anymore (ledgermanager is protected and safe).

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
d069ae11f4 refactor: put mutex next to the things it protects
If we put the lock next to the fields it protects, it can sometimes make
it easier to reason about threadsafety.

In this case, it reveals that the task queue (not threadsafe) isn't protected by the
mutex, yet shared between the worker and callers.

@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
962a9477cc refactor: remove ledgerMap type
it's only used in two places, but i think we've been using maps on IPFS
types so much now that the specificity is no longer necessary

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
39d71931a8 mv comment
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
7fdbae1306 refactor: separate responsibilties
Before, priority carried two pieces of information.

One: priority as defined by remote peer
Two: whether task is trashed

This assumes the protocol is defined for natural numbers instead of
integers. That may not always be the case. Better to leave that
assumption outside so this package isn't coupled to the whims of the
protocol.

The protocol may be changed to allow any integer value to be used.
Hopefully by that time, new responsibilties weren't added to the
Priority variable.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
fedcebf67a refactor: re-use wantlist.Entry type wherever it makes sense
it seems to make sense since, in each place, the Key and Priority
represent the same information

b/c you know the saying...

"It is better to have 100 functions operate on one data structure than
10 functions on 10 data structures."

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
1d715956f5 doc: add comment to Envelope
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
e11f099c42 privatize Task
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
181ff4eab1 tq.Cancel -> tq.Remove
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
198aa1959a it's not a queue yet but it's okay to name it as such
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
7280aac83f perf: avoid lots of communication by signaling once at end of method
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
cc2a7312a2 add comment to fix race
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
b41fef2fff refactor: remove peerKey type
we've been using maps with peers long enough now that this probably is
no longer necessary

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
286723d888 unexport task and taskList
the less bitswap has to know about, the easier it'll be for readers.
(This now returns Messages.)

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
93fde86d18 refactor: taskKey := p.Key() + block.Key()
for clarity and to avoid errors, define a function

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
460967839e doc: comment
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
10e970c0cf refactor: context first in argument list
(merely by convention)

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
f66d94aaf1 fix: move the check into the function.
function should be a no-op when passed an empty slice

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
8c05c444a5 refactor: avoid loop reuse
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
2ea8ed81ac refactor: change Tasks to Outbox
notice that moving the blockstore fetch into the manager removes the
weird error handling case.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
a495a014af style constify variables
good to const until it's required for them to be variable.

TODO pass them in as configuration options
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
8bef1dce80 fix: move to callsite so public callers don't experience the internal timeout rule
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
5603b2e0a4 style: line wrapping
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
c0a18d9c08 fix(test): nil Blockstore
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Jeromy
69dd260236 refactor peerSet 2014-12-17 23:44:42 -08:00
Brian Tiger Chow
f533678724 avoid attaching context to object when it's not necessary.
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
f028c44fd2 name findOrCreate
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Brian Tiger Chow
1bced710b1 queue-like naming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Brian Tiger Chow
29ef238fa3 remove dead code
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Brian Tiger Chow
86c438b6e1 refactor() message API
performing CR in the form of a PR. Let me know what you think.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Jeromy
6389bfda6b some cleanup before CR 2014-12-17 23:44:41 -08:00
Jeromy
90a30961de renaming and removing empty strategy file 2014-12-17 23:44:41 -08:00
Jeromy
029e305f19 tasklist queue for bitswap tasks 2014-12-17 23:44:41 -08:00
Jeromy
cfbe92bc8b rewrite sendWantlistToProviders 2014-12-17 23:44:40 -08:00
Jeromy
946d2a96f2 add locks to wantlist to avoid race condition 2014-12-17 23:44:40 -08:00
Brian Tiger Chow
59f0ffb8c6 remove noisy statement
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:40 -08:00
Jeromy
50aa37fec4 blockstore.ErrNotFound, and proper wantlist sorting 2014-12-17 23:44:40 -08:00
Jeromy
e7bba82dcb add priorities to GetBlocks requests, and add waitgroup to sendWantListTo 2014-12-17 23:44:40 -08:00
Jeromy
3778eedff0 dont spawn so many goroutines when rebroadcasting wantlist 2014-12-17 23:44:40 -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
Jeromy
12b296ee1a create wantlist object 2014-12-17 23:44:39 -08:00
Juan Batiz-Benet
ba323c3e48 make vendor 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
Brian Tiger Chow
5b5ece07ba doc TODO
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-14 16:37:42 -08:00
Brian Tiger Chow
9a85f8fa72 style: Stop -> Close() error for Closer interface
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-14 16:35:09 -08:00
Jeromy
c79fad2e12 give sessiongenerator a master context for easy cancelling 2014-12-14 16:33:05 -08:00
Brian Tiger Chow
c00a7a2ebe misc(bitswap/strat) rm noisy message
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:43:27 -08:00
Brian Tiger Chow
cf43cdd5d8 feat(bs/testutil) use write cache
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:43:27 -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
1c8acd01c9 fix(bs/testnet) rm named error
Real version doesn't expose this

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
e22ef19d84 log when dupe block is prevented 2014-12-07 21:03:54 +00:00
Jeromy
e4a8a2ed65 same block cant be sent twice to a peer within a certain time period 2014-12-07 20:54:31 +00:00
Jeromy
39162f2cea prevent sending of same block to a peer twice 2014-12-07 07:54:44 +00:00
Brian Tiger Chow
ab565474ca rm unnecessary concurrency
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 23:33:32 -08:00
Brian Tiger Chow
601a2faa28 move public method to top of file
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 23:33:30 -08:00
Brian Tiger Chow
9a2f79c42f refactor(bitswap) consolidate HasBlock
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	exchange/bitswap/bitswap.go
2014-12-05 23:32:21 -08:00
Brian Tiger Chow
670d0244b4 feat(bitswap) make offline exchange query datastore
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 23:31:01 -08:00
Jeromy Johnson
260ac96175 Update README.md 2014-12-05 20:53:36 +00:00
Jeromy
afa28dc672 update bitswap readme 2014-12-05 20:53:36 +00:00
Jeromy
f054be9e1f update bitswap readme 2014-12-05 20:53:35 +00:00
Jeromy
6552163740 add readme for bitswap 2014-12-05 20:53:33 +00:00
Jeromy
432eee651f remove unnecessary concurrency in last commit 2014-12-05 20:53:33 +00:00
Jeromy
e8536db351 make bitswap sub-RPC's timeout (slowly for now) 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
4cc1780705 fix issues in merkledag 2014-12-05 20:53:31 +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
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
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
Jeromy
ed4509923c tracking down a bug dhthell found, added asserts and better logging. 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
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
Brian Tiger Chow
04a8a6133c rename exchange
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:24 +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
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
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
a5754a5ff4 fix(bitswap) stop the ticker when the run loop exits
@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:23 +00:00
Brian Tiger Chow
11f2856d31 feat(bitswap) implement GetBlocks
@whyrusleeping @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:22 +00:00
Brian Tiger Chow
b13a5a940b refactor(bitswap) move wantlist to loop receive
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:22 +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
Brian Tiger Chow
8f8230823f feat(bitswap/notifications) Subscribe to multiple keys
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:22 +00:00
Brian Tiger Chow
85229be43a style(bitswap/notifications) make it more obvious
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:21 +00:00
Jeromy
297ff3d4b2 randomize rebroadcast target 2014-12-05 20:53:21 +00:00
Jeromy
19da05701d remove buffer timing in bitswap in favor of manual batching 2014-12-05 20:53:21 +00:00
Jeromy
e4b2ae3bb2 fix tests halting 2014-12-05 20:53:21 +00:00
Jeromy
0abc72c062 move some variables into strategy 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
9af9ee6255 misc(bitswap) renaming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:20 +00:00
Brian Tiger Chow
f8243c36be simplify
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:20 +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
6c2a6669cb constify to make it clear what _can_ and _can't_ change over time
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:20 +00:00
Brian Tiger Chow
3ee7ff54ba naming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:20 +00:00
Brian Tiger Chow
7239036e2d clarify MessageReceived contract
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:19 +00:00
Brian Tiger Chow
5165fce9d9 use event logger here too?
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:19 +00:00
Brian Tiger Chow
5a4eed4c00 fix(log) ->f
@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:19 +00:00
Brian Tiger Chow
768cd3682c fix(bitswap) consistent event names
@whyrusleeping @jbenet

since the logger is created with package scope, don't need to specify
the package name in event messages

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:19 +00:00
Brian Tiger Chow
ef831268e0 fix(bitswap) handle error
@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:19 +00:00
Brian Tiger Chow
77696a47f7 events(bitswap) try the new event logger in the bitswap GetBlock method
@jbenet
@whyrusleeping

Let me know if you want to direct the eventlog output to _both_ the file
and stderr. Right now it goes to file. Perhaps this is just a minor bip
in the larger discussion around log levels.

https://github.com/jbenet/go-ipfs/issues/292

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:53:18 +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
5dece164cc dont panic on empty wantlist 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
72a0cc18ce fix(bitswap) shutdown
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:12:36 -08:00
Brian Tiger Chow
3fdbd6cd15 fix(bitswap/notifications) don't force sender to block on receiver
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:12:35 -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
Brian Tiger Chow
3663eef5ac refctor(bitswap/network) replace Network interface with Dialer interface 2014-11-15 02:10:53 -08:00
Brian Tiger Chow
0b42d77e13 refactor(core, bitswap) split bitswap init into two steps
@jbenet
2014-11-15 02:10:53 -08:00
Brian Tiger Chow
154cf4af75 refactor(bitswap/network) rename -> BitSwapNetwork
remove 'adapter' concept
instead, describe the component as the bitswap network

it's still an adapter, but it's just not necessary to describe it as
such
2014-11-15 02:10:53 -08:00
Brian Tiger Chow
cf1d463885 rename var 2014-11-15 02:10:53 -08:00
Brian Tiger Chow
2bc82adfae style(bitswap) rename Adapter -> BitSwapNetwork for clarity 2014-11-15 02:10:52 -08:00
Brian Tiger Chow
919fb31a16 style(bitswap) rename variable to 'routing' 2014-11-15 02:10:52 -08:00
Jeromy
d4c819e97d log -> logf 2014-11-12 10:39:11 -08:00
Jeromy
be5d01b6a6 more doc comments 2014-11-08 22:44:37 -08:00
Brian Tiger Chow
34561b0da8 docs(exchange) 2014-11-08 21:42:37 -08:00
Juan Batiz-Benet
e5198b1446 bitswap error -> debug (use IPFS_LOGGING=debug) 2014-11-07 14:53:55 -08:00