-
Notifications
You must be signed in to change notification settings - Fork 92
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
Optimize hashing of internal sha256d miner. #871
Optimize hashing of internal sha256d miner. #871
Conversation
I need to run some tests to make sure there isn't changes to the hash during a run (doesn't look like it from code inspection). While I'm doing that check:
This function needs to change, since it's specific to Sha256D and isn't a generic GetDataHash(). |
src/primitives/block.cpp
Outdated
uint256 CBlockHeader::GetDataHash() const | ||
{ | ||
CSha256dDataInput input(*this); |
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.
Since this is specific to Sha256; change the GetDataHash()
to be reflective of that
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.
uint256 CBlockHeader::GetSha256dMidstate()
?
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.
Sure; that works. Use your discretion; but just as long as it is identifiable as a sha256 function [I figured GetSha256dDataHash()
, but whatever makes sense I'm good with.
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.
amended in 5650b36
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.
ACK 9b07d64
miner changes work. I ran it on the testnet for 24 hours.
sample block: http://testnet-explorer.codeofalltrades.com/block/c154ad36bffe1758e441fa2be2dfdb99bd6f30ec58b7742d167f711bb1e41590
@barrystyle just `rebase -i HEAD~2' and fixup the second one so that it's only one commit, and we'll send it on to QA. Also, add a stealth address. We don't have a lot to offer, but we'll get you something for a bounty. |
Since the datahash is not likely to change much between blocks (other than work refresh), we can calculate it once and reuse the value. Average hashrate beforehand on 4core vps was 4mh, averages around 5.5-6mh with blocks successfully solved on devnet.
5650b36
to
b3603ed
Compare
Appreciated, but theres no need.. enjoy! |
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.
utACK b3603ed
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.
ACK b3603ed
Since the datahash is not likely to change much between blocks (other than
work refresh), we can calculate it once and reuse the value.
Average hashrate beforehand on 4core vps was 4mh, averages around 5.5-6mh with
blocks successfully solved on devnet.