Skip to content
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

allow autonat v2 to dial all ips #542

Merged
merged 2 commits into from
May 3, 2023
Merged

allow autonat v2 to dial all ips #542

merged 2 commits into from
May 3, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Apr 15, 2023

Closes #536

autonat/autonat-v2.md Outdated Show resolved Hide resolved
@sukunrt sukunrt marked this pull request as ready for review April 16, 2023 12:58
autonat/autonat-v2.md Outdated Show resolved Hide resolved
}

message DialDataResponse {
bool accepted = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put the bytes into this protobuf? Then we wouldn't need to break the framing to send these bytes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would require memory of the order of 100kb for the protobufs on both ends, right?
The current version can be implemented using a smaller buffer.

I don't have good intuition here, do you think this is fine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marten-seemann friendly ping

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server is going to discard these bytes right away anyways. No point to allocate the space to put the bytes in the message. I agree with the initial design. (Sorry for the drive-by comment, I'll defer to whatever you all decide).

one can not validate the IP address of the requesting node.
Upon receiving a `DialDataRequest` message the client responds with
`DialDataResponse` message with a boolean `accepted` indicating if it accepted
the request. If `accepted` is `false`, the `DialRequest` is considered complete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client could also just reset the stream if it doesn't want to send that many bytes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am accepting this. This looks simpler to me. Even if we add a different cost for dial in future, say some POW like mechanism, the client can just reject the charge by resetting the stream.

Base automatically changed from autonat-v2-multi-addrs to autonat-v2 April 21, 2023 14:43
@sukunrt sukunrt mentioned this pull request Apr 27, 2023
Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Nit: I think it's spelled IP and not ip.

autonat/autonat-v2.md Outdated Show resolved Hide resolved
autonat/autonat-v2.md Outdated Show resolved Hide resolved
@sukunrt
Copy link
Member Author

sukunrt commented May 3, 2023

Nit: I think it's spelled IP and not ip.

oops, thanks!

@sukunrt sukunrt merged commit f6def9a into autonat-v2 May 3, 2023
@sukunrt sukunrt deleted the autonat-v2-ip branch May 3, 2023 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants