Skip to content
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

[WIP] clarify BIP152 sendcmpct message exchange #461

Closed
wants to merge 1 commit into from

Conversation

jnewbery
Copy link
Contributor

@jnewbery jnewbery commented Oct 6, 2016

@TheBlueMatt - as discussed, this PR slightly clarifies the BIP 152 text:

  • version must always be set to 1 (whether mode is set to 0 or 1)
  • sendcmpct is reciprocal

@jnewbery jnewbery changed the title clarify BIP152 sendcmpct message exchange [WIP] clarify BIP152 sendcmpct message exchange Oct 11, 2016
@jnewbery
Copy link
Contributor Author

#423 is a PR to update BIP 152 to include version 2 compact blocks (compact blocks with segwit).

Marking this PR as WIP for now. I may add suggested changes to #423 .

# Upon receipt of a "sendcmpct" message with the first integer set to 0, the node SHOULD NOT announce new blocks by sending a cmpctblock message, but SHOULD announce new blocks by sending invs or headers, as defined by BIP130.
# Upon receipt of a "sendcmpct" message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.
# The second integer SHALL be interpreted as a little-endian version number. Nodes sending a sendcmpct message MUST currently set this value to 1. Upon receipt of a "sendcmpct" message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.
# Upon receipt of a "sendcmpct" message with the first integer set to 1, if the node wishes to use high-bandwidth compact block mode, it MUST respond with a "sendcmpct" message with the first integer set to 1. Upon receipt of a "sendcmpct" message with the first integer set to 0, if the node wishes to use low-bandwidth compact block mode, it MUST respond with a "sendcmpct" message with the first integer set to 0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to imply, to me, that a node should wait for a sendcmpct message before sending its announce, which it should not.

# Upon receipt of a "sendcmpct" message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.
# The second integer SHALL be interpreted as a little-endian version number. Nodes sending a sendcmpct message MUST currently set this value to 1. Upon receipt of a "sendcmpct" message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.
# Upon receipt of a "sendcmpct" message with the first integer set to 1, if the node wishes to use high-bandwidth compact block mode, it MUST respond with a "sendcmpct" message with the first integer set to 1. Upon receipt of a "sendcmpct" message with the first integer set to 0, if the node wishes to use low-bandwidth compact block mode, it MUST respond with a "sendcmpct" message with the first integer set to 0.
# If the node has sent *and* received "sendcmpct" with the first integer set to 1, the node SHOULD announce new blocks by sending a cmpctblock message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to imply, to me, that you have to send a sendcmpct message with a 1 in order to announce using cmpctblocks, which isnt true, you only need to receive one.

@luke-jr
Copy link
Member

luke-jr commented Dec 15, 2016

What's the status here?

@jnewbery jnewbery closed this Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants