Repository navigation
Conversation
Both SetupConnection.flags and SetupConnection.Success.flags were described as "optional protocol features the client/server requires", which contradicts itself: a flag either side sets is a requirement for the connection, not an option. Every flag defined in chapters 5 and 6 is of that kind. Discussion: stratum-mining#238
The spec implied that a server rejects flags it cannot satisfy, but said nothing about bits that no protocol defines, and told the client only to "act accordingly" when the server sets flags of its own. Both silences leave a reachable state with no specified next step. Require the server to answer SetupConnection.Error, naming the bits, when the client sets a flag that is undefined for the requested protocol or that the server does not support. This is fail-closed and reuses the probe mechanism in 3.6.3, so a future flag can be added without a version bump: older servers reject it by name and the client retries without it. Require the client to close the connection when it cannot satisfy a server flag or the server set an undefined one. Discussion: stratum-mining#238
Member
Author
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.
follow-up to #225
replaces #238
The spec implied that a server rejects flags it cannot satisfy, but said nothing about bits that no protocol defines, and told the client only to "act accordingly" when the server sets flags of its own. Both silences leave a reachable state with no specified next step.
This PR requires the server to answer
SetupConnection.Error, naming the bits, when the client sets a flag that is undefined for the requested protocol or that the server does not support. This is fail-closed and reuses the probe mechanism in 3.6.3, so a future flag can be added without a version bump: older servers reject it by name and the client retries without it.The client is likewise required to close the connection when it cannot satisfy a server flag or the server set an undefined one.
"Optional" is dropped from the flags field descriptions, where it contradicted "requires" in the same sentence.