-
Notifications
You must be signed in to change notification settings - Fork 182
Port of Bitcoin hash implementation #1208
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
Port of Bitcoin hash implementation #1208
Conversation
Crap. How did those other commits get in there... |
Can you add the crypto subdirectory in a separate commit, such that the actual change in the source is more readable? |
Ok. Give me some time to back this commit out and split it up. |
Done. I rebased it to the development branch... Ugh. I think I needed to switch to development and rebranch with the stash because my hashaccel already had commits in from staging that were not in dev? |
Travis is failing because it is trying to build with the only last commit (a4cabbb) applied. That is stupid. |
These are the adjustments to the Gridcoin core code required to accomodate the Bitcoin crypto backport
These are the added files from src/crypto which implement the internal hashing
@@ -133,7 +147,7 @@ GRIDCOIN_CORE_CPP = addrman.cpp \ | |||
script.cpp \ | |||
scrypt.cpp \ | |||
sync.cpp \ | |||
tally.cpp \ | |||
tally.cpp \ | |||
txdb-leveldb.cpp \ | |||
util.cpp \ | |||
version.cpp \ |
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.
You probably need to add prevector.h here.
Hmm. Why the heck is it compiling in my local repo...?
…Sent from my iPhone
On Jul 11, 2018, at 11:32 AM, Sebastian Kung ***@***.***> wrote:
@TheCharlatan commented on this pull request.
In src/Makefile.am:
> @@ -133,7 +147,7 @@ GRIDCOIN_CORE_CPP = addrman.cpp \
script.cpp \
scrypt.cpp \
sync.cpp \
- tally.cpp \
+ tally.cpp \
txdb-leveldb.cpp \
util.cpp \
version.cpp \
You probably need to add prevector.h here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
c2c7234
to
935adb7
Compare
Interesting. One build type out of the five in travis is failing, the i686 Linux, which is the 32-bit Linux build, and it is failing at Perhaps this is not valid after all for the i386 define as specified by Bitcoin...? #if defined(USE_ASM) && (defined(x86_64) || defined(amd64) || defined(i386))`... Turns out I was sorta right. A different call has to be used for 32 bit... see |
On certain GCC versions, the 32 bit builds can fail unless a different CPUID call is used. See bitcoin/bitcoin@63c16ed.
Why the proper implementation can't be selected at compile time? |
You are absolutely right, and then we end up with stupid things like the SHA256AutoDetect() function..., although runtime codepath switching does allow a single executable to be used across a wider domain of x86 chips without recompile... |
src/compat/byteswap.h
Outdated
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef GRIDCOIN_COMPAT_BYTESWAP_H |
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 think we should keep the Bitcoin ifndefs so we stay closer to the original source.
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 can change them back. If you are ok with it, I'll do it in another commit, because it is too hard to undo all of the above at this point...
This small commit reverts the ifndefs to standard Bitcoin nomenclature to allow for easier drop-in updates of this code.
@denravonska I pushed the reversion of the ifndefs to Bitcoin nomenclature... |
Added: - Linux nodes can now stake superblocks using forwarded contracts #1060 (@tomasbrod). Changed: - Replace interest with constant block reward #1160 (@tomasbrod). Fork is set to trigger at block 1420000. - Raise coinstake output count limit to 8 #1261 (@tomasbrod). - Port of Bitcoin hash implementation #1208 (@jamescowens). - Minor canges for the build documentation #1091 (@Lenni). - Allow sendmany to be used without an account specified #1158 (@Foggyx420). Fixed: - Fix `cpids` and `validcpids` not returning the correct data #1233 (@Foggyx420). - Fix `listsinceblock` not showing mined blocks to change addresses #501 (@Foggyx420). - Fix crash when raining using a locked wallet #1236 (@Foggyx420). - Fix invalid stake reward/fee calculation (@jamescowens). - Fix divide by zero bug in `getblockstats` RPC #1292 (@Foggyx420). - Bypass historical bad blocks on testnet #1252 (@Quezacoatl1). - Fix MacOS memorybarrier warnings #1193 (@ghost). Removed: - Remove neuralhash from the getpeerinfo and node stats #1123 (@Foggyx420). - Remove obsolete NN code #1121 (@Foggyx420). - Remove (lower) Mint Limiter #1212 (@tomasbrod).
This is a port of Bitcoin’s internal hash implementation, which replaces the hashing provided by OpenSSL. It provides accelerated versions on CPUs with SSE4(1) and/or AVX2, although initial testing shows little performance benefit.
The call architecture and initialization code allows reasonably easy implementation of accelerated versions for the ARM architecture.
Note that byteswap.h and endian.h are also included.
Whether or not this provides an actual performance benefit it moves us down the road of merging the modern Bitcoin codebase into Gridcoin.