-
Notifications
You must be signed in to change notification settings - Fork 130
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
Enhance SetupConnection Handling and Implement Job declaration Flag Checks #1035
Conversation
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
57f8ffc
to
4ff0ca3
Compare
@Shourya742 could you please tide up the commit history? |
Ah, I'm not sure if we should do that. This PR is based on the remaining tasks left from one of the stale PRs (#918). I'm hesitant to undermine the previous contributor's commit. |
4ff0ca3
to
8d10d6d
Compare
@jbesraa made the commits modular and relevant to the context. Please review and suggest any changes. |
8d10d6d
to
178991b
Compare
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.
Looks good. Just added two nits.
Could you also please take out the Cargo.lock
file changes?
test/message-generator/mock/job-declarator-mock-invalid-flag.json
Outdated
Show resolved
Hide resolved
test/message-generator/test/job-declarator-flag-test/job-declarator-flag-test.json
Outdated
Show resolved
Hide resolved
test/message-generator/test/job-declarator-flag-test/job-declarator-flag-test.json
Outdated
Show resolved
Hide resolved
test/message-generator/mock/job-declarator-mock-invalid-flag.json
Outdated
Show resolved
Hide resolved
test/message-generator/mock/job-declarator-mock-invalid-flag.json
Outdated
Show resolved
Hide resolved
protocols/v2/subprotocols/common-messages/src/setup_connection.rs
Outdated
Show resolved
Hide resolved
protocols/v2/subprotocols/common-messages/src/setup_connection.rs
Outdated
Show resolved
Hide resolved
protocols/v2/subprotocols/common-messages/src/setup_connection.rs
Outdated
Show resolved
Hide resolved
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.
this PR has a solid foundation and demonstrates some great work by @Shourya742
but we still need to improve some things before we are able to merge it
0ed7e2d
to
2aa46d4
Compare
906a6a5
to
90f226c
Compare
@lorbax provided some valuable feedback where basically @Shourya742 and I were missing the fact that some deeper changes to JDS were actually necessary if we carefully read #853, a logical conclusion is that JDS needs a new config parameter, where the user chooses if JDS should support async jobs or not that was achieved on this commit: ebc8a72 also, we need MG tests that will cover this entire truth table:
that was achieved on this commit: e6ab468 I suggest @Shourya742 reviews these two commits, and if he agrees, cherry-pick them into this PR then, @lorbax can verify if now we finally have a sane solution to #853 |
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.
This looks very close. Added few comments.
Could you please rearrange the commits as well?
Yes, I'll squash a few of my commits and add descriptions according to the context |
Thanks, this might be helpful for when writing commits https://cbea.ms/git-commit/ |
76a012d
to
411574a
Compare
@jbesraa I’ve added the suggested changes. Please review and let me know if any further modifications are needed. |
@Shourya742 can you fix this https://github.com/stratum-mining/stratum/actions/runs/10062714214/job/27906911880 ? Everything else is passing. |
79b294e
to
9a72e42
Compare
This one is waiting for @lorbax's review according to the last dev call and then it's good to go. |
I think that now the logic of the flag checking is fine. |
if the flag is set this is not an attack but the desired behavior (by flag definition). For example if you save everything and you calculate the miner reward in a later moment or somewhere else and not each time that you receive a share (what I expect most pool will do) setting this flag is ok. Also I do not thing that the issue that you refer should be considered an issue see my comment: #1053 (comment) |
I agree that the issue does not exists, I misread it. |
hopefully this PR fixes this |
cbb1330
to
d62b961
Compare
rebasing so we can merge |
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
as already described in the previous commit, we introduced a new JDS config parameter (`async_mining_allowed`) so now, we need 2 separate tests: - a JDS that supports async jobs - a JDS that does not support async jobs and for each test, we need a mock that: - sends a `SetupConnection` with flag 0 and asserts the expected outcome - sends a `SetupConnection` with flag 1 and asserts the expected outcome if JDS does not support async jobs and receives a `SetupConnection` with flag 1, the expected outcome is `SetupConnection.Error` in all other cases, the expected outcome is a `SetupConnection.Success` with the same flag as the original `SetupConnection`
d62b961
to
51a20d8
Compare
This PR closes #853: