Commit Graph

2396 Commits

Author SHA1 Message Date
Juan Batiz-Benet
fd2875f2ed fixing race in swarm 2014-12-23 17:59:24 -08:00
Juan Batiz-Benet
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
Juan Batiz-Benet
a5018fcc0b net/mock: interface addresses 2014-12-23 09:23:32 -08:00
Brian Tiger Chow
bd45adfb89 chore(bitswap) remove Peerstore() methods from bitswap.Network interface 2014-12-23 09:22:17 -08:00
Brian Tiger Chow
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
Brian Tiger Chow
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
Brian Tiger Chow
c6294646e9 fix(bitswap) always add addresses 2014-12-23 09:17:40 -08:00
Brian Tiger Chow
070b633df8 style(bitswap) rename to network 2014-12-23 09:16:00 -08:00
Brian Tiger Chow
60f3a874c2 feat(bitswap/network) expose peerstore 2014-12-23 09:14:54 -08:00
Brian Tiger Chow
a225568ff6 style(bitswap) public methods at top 2014-12-23 09:13:17 -08:00
Brian Tiger Chow
4ab4da7e2b style(bitswap) rename 2014-12-23 09:10:44 -08:00
Brian Tiger Chow
fb75184c35 fix(bitswap) always use prvivate send method to send
cc @whyrusleeping
2014-12-23 09:09:34 -08:00
Brian Tiger Chow
d0d220f9de fix(bitswap) always dial 2014-12-23 09:08:11 -08:00
Brian Tiger Chow
55c8f8f505 Revert "bitswap: network interface changed"
This reverts commit bf88f1aec5.
2014-12-23 09:06:44 -08:00
Juan Batiz-Benet
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
Juan Batiz-Benet
a7eb52a7fa dht: helpful debugging for no closer peers 2014-12-23 09:03:26 -08:00
Juan Batiz-Benet
64a4abcd6c listen addresses: add Interface addresses
network.ListenAddresses() are general.
Interface addresses are specific.
2014-12-23 09:01:54 -08:00
Juan Batiz-Benet
0dbd86c4f8 connectedness test timing 2014-12-23 09:00:43 -08:00
Brian Tiger Chow
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
Brian Tiger Chow
06d4df23f1 misc naming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:58:31 -08:00
Brian Tiger Chow
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
Brian Tiger Chow
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
Brian Tiger Chow
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
Juan Batiz-Benet
b61b281eae net/conns better printing of connections 2014-12-23 08:53:28 -08:00
Juan Batiz-Benet
8b4c7cf34b peerstream updated (data race) 2014-12-23 08:51:57 -08:00
Juan Batiz-Benet
4d9f1f0fdf net: Connectedness bugfix
Connectedness was totally incorrect. added a test case.
2014-12-23 08:50:24 -08:00
Juan Batiz-Benet
7952d95bbf added bootstrap logging 2014-12-23 08:48:58 -08:00
Juan Batiz-Benet
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
Juan Batiz-Benet
2c95cb5413 dht: bit nicer logging 2014-12-23 08:46:30 -08:00
Juan Batiz-Benet
a10fb7aa4b core: set local listening addresses 2014-12-23 08:44:59 -08:00
Juan Batiz-Benet
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
Juan Batiz-Benet
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
Juan Batiz-Benet
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
Juan Batiz-Benet
d9961893a2 net/id_test: refactor tests into own func 2014-12-23 08:39:32 -08:00
Juan Batiz-Benet
c2b21e473d routing/mock test: kill leaked goroutine 2014-12-23 08:38:19 -08:00
Brian Tiger Chow
10bb354f1b fix: the docker-test's make task 2014-12-23 08:36:30 -08:00
Juan Batiz-Benet
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
Juan Batiz-Benet
d399a932fe peer/queue/sync: remove buffering 2014-12-23 08:32:53 -08:00
Juan Batiz-Benet
ec96a0b0b5 util: fractional context 2014-12-23 08:27:53 -08:00
Juan Batiz-Benet
cc7a869e3d threadsafe SeededRand 2014-12-23 08:26:24 -08:00
Brian Tiger Chow
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
Christian Couder
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
Jeromy
35e2338d65 update installation instructions and update usage to most recent 2014-12-19 19:25:19 +00:00
Juan Batiz-Benet
afd6680208 Merge pull request #438 from jbenet/bitswap-rounds
Bitswap rounds
2014-12-17 23:50:29 -08:00
Brian Tiger Chow
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
Jeromy
9328fbaf81 clean peerset constructor names 2014-12-17 23:44:46 -08:00
Brian Tiger Chow
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
Brian Tiger Chow
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
Brian Tiger Chow
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
Brian Tiger Chow
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