-
Notifications
You must be signed in to change notification settings - Fork 990
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
fix share difficulty validation - compare stratum server minimum_share_difficulty as unscaled difficulty #3624
fix share difficulty validation - compare stratum server minimum_share_difficulty as unscaled difficulty #3624
Conversation
@quentinlesceller I suspect you might be appropriate for the stratum changes, but I can't assign you 👀 |
fix mix use of scaled and unscaled, add additional comments to clarify which values are which improved consistency - scaled and unscaled difficulty
144a830
to
cf394c2
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.
Instead of all those changes, isn't it simpler to scale up minimum_share_difficulty by the minimum graph weight (of C32) ?
That has the same behaviour, and doesn't require computing scaled_share_difficulty and unscaled_share_difficulty side by side.
I think we probably want matching scaled and unscaled methods since the rust project can be used by upstream devs as a library. From personal experience (rust stratum server links to grin library for POW methods) I am certain that people look for it and are confused when no method exists. If you already know the technical details about what scaling is and how to calculate it it seems like a trivial point. But if you dont know the details and the method does not exist that makes things much harder. I would like to leave the method if you dont object too strongly? |
Ok, if you think it's useful. But I don't like the separate from_proof_unscaled. Can you just inline it into to_unscaled_difficulty ? |
Sure, let me take a look at your suggestion and adjust the PR. I hope to find time in the next few days. |
@tromp Can you take another look to make sure I understood your request correctly. |
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 ok, with the suggested change in u64 literal notation.
The release this is going into should make clear that this affects miners who have set a minimum share difficulty greater than the default 1.
@tromp Ok. This config item was always intended to be unscaled value, so this is a bug fix. But I do agree that it should be mentioned in the release notes in case people were using the scaled value there. @quentinlesceller Can you please give a second review and merge if you agree with the changes? |
We seem to show PR titles in https://github.com/mimblewimble/grin/releases. Should we introduce at some point some form of a changelog? e.g. https://github.com/mitsuhiko/redis-rs/blob/master/CHANGELOG.md |
I updated the PR title to be a more descriptive changes log entry |
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.
Looking good to me 👍
@tromp you still have "requested changes" on this one. I'm not sure whether this blocks the merge or not, but I'm assuming it's a 👍 from you as well now? |
…rver minimum_share_difficulty as unscaled difficulty (mimblewimble#3624)
Fix for compare of scaled and unscaled difficulty.