-
Notifications
You must be signed in to change notification settings - Fork 139
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
Issue with flags checking and related roles behaviour #853
Comments
The remaining relevant todos in protocols are reported as github issues stratum-mining#853 stratum-mining#842
This one should be looked into as a priority before we push a new release. |
@xyephy this function: https://github.com/stratum-mining/stratum/blob/dev/protocols/v2/subprotocols/common-messages/src/setup_connection.rs#L88 Check if the passed flag in the For example in the case of the mining protocol these are the available flags: https://github.com/stratum-mining/sv2-spec/blob/main/05-Mining-Protocol.md#531-setupconnection-flags-for-mining-protocol So let's say that downstream require standard job As you can see this function handle only the mining protocol but also the job declaration protocol have flags. IMO this function try to be too smart. Should not try to extrapolate the meaning of the flags. It should only take 2 u32, 0s every bit without meaning (the last 29 for mining protocol the last 31 for job declaration protocol), XNOR every bit and if everything is 1 return true otherwise false. When the protocol do not define flags (for example template distribution protocol) we have 4 options:
I would go with 4 but I guess that no one want panics in the codebase so I listed also the other options. Footnotes
|
@xyephy Was this enough of info for you to get started on this? We have it planned for the next release ,so would appreciate if you can let us know how you're progressing with it? |
I'm finalising on the fix, the info given was helpful. |
Hey @xyephy We'd like to include this one in the next minor release, which we plan to ship this week, how are you progressing with this one? Ideally we'd need time to review it as well so it can be included in 1.0.1. |
@pavlenex I've pushed a PR #918, it can be reviewed and recommendations for any improvements are welcome. Apologies for the delay. |
hey @xyephy any progress here? @Shourya742 expressed interest in helping on this, so I'll co-assign him |
I have added the MG test for the flow to verify the fix. I will also be adding the corresponding connection changes in JDS to support checking the async flag. Currently, it just sends a hardcoded response without any validation. Progress can be tracked on the PR: #1035. |
before issue stratum-mining#853 was reported, JDS would simply support async jobs by default and completely ignore this flag. but checking this flag implies that JDS could either support async jobs or not, and that is what this commit does. a new `asyn_mining_allowed` parameter is introduced to the TOML config files, and that is used when: - checking for the flags of `SetupConnection` messages - responding to `AllocateMiningJobToken` messages
before issue stratum-mining#853 was reported, JDS would simply support async jobs by default and completely ignore this flag. but checking this flag implies that JDS could either support async jobs or not, and that is what this commit does. a new `asyn_mining_allowed` parameter is introduced to the TOML config files, and that is used when: - checking for the flags of `SetupConnection` messages - responding to `AllocateMiningJobToken` messages
before issue stratum-mining#853 was reported, JDS would simply support async jobs by default and completely ignore this flag. but checking this flag implies that JDS could either support async jobs or not, and that is what this commit does. a new `asyn_mining_allowed` parameter is introduced to the TOML config files, and that is used when: - checking for the flags of `SetupConnection` messages - responding to `AllocateMiningJobToken` messages
before issue stratum-mining#853 was reported, JDS would simply support async jobs by default and completely ignore this flag. but checking this flag implies that JDS could either support async jobs or not, and that is what this commit does. a new `asyn_mining_allowed` parameter is introduced to the TOML config files, and that is used when: - checking for the flags of `SetupConnection` messages - responding to `AllocateMiningJobToken` messages
before issue stratum-mining#853 was reported, JDS would simply support async jobs by default and completely ignore this flag. but checking this flag implies that JDS could either support async jobs or not, and that is what this commit does. a new `asyn_mining_allowed` parameter is introduced to the TOML config files, and that is used when: - checking for the flags of `SetupConnection` messages - responding to `AllocateMiningJobToken` messages
before issue stratum-mining#853 was reported, JDS would simply support async jobs by default and completely ignore this flag. but checking this flag implies that JDS could either support async jobs or not, and that is what this commit does. a new `asyn_mining_allowed` parameter is introduced to the TOML config files, and that is used when: - checking for the flags of `SetupConnection` messages - responding to `AllocateMiningJobToken` messages
In this todo! we see that the check_flags panics if used in any other protocol except
MininProtocol
. Indeed, this method is used inIsUpstream
trait, that does not have an extension (possibly empty) to theJobDeclaration
protocol which is implemented for JDSAs a result, apparently there is no way for the JDS to check the bit
REQUIRES_ASYNC_JOB_MINING
ofSetupConnection.flag
in JobDeclaration protocol, making the SRI slightly no specs compliant.The text was updated successfully, but these errors were encountered: