1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 17:36:38 +08:00

2411 Commits

Author SHA1 Message Date
e630ca6078 dht: removing extra newlines 2014-12-24 03:42:43 -08:00
b5cbc8b6fa dht_test: better bootstrapping logging 2014-12-24 03:41:13 -08:00
900c1fbfa2 net/id: when dup id, wait on it. 2014-12-24 03:38:44 -08:00
ef0c25f463 dht bootstrap test: rounds. do nothing
odd behavior: only one dht (the last one) is seeing
changes to its routing table.
2014-12-24 03:24:52 -08:00
ccf6f79aa0 respect don contexteone 2014-12-24 03:24:28 -08:00
f8c523fc3b bootstrap test 2014-12-24 02:20:11 -08:00
cdb461d2a9 dht: update on every received message
i made a separate function because we may want to update our
routing table based on "closer peers". maybe not-- these could
all be lies.
2014-12-24 02:20:11 -08:00
61cdef3570 dht/query: fix important panic
Withe queries (particularly providers), it was possible to
exit the query runner's Run BEFORE all its children were done,
because the runner itself only listened to the context. This
introduced the possibility of a panic (you can go check it
out by running the TestProvidersMany test on dht_test in commits
before this one).  Thankfully, ctxgroup saved the day with
almost _zero_ changes to the sync flow, and now we have the
guarantee that the query runner will only exit if all its
children are done. ❤️

Conflicts:
	routing/dht/query.go
2014-12-24 02:13:38 -08:00
a4021eb433 ctxio -- io with a context.
This commit introduces a reader and writer that respect
contexts. Warning: careful how you use them. Returning
leaves a goroutine reading until the read finishes.
2014-12-24 02:10:56 -08:00
0013415db8 net/interface: move more to Dialer 2014-12-24 02:10:56 -08:00
7d7e051101 dht bootstrap err check fix + logging 2014-12-24 02:10:52 -08:00
596602f37f routing table: better printing (see bkts) 2014-12-24 02:09:06 -08:00
ea2706c698 dht bugfix: unlock on print 2014-12-24 01:50:00 -08:00
04f9805d5d dht_test large providers test 2014-12-24 01:49:55 -08:00
c43e8fa35b fixing race in testutil port 2014-12-23 17:59:35 -08:00
fd2875f2ed fixing race in swarm 2014-12-23 17:59:24 -08:00
32589ad4bb Merge pull request #466 from jbenet/peer-restrict
The Peer is Dead. Long live the ID
2014-12-23 09:44:27 -08:00
a5018fcc0b net/mock: interface addresses 2014-12-23 09:23:32 -08:00
bd45adfb89 chore(bitswap) remove Peerstore() methods from bitswap.Network interface 2014-12-23 09:22:17 -08:00
c34132e080 refactor(bitswap) change PeerInfo to ID in bitswap package
@jbenet @whyrusleeping

This commit replaces peer.PeerInfo with peer.ID in the bitswap package
2014-12-23 09:21:08 -08:00
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
c6294646e9 fix(bitswap) always add addresses 2014-12-23 09:17:40 -08:00
070b633df8 style(bitswap) rename to network 2014-12-23 09:16:00 -08:00
60f3a874c2 feat(bitswap/network) expose peerstore 2014-12-23 09:14:54 -08:00
a225568ff6 style(bitswap) public methods at top 2014-12-23 09:13:17 -08:00
4ab4da7e2b style(bitswap) rename 2014-12-23 09:10:44 -08:00
fb75184c35 fix(bitswap) always use prvivate send method to send
cc @whyrusleeping
2014-12-23 09:09:34 -08:00
d0d220f9de fix(bitswap) always dial 2014-12-23 09:08:11 -08:00
55c8f8f505 Revert "bitswap: network interface changed"
This reverts commit bf88f1aec5e3d397f97d64de52b52686cc7a8c8f.
2014-12-23 09:06:44 -08:00
d970f538e5 bitswap: network interface changed
Had to change the network interface from DialPeer(peer.ID) to
DialPeer(peer.PeerInfo), so that addresses of a provider are
handed to the network.

@maybebtc and I are discussing whether this should go all the
way down to the network, or whether the network _should always
work_ with just an ID (which means the network needs to be
able to resolve ID -> Addresses, using the routing system.
This latter point might mean that "routing" might need to
break down into subcomponents. It's a bit sketchy that
the Network would become smarter than just dial/listen and
I/O, but maybe there's a distinction between net.Network,
and something like a peernet.Network that has routing
built in...)
2014-12-23 09:05:15 -08:00
a7eb52a7fa dht: helpful debugging for no closer peers 2014-12-23 09:03:26 -08:00
64a4abcd6c listen addresses: add Interface addresses
network.ListenAddresses() are general.
Interface addresses are specific.
2014-12-23 09:01:54 -08:00
0dbd86c4f8 connectedness test timing 2014-12-23 09:00:43 -08:00
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
06d4df23f1 misc naming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:58:31 -08:00
e3f8f8cca1 rm low SnR debug statement
"Get" is still fairly useful. Leaving it there.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:57:25 -08:00
b19a931d2f remote low SnR debug statement
cc @jbenet @whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:56:07 -08:00
d5789de6d0 test(docker/network) disable color in daemon logs
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:54:38 -08:00
b61b281eae net/conns better printing of connections 2014-12-23 08:53:28 -08:00
8b4c7cf34b peerstream updated (data race) 2014-12-23 08:51:57 -08:00
4d9f1f0fdf net: Connectedness bugfix
Connectedness was totally incorrect. added a test case.
2014-12-23 08:50:24 -08:00
7952d95bbf added bootstrap logging 2014-12-23 08:48:58 -08:00
4c13b9585a dockertest script to run the test on any img
- run the build image task every time to avoid
  running the test on stale code
- run the test from a script, so that we can
  run the test on different pre-built images.
  like:

    # build an image now and run tests on it
    make test

    # run tests on previously built image
    ./run-test-on-img.sh ipfs-stable

    # TODO: run test on git ref
    ./run-test-on-git-ref.sh <git-ref>
2014-12-23 08:47:38 -08:00
2c95cb5413 dht: bit nicer logging 2014-12-23 08:46:30 -08:00
a10fb7aa4b core: set local listening addresses 2014-12-23 08:44:59 -08:00
87c4fb2fea Makefiles: build the test docker img
this commit changes how the dockertest image is built.
it moves the command into dockertest/Makefile. It also
uses a cached file that -- if removed with make clean
-- can signal whether the image should be rebuilt.
(it may be ideal to have it either detect code has
changed, or just rebuild every time. )
2014-12-23 08:43:52 -08:00
497297b243 net/mocknet: fixed listenaddrs (misrepresenting)
some dht tests signaled "sending peer empty addresses"
which would then cause a failure. this was a misrepresentation
on the part of mocknet. it has been corrected.
2014-12-23 08:42:12 -08:00
4fe1dd9b62 net: have an explicit IdentifyConn on dial
- Make sure we call IdentifyConn on dialed out conns
- we wait until the identify is **done** before return
- on listening case, we can also wait.
- tests now make sure dial does wait.
- tests now make sure we can wait on listening case.
2014-12-23 08:40:52 -08:00
d9961893a2 net/id_test: refactor tests into own func 2014-12-23 08:39:32 -08:00
c2b21e473d routing/mock test: kill leaked goroutine 2014-12-23 08:38:19 -08:00