-
Notifications
You must be signed in to change notification settings - Fork 127
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
Conversation
@@ -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 { |
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.
I would add the new error code in the doc comment of SubmitShareError and in the spec (just for reference)
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.
Done.
Also opened a PR to add it to specs (stratum-mining/sv2-spec#67)
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