Commit Graph

110 Commits

Author SHA1 Message Date
Jeromy
47cd70fa7d fix same test in swarm
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 16:15:50 -07:00
Jeromy
b60f494c1e fix race condition in notifications test
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 14:38:13 -07:00
Juan Benet
13d49d9abb Merge pull request #1471 from heems/master
add transport from netsim and bandwidth to mocknet
2015-07-19 23:36:25 -07:00
Jeromy
a4efe42567 make timing tests actually not run under CI
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-19 16:11:06 -07:00
Karthik Bala
0e597b3ae6 add transport logic to mocknet
License: MIT
Signed-off-by: Karthik Bala <karthikbala444@gmail.com>
2015-07-15 19:36:15 -07:00
Juan Batiz-Benet
cdb18d2833 Merge pull request #1473 from ipfs/godep-peerstream
update go-peerstream to newest version
2015-07-14 21:29:38 -07:00
Jeromy
a9c971fdbb update go-peerstream to newest version
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 16:23:30 -07:00
Jeromy
191ac62c12 making the daemon shutdown quicker
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 14:04:56 -07:00
rht
3daf749daa Make sure process context is set last
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-05 09:35:36 +07:00
rht
0ceac5ded9 Use WithContextAndTeardown whenever possible
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-05 09:19:06 +07:00
rht
007a12e7ef Change Process interface into object variable
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-04 22:50:23 +07:00
rht
330b213777 Replace ctxgroup.ContextGroup -> goprocess.Process
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-04 22:50:23 +07:00
Juan Batiz-Benet
0d42a6a7bc Merge pull request #1433 from ipfs/fix/addr-filter
add filters from config to addr filter in swarm
2015-07-02 17:00:36 -07:00
Lars Gierth
9c30b85180 swarm: fix peers_total metric
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-07-01 21:59:08 +02:00
Jeromy
7cc73f7b86 add command to manipulate address filters and a sharness test for them
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-30 18:25:34 -07:00
Jeromy
e7fd57f69a add filters from config to addr filter in swarm
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-30 15:03:56 -07:00
Lars Gierth
8b164f9e39 swarm: export ipfs_p2p_peers_total metric
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-06-30 16:32:46 +02:00
Juan Batiz-Benet
59d6a9a19c fix swarm notif tests
they were failing intermittently

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-27 00:41:19 -07:00
Juan Batiz-Benet
f796615e10 mock: fix notif test
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-27 00:18:12 -07:00
Juan Batiz-Benet
e37fefdfd3 daemon option to optionally disable secio
This commit adds an option to turn off all encryption. This is a mode
used for tests, debugging, achieving protocol implementation interop,
learning about how the protocol works (nc ftw), and worst case
networks which _demand_ to be able to snoop on all the traffic.
(sadly, there are some private intranets like this...). (We should
consider at least _signing_ all this traffic.)

Because of the severity of this sort of thing, this is an
all-or-nothing deal. Either encryption is ON or OFF _fully_.
This way, partially unencrypted nodes cannot be accidentally left
running without the user's understanding. Nodes without encrypted
connections will simply not be able to speak to any of the global
bootstrap nodes, or anybody in the public network.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Jeromy
0bf6b39caf filter incoming connections and add a test of functionality
- add extra check to dialblock test
- move filter to separate package
- also improved tests
- sunk filters down into p2p/net/conn/listener

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-23 01:30:16 -07:00
Jeromy
fbab2a7273 broke filters out into a struct
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-23 01:29:29 -07:00
Jeromy
e01f8e4f22 add in basic address dial filtering
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-23 01:29:29 -07:00
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
rht
ac7edddb94 Run 'gofmt -s -w' on these files 2015-05-19 06:11:15 +07:00
Juan Batiz-Benet
b84fa2b493 net/p2p + secio: parallelize crypto handshake
We had a very nasty problem: handshakes were serial so incoming
dials would wait for each other to finish handshaking. this was
particularly problematic when handshakes hung-- nodes would not
recover quickly. This led to gateways not bootstrapping peers
fast enough.

The approach taken here is to do what crypto/tls does:
defer the handshake until Read/Write[1]. There are a number of
reasons why this is _the right thing to do_:
- it delays handshaking until it is known to be necessary (doing io)
- it "accepts" before the handshake, getting the handshake out of the
  critical path entirely.
- it defers to the user's parallelization of conn handling. users
  must implement this in some way already so use that, instead of
  picking constants surely to be wrong (how many handshakes to run
  in parallel?)

[0] http://golang.org/src/crypto/tls/conn.go#L886
2015-05-12 05:54:09 -04:00
Jeromy Johnson
c43b5c921d Update swarm_dial.go 2015-04-30 13:19:56 -07:00
Jeromy
194dc2bf7b bring some errors that were being hidden in the dial sequence to the surface 2015-04-28 13:57:15 -07:00
Juan Batiz-Benet
140cd1fd1b remove debugerrors
We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
2015-04-20 00:35:35 -07:00
Jeromy
30ee01f19d increase window size for yamux streams 2015-04-16 20:56:40 -07:00
Jeromy
db79e89ae7 log listeners dying as at least a warning 2015-04-11 18:21:22 -07:00
Juan Batiz-Benet
f1566e2327 reuseport: env var to turn it off
reuseport is a hack. It is necessary for us to do certain kinds of
tcp nat traversal. Ideally, reuseport would be available in go:

  https://github.com/golang/go/issues/9661

But until that issue is fixed, we're stuck with this. In some cases,
reuseport is strictly a detriment: nodes are not NATed. This commit
introduces an ENV var IPFS_REUSEPORT that can be set to false to
avoid using reuseport entirely:

  IPFS_REUSEPORT=false ipfs daemon

This approach addresses our current need. It could become a config
var if necessary. If reuseport continues to give problems, we should
look into improving it.
2015-04-08 00:19:12 -07:00
Jeromy
2c8cb9fc75 bandwidth metering on streams
humanize bandwidth output

instrument conn.Conn for bandwidth metrics

add poll command for continuous bandwidth reporting

move bandwidth tracking onto multiaddr net connections

another mild refactor of recording locations

address concerns from PR

lower mock nodes in race test due to increased goroutines per connection
2015-03-31 19:58:08 -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
Juan Batiz-Benet
1d5b903611 added cancel func calls previously ignored 2015-03-07 09:31:46 -08: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
Jeromy
dfdf346b22 fix weird race condition in goprocess that caused a few panics 2015-02-19 20:01:19 -08:00
Juan Batiz-Benet
5171d3df6b p2p/net/conn: respect context on dialing
We were half-way with this. there's no way for net.Dialers
to respect contexts, so we have to let the dial finish in
the background.
2015-02-11 09:12:15 -08:00
Juan Batiz-Benet
1811f1efac ctx.Done fixes
thanks @whyrusleeping for finding these.
2015-02-09 23:18:23 -08:00
Juan Batiz-Benet
91a79bc203 ratelimiter: fixing rate limiter use
Use of the ratelimiter should be conscious of the ratelimiter's
potential closing. any loops that add work to ratelimiter
should (a) only do so if the rate limiter is not closed,
or (b) prevent limiter while work is added
(i.e. use limiter.Go(addWorkHere))
2015-02-06 10:59:03 -08:00
Juan Batiz-Benet
cc6a78419b test/mocknet: this test fails on CI sometimes 2015-02-03 08:02:25 -08:00
Juan Batiz-Benet
10cd499a8b cmds/swarm connect had broken 2015-02-03 05:51:31 -08: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
6b4664fc8b p2p/net/swarm: permute addrs in rate limited dials
so that we dont get stuck dialing bad addrs first always.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
793048d310 p2p/net/swarm: rate limit dials. max of 10 addrs at a time.
This will mitigate the fd explosion, but slow down dials majorly
as any peer with more addresses than the rate limit will have
to wait a whole dial timeout (~15s)
2015-02-02 21:04:14 -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
7c7ec14109 p2p/net/conn: log conn lifetime event 2015-02-01 22:08:48 -08:00
Juan Batiz-Benet
fc78f20093 p2p/conn: expose io.Closer interface 2015-02-01 06:35: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
df0967d6ee p2p/net: network interface Listen func
network interface now allows setting Listeners after the fact.
This is useful to create the network and start listening as
separate steps. And to keep the network up to date on new
addresses the node might have to listen to.
2015-01-30 06:51:29 -08:00