0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00
bitcoin-bitcoin-core/src
MarcoFalke 9e8bd217cd
Merge #13204: Faster sigcache nonce
152e8baf08 Use salted hasher instead of nonce in sigcache (Jeremy Rubin)
5495fa5850 Add Hash Padding Microbenchmarks (Jeremy Rubin)

Pull request description:

  This PR replaces nonces in two places with pre-salted hashers.

  The nonce is chosen to be 64 bytes long so that it forces the SHA256 hasher to process the chunk. This leaves the next 64 (or 56 depending if final chunk) open for data. In the case of the script execution cache, this does not make a big performance improvement because the nonce was already properly padded to fit into one buffer, but does make the code a little simpler. In the case of the sig cache, this should reduce the hashing overhead slightly because we are less likely to need an additional processing step.

  I haven't benchmarked this, but back of the envelope it should reduce the hashing by one buffer for all combinations except compressed public keys with compact signatures.

ACKs for top commit:
  ryanofsky:
    Code review ACK 152e8baf08. No code changes, just rebase since last review and expanded commit message

Tree-SHA512: b133e902fd595cfe3b54ad8814b823f4d132cb2c358c89158842ae27daee56ab5f70cde2585078deb46f77a6e7b35b4cc6bba47b65302b7befc2cff254bad93d
2020-06-02 07:32:15 -04:00
..
bench Merge #13204: Faster sigcache nonce 2020-06-02 07:32:15 -04:00
compat net: Use C++11 member initialization in protocol 2020-05-20 08:27:07 -04:00
config
consensus scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
crc32c Import crc32c using subtree merge as as 'src/crc32c' 2020-01-28 17:00:01 +01:00
crypto Avoid non-trivial global constants in SHA-NI code 2020-04-07 13:57:34 -07:00
index [doc] Add comment for m_headers_cache 2020-05-22 11:59:58 -04:00
interfaces Merge #18452: qt: Fix shutdown when waitfor* cmds are called from RPC console 2020-05-29 15:49:46 +02:00
leveldb Update to leveldb upstream using subtree merge 2020-01-28 16:59:07 +01:00
logging Remove use of non-standard zero variadic macros 2020-04-30 18:02:04 +08:00
node Merge #19056: rpc: Make gettxoutsetinfo/GetUTXOStats interruptible 2020-05-26 07:33:43 -04:00
policy Convert everything except wallet/qt to new serialization 2020-03-30 16:10:30 -07:00
primitives Merge #18317: Serialization improvements step 6 (all except wallet/gui) 2020-05-20 07:30:29 -04:00
qt Merge #19104: gui, refactor: Register Qt meta types in application constructor 2020-06-02 08:48:04 +02:00
rpc Merge #19111: Limit scope of all global std::once_flag 2020-06-02 07:04:19 -04:00
script Merge #13204: Faster sigcache nonce 2020-06-02 07:32:15 -04:00
secp256k1 Update the secp256k1 subtree to the latest upstream version 2019-03-31 11:41:05 -07:00
support Limit scope of all global std::once_flag 2020-05-29 17:22:07 -04:00
test Merge #18994: tests: Add fuzzing harnesses for functions in script/ 2020-05-31 18:58:41 -04:00
univalue Update univalue subtree 2020-02-09 07:44:29 -08:00
util Merge #16127: More thread safety annotation coverage 2020-05-27 19:31:33 -04:00
wallet Get rid of -Wthread-safety-precise warnings 2020-05-28 09:55:39 +03:00
zmq scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
.clang-format util: Add AllowShortCaseLabelsOnASingleLine option 2019-10-14 13:24:54 +03:00
addrdb.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
addrdb.h Convert addrdb/addrman to new serialization 2020-01-02 11:05:36 -08:00
addrman.cpp Merge #18512: Improve asmap checks and add sanity check 2020-05-06 14:59:28 +02:00
addrman.h logging: asmap logging and #include fixups 2020-03-04 14:24:19 +01:00
amount.h Update copyright headers to 2018 2018-12-29 10:15:01 +01:00
arith_uint256.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
arith_uint256.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
attributes.h Add NODISCARD to all {Decode,Parse}[...](...) functions returning bool. Sort includes. 2018-11-05 17:03:11 +01:00
banman.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
banman.h refactor: move DUMP_BANS_INTERVAL to banman.h 2020-03-10 09:52:53 -04:00
base58.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
base58.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
bech32.cpp Add some general std::vector utility functions 2019-10-16 08:56:57 -07:00
bech32.h Assert that the HRP is lowercase in Bech32::Encode 2019-09-05 13:25:11 +12:00
bitcoin-cli-res.rc
bitcoin-cli.cpp Merge #19004: refactor: Replace const char* to std::string 2020-05-27 07:16:10 -04:00
bitcoin-tx-res.rc
bitcoin-tx.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
bitcoin-wallet-res.rc [tools] Add wallet inspection and modification tool 2019-01-30 16:26:52 -05:00
bitcoin-wallet.cpp wallettool: Add a salvage command 2020-05-25 12:36:48 -04:00
bitcoind-res.rc
bitcoind.cpp refactor: Pass NodeContext to RPC and REST methods through util::Ref 2020-05-13 16:20:13 -04:00
blockencodings.cpp Get rid of -Wthread-safety-precise warnings 2020-05-28 09:55:39 +03:00
blockencodings.h Get rid of -Wthread-safety-precise warnings 2020-05-28 09:55:39 +03:00
blockfilter.cpp tests: Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode) 2020-04-20 14:57:48 +00:00
blockfilter.h [indexes] Fix default [de]serialization of BlockFilter. 2020-05-26 17:27:15 -04:00
bloom.cpp net: remove is{Empty,Full} flags from CBloomFilter, clarify CVE fix 2020-04-28 19:27:22 +02:00
bloom.h Merge #18317: Serialization improvements step 6 (all except wallet/gui) 2020-05-20 07:30:29 -04:00
chain.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
chain.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
chainparams.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
chainparams.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
chainparamsbase.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
chainparamsbase.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
chainparamsseeds.h net: Hardcoded seeds update for 0.20 2020-04-03 16:29:26 +02:00
checkqueue.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
clientversion.cpp Drop unused GIT_COMMIT_DATE macro 2020-05-04 19:53:58 +03:00
clientversion.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
coins.cpp Remove CCoinsViewCache::GetValueIn(...) 2020-05-03 18:42:14 +00:00
coins.h Merge #18854: doc: Fix typo in Coin doxygen comment 2020-05-06 13:15:28 +02:00
compat.h windows: Set _WIN32_WINNT to 0x0601 (Windows 7) 2019-01-23 16:28:27 +08:00
compressor.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
compressor.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
core_io.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
core_memusage.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
core_read.cpp refactor: Replace const char* to std::string 2020-05-22 01:40:31 +09:00
core_write.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
cuckoocache.h tests: Add fuzzing harness for classes/functions in cuckoocache.h 2020-04-08 14:45:27 +00:00
dbwrapper.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
dbwrapper.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
dummywallet.cpp wallet: Avoid translating RPC errors when loading wallets 2020-05-01 07:39:00 -04:00
flatfile.cpp Style cleanup. 2019-02-22 17:38:45 -08:00
flatfile.h Merge #18317: Serialization improvements step 6 (all except wallet/gui) 2020-05-20 07:30:29 -04:00
fs.cpp Fix WSL file locking by using flock instead of fcntl 2020-04-26 12:16:22 +12:00
fs.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
hash.cpp Extract CSipHasher to it's own file in crypto/ directory. 2018-11-05 09:25:15 -08:00
hash.h Squashed 'src/secp256k1/' changes from 0b70241850..b19c000063 2019-03-31 11:41:05 -07:00
httprpc.cpp Merge #18740: Remove g_rpc_node global 2020-05-21 06:53:39 -04:00
httprpc.h refactor: Pass NodeContext to RPC and REST methods through util::Ref 2020-05-13 16:20:13 -04:00
httpserver.cpp http: Avoid crash when g_thread_http was never started 2020-05-19 10:41:44 -04:00
httpserver.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
indirectmap.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
init.cpp validation: Make LoadBlockIndex() a member of ChainstateManager 2020-05-21 09:55:59 -04:00
init.h refactor: Pass NodeContext to RPC and REST methods through util::Ref 2020-05-13 16:20:13 -04:00
key.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
key.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
key_io.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
key_io.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
limitedmap.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
logging.cpp refactor: Rename LockGuard to StdLockGuard for consistency with StdMutex 2020-05-28 09:54:24 +03:00
logging.h refactor: Rename LockGuard to StdLockGuard for consistency with StdMutex 2020-05-28 09:54:24 +03:00
Makefile.am Merge #18918: wallet: Move salvagewallet into wallettool 2020-05-27 14:51:49 +12:00
Makefile.bench.include Add Hash Padding Microbenchmarks 2020-04-29 00:31:41 -07:00
Makefile.crc32c.include build: CRC32C build system integration 2020-01-28 17:01:48 +01:00
Makefile.leveldb.include build: Enable -Wsuggest-override 2020-05-12 18:03:39 +03:00
Makefile.qt.include build: multiprocess autotools changes 2020-05-12 09:47:06 -04:00
Makefile.qt_locale.include qt: Translations update pre-branch 2020-04-01 12:49:15 +02:00
Makefile.qttest.include build: Create test utility library from src/test/util/ 2019-11-21 21:13:08 +01:00
Makefile.test.include tests: Add fuzzing harness for functions in script/sign.h 2020-05-30 10:37:01 +00:00
Makefile.test_fuzz.include build: create test_fuzz library from src/test/fuzz/fuzz.cpp 2020-04-05 01:01:13 +02:00
Makefile.test_util.include fuzz: Add process_messages harness 2020-04-05 10:46:24 +08:00
memusage.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
merkleblock.cpp Convert merkleblock to new serialization 2020-03-30 16:09:51 -07:00
merkleblock.h Convert merkleblock to new serialization 2020-03-30 16:09:51 -07:00
miner.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
miner.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
net.cpp Merge #16939: p2p: Delay querying DNS seeds 2020-05-29 18:24:09 +08:00
net.h Merge #16127: More thread safety annotation coverage 2020-05-27 19:31:33 -04:00
net_permissions.cpp net: Avoid using C-style NUL-terminated strings as arguments in the netbase interface 2020-01-08 12:35:59 +00:00
net_permissions.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
net_processing.cpp Merge #19044: net processing: Add support for getcfilters 2020-05-31 18:20:17 -04:00
net_processing.h net: Pass chainman into PeerLogicValidation 2020-05-21 09:55:58 -04:00
net_types.h refactor: Remove addrdb.h dependency from node.h 2019-10-29 11:30:12 +02:00
netaddress.cpp Merge #18512: Improve asmap checks and add sanity check 2020-05-06 14:59:28 +02:00
netaddress.h Merge #18317: Serialization improvements step 6 (all except wallet/gui) 2020-05-20 07:30:29 -04:00
netbase.cpp Merge #17754: net: Don't allow resolving of std::string with embedded NUL characters. Add tests. 2020-01-22 20:20:45 +01:00
netbase.h net: Avoid using C-style NUL-terminated strings as arguments in the netbase interface 2020-01-08 12:35:59 +00:00
netmessagemaker.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
noui.cpp Make ThreadSafe{MessageBox|Question} bilingual 2020-05-05 04:45:59 +03:00
noui.h Make ThreadSafe{MessageBox|Question} bilingual 2020-05-05 04:45:59 +03:00
optional.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
outputtype.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
outputtype.h List output types in an array in order to be iterated over 2020-01-23 16:35:06 -05:00
pow.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
pow.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
prevector.h prevector: Avoid unnamed struct, which is a GNU extension 2020-04-30 18:02:03 +08:00
protocol.cpp Merge #19044: net processing: Add support for getcfilters 2020-05-31 18:20:17 -04:00
protocol.h Merge #19044: net processing: Add support for getcfilters 2020-05-31 18:20:17 -04:00
psbt.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
psbt.h doc: Fix unrelated typos reported by codespell 2020-05-27 12:37:08 -04:00
pubkey.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
pubkey.h Implement TopUp in DescriptorScriptPubKeyMan 2020-04-23 13:59:48 -04:00
random.cpp Merge #18781: Add templated GetRandDuration<> 2020-05-15 08:58:49 -04:00
random.h Add templated GetRandomDuration<> 2020-04-30 09:19:14 -04:00
randomenv.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
randomenv.h [MOVEONLY] Move perfmon data gathering to new randomenv module 2019-11-12 14:50:44 -08:00
rest.cpp Merge #18740: Remove g_rpc_node global 2020-05-21 06:53:39 -04:00
reverse_iterator.h scripted-diff: Remove trailing whitespaces 2018-07-24 20:46:23 +01:00
scheduler.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
scheduler.h scheduler: Make schedule* methods type safe 2020-03-10 09:47:32 -04:00
serialize.h Remove old serialization primitives 2020-05-24 10:35:00 -07:00
shutdown.cpp
shutdown.h
span.h Merge #18591: Add C++17 build to Travis 2020-04-30 11:16:56 +02:00
streams.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
sync.cpp Use template function instead of void* parameter 2020-05-28 09:55:04 +03:00
sync.h Use template function instead of void* parameter 2020-05-28 09:55:04 +03:00
threadinterrupt.cpp Merge #11640: Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection 2018-08-31 16:00:38 +02:00
threadinterrupt.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
threadsafety.h refactor: Rename LockGuard to StdLockGuard for consistency with StdMutex 2020-05-28 09:54:24 +03:00
timedata.cpp Make ThreadSafe{MessageBox|Question} bilingual 2020-05-05 04:45:59 +03:00
timedata.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
tinyformat.h util: Update tinyformat to upstream 2019-12-06 10:02:08 +01:00
torcontrol.cpp net: Avoid using C-style NUL-terminated strings as arguments in the netbase interface 2020-01-08 12:35:59 +00:00
torcontrol.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
txdb.cpp Merge #18317: Serialization improvements step 6 (all except wallet/gui) 2020-05-20 07:30:29 -04:00
txdb.h scripted-diff: Bump copyright of files changed in 2020 2020-01-15 02:18:00 +07:00
txmempool.cpp Merge #18038: P2P: Mempool tracks locally submitted transactions to improve wallet privacy 2020-04-29 16:32:37 +08:00
txmempool.h [trivial/doc] Fix comment type 2020-05-25 11:27:07 -07:00
ui_interface.cpp refactor: Pass SynchronizationState enum to GUI 2020-05-19 02:49:32 +03:00
ui_interface.h refactor: Pass SynchronizationState enum to GUI 2020-05-19 02:49:32 +03:00
uint256.cpp refactor: define a UINT256_ONE global constant 2020-01-23 16:35:08 -05:00
uint256.h refactor: define a UINT256_ONE global constant 2020-01-23 16:35:08 -05:00
undo.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
validation.cpp Merge #13204: Faster sigcache nonce 2020-06-02 07:32:15 -04:00
validation.h validation: Mark g_chainman DEPRECATED 2020-05-21 09:56:25 -04:00
validationinterface.cpp validationinterface: Rework documentation, Rename pwalletIn to callbacks 2020-05-13 19:57:55 -04:00
validationinterface.h validationinterface: Rework documentation, Rename pwalletIn to callbacks 2020-05-13 19:57:55 -04:00
version.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
versionbits.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
versionbits.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
versionbitsinfo.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
versionbitsinfo.h MOVEONLY: Move versionbits info out of versionbits.o 2018-09-23 22:55:11 +02:00
walletinitinterface.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
warnings.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
warnings.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00