-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/utp #1789
Feat/utp #1789
Conversation
still WIP btw |
exciting! 👍 👏 |
useLocalAddr := true | ||
for _, p := range raddr.Protocols() { | ||
if p.Name == "utp" { | ||
useLocalAddr = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the lib problem? we need to fix it. in many situations people will not be able to open another port. they need to be able to specify the one port everything happens through.
> ipfs config Addresses.Swarm
[
"/ip4/0.0.0.0/tcp/4001",
"/ip4/0.0.0.0/udp/4003/utp"
]
> ipfs daemon
Initializing daemon...
Swarm listening on /ip4/10.0.1.12/tcp/4001
Swarm listening on /ip4/108.54.113.161/tcp/37304
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/127.94.0.1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready no utp. :( with debug logs i see:
it's getting filtered out. fixed. wrong binary. :( |
@@ -305,7 +294,7 @@ func (s *Swarm) dial(ctx context.Context, p peer.ID) (*Conn, error) { | |||
remoteAddrs = addrutil.Subtract(remoteAddrs, ila) | |||
remoteAddrs = addrutil.Subtract(remoteAddrs, s.peers.Addrs(s.local)) | |||
|
|||
log.Debugf("%s swarm dialing %s -- local:%s remote:%s", s.local, p, s.ListenAddresses(), remoteAddrs) | |||
log.Errorf("%s swarm dialing %s -- local:%s remote:%s", s.local, p, s.ListenAddresses(), remoteAddrs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should stay as debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, its totally an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a statement that is always executed. and it doesnt have an error, it's just informative. i already switched it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, i guess you missed the sarcasm. I'll use tags next time
Perf is not good. i'm getting <1MB/s with ipfs cat on the same machine. Also CPU is pegged and RAM is ~300MB, though the file is 200MB, and only have 50MB of it... finished:
that's 0.77 MB/s |
in another run, with an isolated network of 5 nodes:
but
is just completely stuck. daemon responds to other queries though.
so neither of these list and yet they're all connected.
this appears to be either bitswap being incredibly stupid, or the transport totally failing. and yes, an |
|
657809f
to
d3e9792
Compare
d3e9792
to
128624a
Compare
Are the nodes that seem to stall, purely receiving at that time on utp. That is to say, are they only calling utp.Conn.Read? No writes? |
@anacrolix There may be interleaved reads and writes. we do duplex communication over the same pipe |
@anacrolix no, they would be writing too, at least at some point. other things happening would cause samll amts of data to be written to all nodes (dht random queries for bootstrapping, bitswap wantlist updates, etc) |
this stalling may be more a problem in ipfs than in utp. i'm not sure. |
430b9df
to
e75c69a
Compare
@@ -265,3 +209,100 @@ func MultiaddrNetMatch(tgt ma.Multiaddr, srcs []ma.Multiaddr) ma.Multiaddr { | |||
} | |||
return nil | |||
} | |||
|
|||
type ProtoDialer interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbenet I've taken and made the dialers an interface, just like you always wanted!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might belong somewhere better than here though, and the interface probably could use some tweaks, but this is the composition that i'm wanting.
e75c69a
to
7177615
Compare
I added a utp option to iptb so you can easily generate a testnet using utp:
|
7177615
to
1169398
Compare
@jbenet how did you set up the iptb cluster when you reproduced the hangs? |
8c59200
to
096f5ca
Compare
@whyrusleeping i just set them up normally, and then changed all the addresses manually. |
they were all able to talk to each other though |
so you set them to bootstrap to eachother? |
df5677b
to
4be92ef
Compare
} | ||
|
||
// get the local net.Addr manually | ||
la, err := manet.ToNetAddr(laddr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this before the Listen
. if errors, saves the listener. also this is currently wrong as the listener will not be closed if this errors here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, i do not think the transport should start listening just by being created. reuseport
should allow listening after, (yes after a dial has opened on the same port).
License: MIT Signed-off-by: Jeromy <[email protected]>
860b5ca
to
c1ef091
Compare
c1ef091
to
f1dbbed
Compare
License: MIT Signed-off-by: Jeromy <[email protected]>
f1dbbed
to
9b76adc
Compare
@jbenet We can call the things something other than transports. Otherwise, how do you want the interface to look? |
@jbenet instead of going back and forth in comments for this, lets just have a hangout and hash it out |
It looks like the CR got stalled. Will 0.4.0 ship first? The sooner this happens, the sooner pending modularizations (commands/files, gateway, go-libp2p, cmd/*) can happen? Even if modularization is bottlenecked by gx pathing, this has still smaller decision tree than utp interface's? |
I think we did hash it out-- just needs rebasing over the new transports? |
yeah, this is going to go into libp2p, i have a PR ready, doesnt look like i've pushed it yet. |
Which means, the remaining bottleneck for 0.3.10 is ipfs-update? |
yeap. ipfs-update is all thats in the way of 0.3.10. i'm pushing pretty much everything else into 0.4.0 |
Implement utp support