-
Notifications
You must be signed in to change notification settings - Fork 386
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
Modify NetAddress Enum naming #2358
Comments
Sorry I missed this before the long weekend. I'm not sure that SocketAddress is right here - a socket address is the address of your socket, and it wouldn't be unreasonable to call a named pipe or even an onion address (with the right API) a "socket address". If we want to be overly precise I believe the proper naming would be "TCPv4" and "TCPv6" as those are the direction protocols in use here (and the type of socket address). |
Yeh, if they are not real sockets and are protocols, I think |
Sure if you want, I'm not super convinced its confusing to users and worth changing, but if you feel strongly about it feel free! |
I think it's actually less confusing to users to stick with IPv4 and IPv6. |
The reason is here |
I wonder if some of the confusion isn't enum/variant mismatch - the enum is really a sockaddr in the traditional sense, the variants just describe the different potential types of socket addresses. Would you be happy simply renaming the enum, as a socket address if type ipv4 makes sense to me. |
Closing this for inactivity - I'm definitely happy to keep discussing this (any thoughts on my last suggestion above?) but it seems the consensus outside of the reporter was that its not super confusing as-is, so doesn't seem worth keeping open waiting for the OP to respond. |
Sorry about the delay, I just had a trip and forgot the thread, and wait for someone to own this project to decide the final result. @TheBlueMatt Did you suggest I don't understand what you mean by what naming you accept. For me, If you have a final result better than IPv4, I can modify it. |
No problem!
My suggestion was mostly to rename the enum itself, not just the variants. So eg the enum would be |
Your solution looks good to me. Would we set a timer here? if there is no other voice and I can prepare the PR for this.
|
|
Good, I think it is good to implement now. 😃 pub enum SocketAddress {
/// An IPv4 address/port on which the peer is listening.
TcpIpV4 { .. },
/// An IPv6 address/port on which the peer is listening.
TcpIpV6 { .. },
/// An old-style Tor onion address/port on which the peer is listening.
///
/// This field is deprecated and the Tor network generally no longer supports V2 Onion
/// addresses. Thus, the details are not parsed here.
OnionV2([u8; 12]),
/// A new-style Tor onion address/port on which the peer is listening.
///
/// To create the human-readable "hostname", concatenate the ED25519 pubkey, checksum, and version,
/// wrap as base32 and append ".onion".
OnionV3 { .. },
/// A hostname/port on which the peer is listening.
Hostname { .. },
} |
Hi there,
I have a proposal.
IPv4 socket addresses consist of an IPv4 address and a 16-bit port number, as stated in IETF RFC 793
It may be good to use
SocketV4
andSocketV6
here, and also the same naming in Rust std SocketAddrrust-lightning/lightning/src/ln/msgs.rs
Lines 745 to 759 in 74a9ed9
If this proposal is good, I am happy to do this and also #2183, #2056 at the same time. Some these are implemented in our project.
https://github.com/kuutamolabs/lightning-knd/blob/e5f05755be1c702c56b469964c7d9586bce15e5d/api/src/lib.rs
The text was updated successfully, but these errors were encountered: