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

Translator difficulty management FIX #727

Merged
merged 16 commits into from
Jan 24, 2024
Merged

Conversation

GitGab19
Copy link
Collaborator

This PR addresses the automatic difficulty management on the Translator.
I added some modulators which better set the downstream difficulty.
I also added a check before the channel hashrate update (which is read by upstream), to avoid it goes negative.
In this way issue #712 should be fixed by this PR.
In addiction to that, I added a check which compares the job_ids after the shares submit operation. If they are different (because a share is submitted right after a new job is sent to the miner) a more explanatory message is printed instead of the too generic and wrong difficulty-too-low message.

Closes #712

@GitGab19 GitGab19 linked an issue Jan 22, 2024 that may be closed by this pull request
@@ -108,6 +108,9 @@ impl<'a> SubmitSharesError<'a> {
pub fn difficulty_too_low_error_code() -> &'static str {
"difficulty-too-low"
}
pub fn invalid_job_id_error_code() -> &'static str {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add the new error code in the doc comment of SubmitShareError and in the spec (just for reference)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.
Also opened a PR to add it to specs (stratum-mining/sv2-spec#67)

@GitGab19
Copy link
Collaborator Author

Added some additional fixes, mentioned here.
Closes #730

@GitGab19 GitGab19 merged commit 9eaf6d2 into stratum-mining:dev Jan 24, 2024
Fi3 added a commit that referenced this pull request Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants