-
Notifications
You must be signed in to change notification settings - Fork 38.7k
BIP 0031: pong message #1081
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
BIP 0031: pong message #1081
Conversation
|
This is intended to supercede pull request #932, for the following minor reasons:
and under the principle of making code self-documenting...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the nonce optional, if you don't want a pong?
|
Independent, yes, but where is a better place for version information than version.{h,cpp}? It is an odd policy that the "version" module excludes certain classes of version information and not others. That seems to violate the Principle of Least Surprise. |
|
Agree, but calling them both "_VERSION" will be very confusing. |
|
No more confusing than the existing PROTOCOL_VERSION vs. CLIENT_VERSION, each with the _VERSION suffix (which I argue is not confusing at all, but rather a logical naming scheme for each). If it appeals to one's sense of symmetry, we can move PROTOCOL_VERSION to version.* as well. |
|
IMO, version.h should contain version information for the current client, that will change over time. I agree that feature-specific thresholds that will be "written in stone forever" should go somewhere else. Maybe there will eventually be enough for a bip_versions.h :-) (if we tracked down other magic version numbers we could already do so) Another suggestion would be to rename it to |
|
No, we don't need multiple version.* modules in the tree. |
|
To me, mixing the client version (metadata about the project you're compiling) and the network version (a property of the protocol being implemented) in the same module is wrong. It's like having a source file in firefox that encdes both information about the firefox browser version and the differences between HTML4 and HTML5. The fact that both are called version and have a similar number scheme is an historic artifact, and I would prefer to get them separated rather sooner than later. Maybe remove the moniker '_VERSION' from all protocol-related code, and simply call it "protocol 60000". I agree that we need nice constants for magic protocol switches, but they do not belong in version.h. Really. |
|
This is being WAY overthought.
It is not a historical accident that the protocol version is called "PROTOCOL_VERSION". The naming precisely describes its purpose, and changing that name would be detrimental to understanding by outside reviewers. It is just bonkers to remove the "_VERSION" word from all version-related constants in bitcoin unrelated to client version. That is creating more problems than it is solving. |
|
You can use the exact same argument that this causes confusion for "outside |
|
Helpfully, there is a comment for outside reviewers in the code I added, solving this imagined problem. |
|
Certainly, a comment saying "This relates to the protocol version being used in P2P connections, and is independent from the client version" is enough to make it acceptable (I see no such comment right now, though...). Still, such constants belong in the networking code, imho. |
Add a pong message that is sent in reply to a ping. It echoes back a nonce field that is now added to the ping message. Send a nonce of zero in ping messages. Original author: Mike Hearn @ Google Modified Mike's change to introduce a mild form of protocol documentation in version.h.
… file. * move PROTOCOL_VERSION to version.h * move CLIENT_VERSION* to version.h, make available past cpp stage * clearly separate client, network version portions of version.h
|
Updated to add such comments, and further illustrate the usage. |
|
Other magic protocol version constants:
|
stored in version.h. Also, a minor CAddress code reformat while we're in there, fixing some incorrect indentation.
|
added, along with 209 |
|
Meh, ACK. |
|
Reminder to bump our own PROTOCOL_VERSION to 60001 too... |
|
@luke-jr yes, that will come in a separate cover |
BIP 0031: pong message
Remove OP_RETURN based replay protection (REQ-6-1, Aug 1st '17 HF)
Add a pong message that is sent in reply to a ping. It echoes back a nonce
field that is now added to the ping message. Send a nonce of zero in ping
messages.
Original author: Mike Hearn @ Google
Modified Mike's change to introduce a mild form of protocol documentation in
version.h.