-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi: Introduce addrv2 and getaddrv2 messages.
This commit modifies the wire protocol by adding two new message types addrv2 and getaddrv2 and bumps the wire protocol version to 10. It does not introduce any new network address types and is intended to implement the minimum framework necessary to support easily adding new address types in future commits. These two new message types are intended to eventually replace their older counterparts, which are getaddr and addr respectively. A peer sending a getaddrv2 or addrv2 message with a protocol version less than 10 is in violation of the wire protocol and the peer is disconnected. Similarly, peers advertising a protocol version greater than or equal to 10 that send an addr or gettaddr message are in violation of the wire protocol and are disconnected. A getaddrv2 message is similar in structure and purpose to a getaddr message in that it has no payload and functions as a request for a peer to reply with an addrv2 message if it has addresses to share. An addrv2 message is similar in structure and function to an addr message with a few key differences: - Port is now encoded as a little endian value rather than big endian. - Timestamp is encoded as a 64 bit value rather than a 32 bit value. - A network address type field is now serialized with each address to indicate the length and type of the address it precedes. - A message with zero addresses is no longer serializable. - Addresses are serialized their most compact form, rather than always being encoded into a 16 byte structure. The address manager's public interface has also been modified so that addresses returned may be filtered by the maximum network address type supported by the protocol version of a peer. This allows the caller to easily indicate what types of addresses should be relayed to a specific peer while also keeping protocol versioning logic decoupled from the address manager's internal implementation.
- Loading branch information
Showing
25 changed files
with
1,232 additions
and
110 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.