Juan Batiz-Benet
98f2b0779f
p2p/net: notify on listens
...
Network now signals when it successfully listens on some address
or when an address shuts down. This will be used to establish and
close nat port mappings. It could also be used to notify peers
of address changes.
2015-01-30 20:37:52 -08:00
Brian Tiger Chow
0ec0a6ab87
fix inflection
2015-01-30 06:57:41 -08:00
Brian Tiger Chow
6c2d799cb9
periodically print the number of keys in the wantlist (if any)
2015-01-30 06:57:41 -08:00
Brian Tiger Chow
49f2684c53
expose O(1) len
2015-01-30 06:57:41 -08:00
Brian Tiger Chow
351631a580
pass as param
2015-01-30 06:57:41 -08:00
Brian Tiger Chow
7e90fa95c9
log(bitswap): clean up
2015-01-30 06:57:41 -08:00
Juan Batiz-Benet
feb6d34134
bitswap/net: race fix in peers iteration
2015-01-29 01:16:45 -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
afd3333cab
optimization(bitswap) return connected peers as providers
2015-01-28 22:57:33 -08:00
Brian Tiger Chow
faded10870
fix(bitswap): handling of network notification
2015-01-24 11:34:30 -08:00
Brian Tiger Chow
bbc54516bf
revert bitswap network notification
...
@jbenet @whyrusleeping
2015-01-24 11:47:28 -08:00
Juan Batiz-Benet
1054487690
bitswap: respond to peers connecting + disconnecting
...
With these notifications, bitswap can reclaim all resources
for any outstanding work for a peer.
cc @briantigerchow @whyrusleeping
2015-01-24 09:13:44 -08:00
Brian Tiger Chow
be41444a9e
provide simple wrapper methods for AllKeysRange
...
@jbenet @whyrusleeping
was the 1<<16 intentional? replaced the raw methods with wrappers.
2015-01-24 01:32:28 -08:00
Brian Tiger Chow
6fedf259eb
remove prefix logger
2015-01-24 00:30:56 -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
Brian Tiger Chow
bb89e0d8d7
misc(bitswap): shorten comment and rename var
2015-01-21 17:09:40 -08:00
Brian Tiger Chow
2f247f3355
rm logging statements and inline send
2015-01-21 17:09:40 -08:00
Brian Tiger Chow
129d413f0e
chore(bitswap): rm todo
2015-01-21 17:09:40 -08:00
Brian Tiger Chow
3d3ac08fcf
chore(bitswap): rm debug log (covered by eventlog)
2015-01-21 17:09:39 -08:00
Brian Tiger Chow
aa4c0d1b90
fix(bitswap): release the lock last
...
The area above the lock was getting big. Moving this up to avoid
mistakes down the road.
2015-01-21 17:09:39 -08:00
Brian Tiger Chow
5985854099
fix: return pointer
...
@whyrusleeping
2015-01-19 03:08:05 -08:00
Brian Tiger Chow
60e288ed4b
fix(bitswap.decision.Engine) enqueue only the freshest messages
...
Before, the engine worker would pop a task and block on send to the
bitswap worker even if the bitswap worker wasn't to receive. Since the
task could have been invalidated during this blocking send, a small
number of stale (already acquired) blocks would be send to partners.
Now, tasks are only popped off of the queue when bitswap is ready to
send them over the wire. This is accomplished by removing the
outboxChanBuffer and implementing a two-phase communication sequence.
2015-01-19 03:07:21 -08:00
Brian Tiger Chow
76bea9be0a
move PQ to thirdparty
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
61e4300d59
feat(PQ)
...
refactor: peerRequestQueue
it's a mistake to make one queue to fit all. Go's lack of algebraic
types turns a generalized queue into a monstrosity of type
checking/casting. Better to have individual queues for individual
purposes.
Conflicts:
exchange/bitswap/decision/bench_test.go
exchange/bitswap/decision/tasks/task_queue.go
fix(bitswap.decision.PRQ): if peers match, always return result of pri comparison
fix(bitswap.decision.Engine): push to the queue before notifying
TOCTOU bug
1. client notifies
2. worker checks (finds nil)
3. worker sleeps
3. client pushes (worker missed the update)
test(PQ): improve documentation and add test
test(bitswap.decision.Engine): handling received messages
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
0239379303
tests: add bench
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
cb1ef6e1e2
feat: add time to taskQueue
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Conflicts:
exchange/bitswap/decision/taskqueue.go
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
d61ce41516
fix(bitswap/engine): get priority from wantlist
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
6a580e50d3
doc
2015-01-18 15:09:53 -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
2963f48f62
Merge pull request #554 from jbenet/feat/reprovide
...
basic reprovider implementation
2015-01-17 03:03:01 -08:00
Jeromy
acfc35212e
add backoff retry to reprovider
2015-01-17 04:31:50 +00:00
Juan Batiz-Benet
c057cea649
addr-explosion mitigated adding
...
mitigated adding our own addresses where received
from peers
see #573
2015-01-16 11:38:46 -08:00
Jeromy
a6ec12a17d
selected changes from CR
2015-01-16 06:17:18 +00:00
Jeromy
3c55902811
rewrite as single line defer logs
2015-01-15 04:45:34 +00:00
Jeromy
bae8b9f4c0
starting to move important events over to EventBegin/Done
2015-01-15 04:17:17 +00:00
Jeromy
a7650b259d
add test for reprovider and slight refactor
2015-01-14 22:14:52 +00:00
Jeromy
3269986e42
basic reprovider implementation
...
make vendor
2015-01-13 22:12:37 -08:00
Jeromy
a09854db97
early out if no entries in wantlist
2015-01-11 08:09:37 +00:00
Juan Batiz-Benet
1ab9588cba
p2p/test: bogus key pair for faster tests
2015-01-05 05:48:15 -08:00
Juan Batiz-Benet
10072c149d
bitswap: log superfluous messages
2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
aeb2e07198
bitswap: remove DialPeer from interface
...
Bitswap doesn't usually care about dialing. the underlying
network adapter can make sure of that.
2015-01-05 04:55:02 -08:00
Brian Tiger Chow
05d8c80c39
fix(bitswap/network): return when context is done
...
@jbenet @whyrusleeping
This bug (missing return) could tie up the client worker and cause
operations to come to a halt.
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
9c6228d18f
bitswap and dht: lots of debugging logs
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
71ada4696f
bitswap net: always close
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
d357b0ac00
bitswap debug logging
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
c100390a49
bitswap engine: signal in own func
2015-01-05 00:16:52 -08:00
Juan Batiz-Benet
5639042df5
bitswap: send wantlist code reuse + debug logs
2015-01-05 00:16:52 -08:00
Juan Batiz-Benet
7629ad7ec7
bitswap: add self peer.ID
2015-01-05 00:16:52 -08:00
Juan Batiz-Benet
8fb5cf9578
swap net2 -> net
2015-01-02 08:46:46 -08:00