#1 add ip_bytes to Property for raw-byte IPv4 encoding#33
Open
VasilevNStas wants to merge 1 commit into
Open
Conversation
Property.ip (field 4) encodes the backing Node's address as a dotted string, inconsistent with Peer.ip and Welcome.ip which use four raw bytes in network byte order. Adds bytes ip_bytes = 9 carrying the same encoding as Peer.ip, marks string ip as deprecated pending migration by all consumers. Field 9 is safe: after the addition of sni = 8 (a67706a), the next available field in Property is 9, and no reserved ranges block it. Closes APN-Network#1
Contributor
Author
|
@yegor256 plz review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Property.ip(field 4) encodes the backing Node's address as a dotted string, the only IPv4 field in the four proto files that does not use raw bytes.Peer.ip,Welcome.ip, andWelcome.homeall use four raw bytes in network byte order. The inconsistency forces clients to switch between two representations when correlating Property entries with Peer entries and Ping.canaries keys.Changes
bytes ip_bytes = 9to thePropertymessage, carrying the address in the same raw-byte encoding asPeer.ip.string ip(field 4) as deprecated in its comment; it stays on the wire until all consumers — iOS, Android, Huawei, and Node — have migrated. At that point a follow-up commit can reserve field 4.Ping.canariesdocs to referencePeer.iporProperty.ip_bytesas the address source.Field number note
Field 9 is used instead of 8 because field 8 was assigned to
sni(commit a67706a, Jun 15) after the original PR #22 was opened. Wire compatibility with PR #22's approach is preserved; only the field number changed.Validation
No build or test infrastructure is present in the repository (see issue #3), so wire-format correctness was verified by reading all four proto files and confirming that
ip_bytes = 9does not collide with any existing or reserved field number in the Property message.Closes #1