Commit Graph

49 Commits

Author SHA1 Message Date
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
Jeromy
829b88420e explicitly set bitswap message fullness 2015-05-21 03:08:31 -04:00
Jeromy
6bf33ad62f WIP: super awesome bitswap cleanup fixtime 2015-05-21 03:08:31 -04:00
Jeromy
a159e6825c implement peermanager to control outgoing messages
Also more refactoring of bitswap in general, including some perf
improvements and eventlog removal.

clean up, and buffer channels

move some things around

correctly buffer work messages

more cleanup, and improve test perf

remove unneccessary test

revert changes to bitswap message, they werent necessary
2015-05-21 03:08:30 -04:00
Jeromy Johnson
0324b4b283 mild refactor of bitswap 2015-05-06 01:35:57 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01: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
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -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
Juan Batiz-Benet
8fb5cf9578 swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
e2698a8733 net -> p2p/net
The net package is the next to move. It will be massaged
a bit still to fix the Network / "NetworkBackend" conflict.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
89f5cd4c94 introducing p2p pkg
I think it's time to move a lot of the peer-to-peer networking
but-not-ipfs-specific things into its own package: p2p.
This could in the future be split off into its own library.
The first thing to go is the peer.
2015-01-02 08:46:45 -08:00
Brian Tiger Chow
0172e4f2bb style(testutil) rename testutil.Peer -> testutil.Identity
cc @jbenet
2014-12-24 09:59:24 -05:00
Brian Tiger Chow
237e594a8f don't link when creating network client. rely on caller 2014-12-24 09:31:19 -05:00
Brian Tiger Chow
ca32a83394 wip with DHT
@whyrusleeping @jbenet this is a WIP with the DHT.

wip

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	epictest/addcat_test.go
	exchange/bitswap/testnet/peernet.go
	exchange/bitswap/testutils.go
	routing/mock/centralized_server.go
	routing/mock/centralized_test.go
	routing/mock/interface.go

fix(routing/mock) fill in function definition
2014-12-24 09:31:19 -05:00
Brian Tiger Chow
6da57c6764 feat(bitswap/testnet) impl a version of bitswap testnet that uses mockpeernet under the hood
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-24 09:31:18 -05:00
Brian Tiger Chow
85ce94c510 refactor(bitswap/testnet) rename to virtual
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-24 09:31:18 -05:00
Brian Tiger Chow
d390e31c11 refactor(bitswap/testnet) extract interface in prep for mockpeernet version
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-24 09:31:18 -05:00
Brian Tiger Chow
6cdb4c23b4 pass peer into testnet adapter method 2014-12-24 09:31:18 -05:00
Brian Tiger Chow
e017d6edc6 refactor(bitswap/testnet) slim down interface
so it'll be easier to create another implementation using the new
mocknet
2014-12-24 09:31:17 -05:00
Brian Tiger Chow
c933d439b7 misc docs and fmting 2014-12-24 09:31:17 -05: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
60f3a874c2 feat(bitswap/network) expose peerstore 2014-12-23 09:14:54 -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
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
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
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
d53deebada wire GetBlocks into blockservice 2014-12-05 20:53:26 +00:00
Brian Tiger Chow
2bc82adfae style(bitswap) rename Adapter -> BitSwapNetwork for clarity 2014-11-15 02:10:52 -08:00
Brian Tiger Chow
23096de3c4 fix(net) pass contexts to dial peer 2014-11-05 10:04:20 -08:00
Brian Tiger Chow
cebeff43b9 style(bitswap/message) rename method -> AddBlock
to emphasize idempotence
2014-10-27 21:58:21 -07:00
Juan Batiz-Benet
9ca87fbb93 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
1555ce7c48 bitswap dials peers
Important bugfix. Otherwise bitswap cannot message peers
the node has not connected to yet :(
2014-10-18 04:28:23 -07:00
Jeromy
6e0cfb3273 removed error from return type of blocks.NewBlock() 2014-10-07 20:46:01 +00:00
Brian Tiger Chow
0e494690b3 feat(bitswap:network) propagate errors up the stack
Rather than pushing errors back down to lower layers, propagate the
errors upward.

This commit adds a `ReceiveError` method to BitSwap's network receiver.

Still TODO: rm the error return value from:

    net.service.handler.HandleMessage

This is inspired by delegation patterns in found in the wild.
2014-09-24 23:35:36 -04:00
Jeromy
c044d9c32e move mock routing tests to proper directory 2014-09-23 18:23:46 -04:00
Jeromy
414ff34194 change back to using Client method 2014-09-23 18:23:46 -04:00
Jeromy
c45cc8c448 implement a mock dht for use in testing 2014-09-23 18:23:46 -04:00
Brian Tiger Chow
2179b5d77b fix(bitswap:testnet) Provide takes ctx 2014-09-22 04:06:18 -07:00
Brian Tiger Chow
7d62be76ad chore(bitswap) cleanup 2014-09-22 04:06:18 -07:00
Brian Tiger Chow
88f5be3f0d test(bitswap:testnet) shuffle the providers
to avoid letting client rely on order for correctness
2014-09-22 04:06:16 -07:00
Brian Tiger Chow
57e088bbff fix(bitswap:testnet) use peer.Map 2014-09-22 04:06:15 -07:00
Brian Tiger Chow
a8a7caa088 refac(bitswap:testnet) give testnet its own package 2014-09-22 04:06:15 -07:00