Commit Graph

56 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
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
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00
Juan Batiz-Benet
e908effb4b AddrManager: use addr manager with smarter TTLs
This addr manager should seriously help with the addrsplosion
problem.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
29178e3c49 fix(bitswap/network/ipfs) ignore self as provider 2015-02-01 22:08:48 -08:00
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
Juan Batiz-Benet
feb6d34134 bitswap/net: race fix in peers iteration 2015-01-29 01:16:45 -08:00
Brian Tiger Chow
afd3333cab optimization(bitswap) return connected peers as providers 2015-01-28 22:57:33 -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
6fedf259eb remove prefix logger 2015-01-24 00:30:56 -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
c057cea649 addr-explosion mitigated adding
mitigated adding our own addresses where received
from peers

see #573
2015-01-16 11:38:46 -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
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
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
a225568ff6 style(bitswap) public methods at top 2014-12-23 09:13:17 -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
Juan Batiz-Benet
41751b4938 Integrated new network into ipfs 2014-12-16 14:47:29 -08:00
Jeromy
c2b497e315 switch over to using sendMessage vs sendRequest 2014-12-05 20:53:32 +00:00
Jeromy
4cc1780705 fix issues in merkledag 2014-12-05 20:53:31 +00:00
Brian Tiger Chow
3663eef5ac refctor(bitswap/network) replace Network interface with Dialer interface 2014-11-15 02:10:53 -08:00
Brian Tiger Chow
154cf4af75 refactor(bitswap/network) rename -> BitSwapNetwork
remove 'adapter' concept
instead, describe the component as the bitswap network

it's still an adapter, but it's just not necessary to describe it as
such
2014-11-15 02:10:53 -08: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
c60d011764 fix(exchange) add context to DialPeer 2014-11-05 10:04:20 -08:00
Jeromy
d92db12460 lots of logging 2014-10-26 00:45:40 +00:00
Jeromy
ab7491f809 logging, logging, and some minor logging 2014-10-25 14:50:22 -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
a5a7d99860 meant to call net.DialPeer 2014-10-18 04:28:24 -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
Juan Batiz-Benet
338b037238 clean up and add inet.Network to bitswap
new Service interface
2014-10-10 20:43:04 -07:00
Brian Tiger Chow
e2a9c5de00 feat(net:service, routing) remove error return value 2014-09-24 23:35:36 -04: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
Brian Tiger Chow
39ad222da9 fix(bitswap) keep interface the same
changing the bitswap interace breaks tests and makes things a bit
difficult going forward. I think I have a temporary solution to replace
the async method.

this commit partially reverts changes from:

ec50703395098f75946f0bad01816cc54ab18a58

ec50703395
2014-09-22 04:06:18 -07:00
Juan Batiz-Benet
8112fae7b3 get bitswap working with dht
@perfmode using non-async version as apparently there's
a bug in async. will look into it.
2014-09-22 04:06:18 -07:00