1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 01:52:26 +08:00

2736 Commits

Author SHA1 Message Date
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
10bb354f1b fix: the docker-test's make task 2014-12-23 08:36:30 -08:00
c84a714b16 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	peer: added a PeerInfo struct
  PeerInfo is a small struct used to pass around a peer with
 	a set of addresses and keys. This is not meant to be a
 	complete view of the system, but rather to model updates to
 	the peerstore. It is used by things like the routing system.
-	updated peer/queue + peerset
-	latency metrics
-	testutil: use crand for PeerID gen
 	RandPeerID generates random "valid" peer IDs. it does not
 	NEED to generate keys because it is as if we lost the key
 	right away. fine to read some randomness and hash it. to
 	generate proper keys and an ID, use:
 	  sk, pk, _ := testutil.RandKeyPair()
 	  id, _ := peer.IDFromPublicKey(pk)
 	Also added RandPeerIDFatal helper
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
d399a932fe peer/queue/sync: remove buffering 2014-12-23 08:32:53 -08:00
ec96a0b0b5 util: fractional context 2014-12-23 08:27:53 -08:00
cc7a869e3d threadsafe SeededRand 2014-12-23 08:26:24 -08:00
6e9cb06be3 Merge pull request #464 from chriscool/update_go_msgio_in_godeps
Godeps: update dependency for go-msgio
2014-12-21 02:04:41 -05:00
36b2cdb25b Godeps: update dependency for go-msgio
Otherwise there is the following failure when running godep restore:

fatal: reference is not a tree: 281b085dc602c4f0377438e20331f45a91bcdf9c
godep: restore: exit status 128

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-12-20 20:47:52 +01:00
35e2338d65 update installation instructions and update usage to most recent 2014-12-19 19:25:19 +00:00
afd6680208 Merge pull request #438 from jbenet/bitswap-rounds
Bitswap rounds
2014-12-17 23:50:29 -08:00
9fafec1256 do not run epic tests in parallel
@whyrusleeping

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
9328fbaf81 clean peerset constructor names 2014-12-17 23:44:46 -08:00
8100582e38 fix: batches of blocks have equal priority
addresses...

https://github.com/jbenet/go-ipfs/pull/438/files#r21878994

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
bd3ee739b9 doc: some comments about the future of the decision engine
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
ce2d0a2258 fix: add lock to taskQueue
@whyrusleeping may wanna have a look and make sure i didn't screw
anything up here

BenchmarkInstantaneousAddCat1MB-4            200          10763761 ns/op
97.42 MB/s
BenchmarkInstantaneousAddCat2MB-4       panic: runtime error: invalid
memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0xbedd]

goroutine 14297 [running]:
github.com/jbenet/go-ipfs/exchange/bitswap/decision.(*taskQueue).Remove(0xc2087553a0,
        0xc2085ef200, 0x22, 0x56f570, 0xc208367a40)
    /Users/btc/go/src/github.com/jbenet/go-ipfs/exchange/bitswap/decision/taskqueue.go:66
    +0x82
github.com/jbenet/go-ipfs/exchange/bitswap/decision.(*Engine).MessageSent(0xc20871b5c0,
        0x56f570, 0xc208367a40, 0x570040, 0xc208753d40, 0x0, 0x0)
    /Users/btc/go/src/github.com/jbenet/go-ipfs/exchange/bitswap/decision/engine.go:177
    +0x29e
github.com/jbenet/go-ipfs/exchange/bitswap.(*bitswap).send(0xc20871b7a0,
        0x56f4d8, 0xc208379800, 0x56f570, 0xc208367a40,
        0x570040, 0xc208753d40, 0x0, 0x0)
    /Users/btc/go/src/github.com/jbenet/go-ipfs/exchange/bitswap/bitswap.go:352
    +0x11c
github.com/jbenet/go-ipfs/exchange/bitswap.(*bitswap).taskWorker(0xc20871b7a0,
        0x56f4d8, 0xc208379800)
    /Users/btc/go/src/github.com/jbenet/go-ipfs/exchange/bitswap/bitswap.go:238
    +0x165
    created by
    github.com/jbenet/go-ipfs/exchange/bitswap.New
    /Users/btc/go/src/github.com/jbenet/go-ipfs/exchange/bitswap/bitswap.go:66
    +0x49e
2014-12-17 23:44:46 -08:00
175513e281 refactor(bs/decision.Engine): pass in Entry
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
4bcfe094a1 extract constants
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
0545c4d15d refactor: *Entry -> Entry
in many places, entries are assigned from one slice to another and in
different goroutines. In one place, entries were modified (in the
queue). To avoid shared mutable state, probably best to handle entries
by value.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
19764880d8 doc: peerset fixme
not changing this because i don't want to write a test for it now

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
45faa4d7a0 fix: set peerset size
addresses https://github.com/jbenet/go-ipfs/pull/438#discussion_r21952271

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
e36d656632 log unusual event
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
2b60b641c4 fix: check blockstore before adding task
addresses https://github.com/jbenet/go-ipfs/pull/438#discussion_r21953742

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
6e7c46a6e2 unexport functions
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
9c301a2d77 add comment
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
1b1260b658 rm unused method
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
8d4d5b86ef fix: don't sort the output of Entries()
only sort SortedEntries()

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00