-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Use libsecp256k1 for signing operations #5220
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
Conversation
Remember out-of-order block headers along with disk positions. This is likely the simplest and least-impact way to make -reindex work with headers first. Based on top of bitcoin#4468.
Instead of skipping to the last reindexed block in each file (which could jump over processed out-of-order blocks), just skip each already processed block individually.
Previous refactorings broke the ability to rebuild the chainstate by deleting the chainstate directory, resulting in an incorrect "Incorrect or no genesis block found" error message. Fix that. Also, improve the performance of ActivateBestBlockStep by using the skiplist to only discover a few potential blocks to connect at a time, instead of all blocks forever - as we likely bail out after connecting a single one anyway.
There's only one case where a vector containing a fundamental type is serialized all-at-once, unsigned char. Anything else would lead to strange results. Use a dummy argument to overload in that case.
There's only one user of this form of serialization, so it can be easily dropped. It could be re-added if desired when we switch to c++11.
This allows CECKey to be used without directly depending on the secure allocators
Also add a test to verify.
5f4bcf6 boost: drop boost dependency in version.cpp. (Cory Fields) 352058e boost: drop boost dependency in utilstrencodings.cpp (Cory Fields) e1c9467 boost: drop boost dependency in core.cpp (Cory Fields) e405aa4 boost: remove CPrivKey dependency from CECKey (Cory Fields) 5295506 boost: drop dependency on tuple in serialization (Cory Fields) 1d9b86d boost: drop dependency on is_fundamental in serialization (Cory Fields)
e8ea0fd MOVEONLY: CInPoint from core to txmempool (jtimon)
Remove CBaseChainParams::NetworkID()
…t the message contains sensitive information. This keeps the message from being output to the debug log by bitcoind. Fixes a possible security risk when starting bitcoind in server mode without the 'rpcpassword' option configured, resulting in the "suggested" password being output to the debug log.
6f155bd Add LIBTOOLFLAGS CXX tag to qt makefile include (Michael Ford)
e11b2ce Fix large reorgs (Pieter Wuille) afc32c5 Fix rebuild-chainstate feature and improve its performance (Pieter Wuille) 16d5194 Skip reindexed blocks individually (Pieter Wuille) ad96e7c Make -reindex cope with out-of-order blocks (Wladimir J. van der Laan) e17bd58 Rename setBlockIndexValid to setBlockIndexCandidates (Pieter Wuille) 1af838b Add height to "Requesting block" debug (R E Broadley) 1bcee67 Better logging of stalling (R E Broadley) 4c93322 Improve getheaders (sending) logging (R E Broadley) f244c99 Remove CheckMinWork, as we always know all parent headers (Pieter Wuille) ad6e601 RPC additions after headers-first (Pieter Wuille) 341735e Headers-first synchronization (Pieter Wuille)
… from CScripts This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash();
This should move to a util header once their dependencies are cleaned up.
This probably would've broken native OSX builds
Sorry, I updated the secp256k1 code to a newer version. I'll pull in further updates as extra commits instead. |
ugh. why does this the .patch for this PR write files all over src/ instead of putting them in secp256k1/src/ ? I guess this is just something screwy with github and subtrees? |
ACK. |
@gmaxwell thats a git bug, not a github bug (go try to rebase this pull, git will spew crap all over src/) |
f9e40fb revert part of 9eda162 (Cory Fields) 4300876 build: secp256k1 as a subdir, since it's required (Cory Fields) 0dc8613 build: fixup configure to not export anything (Cory Fields) 54566de depends: quit exporting in config.site (Cory Fields) ff1e5ba depends: add gmp package (Cory Fields) cf61b54 Don't use bashisms in configure (Pieter Wuille) dffb8f8 Use libsecp256k1 in key.cpp (Pieter Wuille) 4c97c64 Do not use EC code in global constructors (Pieter Wuille) 07a9901 Always build and link libsecp256k1 (Pieter Wuille) d48555b Squashed 'src/secp256k1/' content from commit ad2028f (Pieter Wuille) 7a7e109 Delete src/secp256k1 before subtree import (Pieter Wuille)
@sipa Is there a readme in the libs dir howto build without our toolchain used here? |
Generally you would first build libsecp256k1.la inside the secp256k1 directory, and then link against it. What that translates to for $UNSPECIFIED_OTHER_BUILD_SYSTEM, no idea. |
Why are there so many commits (250+) in this pull request, and 1122 files changed? It looks like a lot of old commits got remerged, is this intentional? I am no git-expert, it just looks weird here on github. Headline says "laanwj merged 7,292 commits into bitcoin:master" |
Github just barfs at this for some reason. The actual commit in git is fine. |
ok, fine with me. The old commit hashes are still the same, so it really looks like only github got confused. |
Indeed, Actual Git shows everything is fine. I've seen this before, not sure what causes it; maybe github gets confused by subtree as well. |
@sipa I needed to build gmp with my MinGW-w64 compiler and used: ./configure --prefix=$PWD/dist --enable-static --disable-shared make && make install Then I tried to build libsecp256k1 via: ./autogen.sh ./configure --prefix=$PWD/dist make && make install Now when trying to link to libsecp256k1 I get a bunch of these: C:/Users/Diapolo/bitcoin.Qt/src/secp256k1/dist/lib/libsecp256k1.a(libsecp256k1_la-secp256k1.o): In function `secp256k1_num_set_bin': c:\Users\Diapolo\bitcoin.Qt\src\secp256k1/src/num_gmp_impl.h:73: undefined reference to `__gmpn_set_str' Any idea for me? Seems it was my link order, changed from New question, does gmp NEED OpenSSL to work for what you are doing with it in secp256k1? Seems I was missing crypto.h during gmp build! |
gmp does certainly not require OpenSSL Doesn't 'make' in depends work for you? You shouldn't have to manually build dependencies anymore. |
My MSYS + MinGW-w64 toolchain (that I manually setup on my Win machine) did give me headaches with what we now use as build system and because of that I'm still using Qt Creator and the .pro file, which I now upgraded to make use of libsecp256k1 ;). |
Where does it fail? |
No description provided.