-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
autorelay #5785
autorelay #5785
Conversation
9d4cfee
to
3700c51
Compare
Where is autorelay actually being enabled? I don't see any new options |
it's enabled by libp2p when relay is enabled and you pass the new |
Presumably we do want an option in ipfs to enable or disable it, instead of unconditionally enabling. |
options in ipfs/go-ipfs-config#21 |
// setup routing service | ||
r, err := routingOption(ctx, host, n.Repo.Datastore(), n.RecordValidator) | ||
if err != nil { | ||
return err |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
edit: bah humbug. There's no point in introducing an arbitrary dependency to block a really, frickin, awesome feature just because I'm grumpy about something the user will never see. |
The libp2p refactoring is still on, but I don't think it will change the user interface -- so we might as well get the feature out first! |
added autorelay gating with config option. |
instantiated the autonat service as well. |
@Stebalien this is complete feature-wise, take another look? |
d7a7386
to
ab07fe3
Compare
rebased on master. |
This patch should be able to avoid the routing option dance by always using the libp2p option. We'd need to modify the mock host constructor (a cleaner solution would be to add a Host (constructor) option to libp2p itself but that may be overkill given that we're planning on changing this all up). |
RelayHost is an actual relay, while AutoRelayHost is a host that connects to relays and advertises relay addrs (when NATed).
Well, the routing is necessary for auto relay, but there is no other explicit option. Perhaps we should add one.
I guess we can do that. We'll need the option for explicit autorelay though, otherwise it will be unconditionally enabled. |
Added explicit option in libp2p/go-libp2p#500; we'll have to bubble up, and also merge libp2p/go-libp2p#495 |
Actually, we can totally test this (I think). We can't simulate NATs but we can, carefully, configure our transports:
Think that will work? |
there are still some obsene delays involved; there is about a 90s delay until the autonat detection boots and fires, which we don't have a way to configure in sharness. |
Honestly, I'm fine just having a really slow test for now. We can mark it as EXPENSIVE. We just really should have something. (we really need to get rid of those delays but we'll probably need an event system to do that) |
ok, let me cook up a ridiculously slow sharness test then -- how do i mark as expensive? |
(take a look at the add-and-cat tests). |
So I've cooked up a test as you suggested, but unfortunately it can't work: autorelay only advertises public addresses and there are no public addresses in my NATed laptop :( |
This is |
Maybe but probably not given that go tends to make raw syscalls. We could also use a syscall filter. However... we could test this from go with a plugin. That is, we could drop in a special plugin that modifies go-multiaddr-net's Unroutable/Private network variables on load. Thoughts? Is that even possible? |
Status: Blocked on at least demonstrating that this works (even if we can't write a test that runs on CI). |
I have confirmed that autorelay works with manual testing. Transcript:
|
Steps to reproduce:
|
dad0fa5
to
e8a94b6
Compare
we also need to update go-libp2p-autonat-svc to 1.0.4 for go-libp2p 6.0.29 (once this has bubbled up). |
…utorelay License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
PeerHost is now initialized before calling it. License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>
e8a94b6
to
526d619
Compare
Updates the node construction to automatically construct a routed host and enable autorelay.
Note that instances of the autonat service are required to be (passively) discovered in the network for the autorealy functionality to test for NAT presence, before advertising relay addresses.
This needs to run in the boostrappers and a plus if it is available in other public hosts, so an option to enable it is required.
Depends on
Fix Host/Service interface design libp2p/go-libp2p#467TBD: