#1 add ip_bytes to Property for raw-byte IPv4 encoding#22
Open
bibonix 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 = 8 carrying the same encoding as Peer.ip, marks string ip as deprecated pending migration by all consumers. Closes APN-Network#1
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.
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, and Welcome.home all 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.
This change adds bytes ip_bytes = 8 to the Property message, carrying the address in the same raw-byte encoding as Peer.ip. The existing string ip field (field 4) is marked deprecated in its comment; it stays on the wire until all consumers — iOS, Android, Huawei, and Node — have migrated to ip_bytes. At that point a follow-up commit can reserve field 4.
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 = 8 does not collide with any existing or reserved field number in the Property message.
Closes #1