elements/src/bench
Andrew Chow 5690848dfb
Merge bitcoin/bitcoin#26532: wallet: bugfix, invalid crypted key "checksum_valid" set
13d9760829 test: load wallet, coverage for crypted keys (furszy)
373c99633e refactor: move DuplicateMockDatabase to wallet/test/util.h (furszy)
ee7a984f85 refactor: unify test/util/wallet.h with wallet/test/util.h (furszy)
cc5a5e8121 wallet: bugfix, invalid crypted key "checksum_valid" set (furszy)

Pull request description:

  At wallet load time, the crypted key "checksum_valid" variable is always set to false. Which, on every wallet decryption call, forces the process to re-write all the ckeys to db when it's not needed.

  Note:
  The first commit fixes the issue, the two commits in the middle are cleanups so `DuplicateMockDatabase`
  can be used without duplicating code. And, the last one is pure test coverage for the crypted keys loading
  process.

  Includes test coverage for the following scenarios:

  1) "All ckeys checksums valid" test:
  Loads an encrypted wallet with all the crypted keys with a valid checksum and
  verifies that 'CWallet::Unlock' doesn't force an entire crypted keys re-write.

      (we force a complete ckeys re-write if we find any missing crypted key checksum
  during the wallet loading process)

  2) "Missing checksum in one ckey" test:
  Verifies that loading up a wallet with, at least one, 'ckey' with no checksum
  triggers a complete re-write of the crypted keys.

  3) "Invalid ckey checksum error" test:
  Verifies that loading up a ckey with an invalid checksum stops the wallet loading
  process with a corruption error.

  4) "Invalid ckey pubkey error" test:
  Verifies that loading up a ckey with an invalid pubkey stops the wallet loading
  process with a corruption error.

ACKs for top commit:
  achow101:
    ACK 13d9760829
  aureleoules:
    ACK 13d9760829

Tree-SHA512: 9ea630ee4a355282fbeee61ca04737294382577bb4b2631f50e732568fdab8f72491930807fbda58206446c4f26200cdc34d8afa14dbe1241aec713887d06a0b
2022-11-29 18:54:57 -05:00
..
data Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
.gitignore Ignore bench_bitcoin binary. 2015-10-06 17:46:12 +02:00
addrman.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
base58.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
bech32.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
bench.cpp bench: add "priority level" to the benchmark framework 2022-10-20 10:21:04 -03:00
bench.h bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
bench_bitcoin.cpp bench: surround main() execution with try/catch 2022-10-20 10:21:04 -03:00
block_assemble.cpp refactor: unify test/util/wallet.h with wallet/test/util.h 2022-11-21 17:30:00 -03:00
ccoins_caching.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
chacha20.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
chacha_poly_aead.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
checkblock.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
checkqueue.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
coin_selection.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
crypto_hash.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
data.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
data.h bench: Move generated data to a dedicated translation unit 2019-07-02 18:11:15 +01:00
descriptors.cpp Merge bitcoin/bitcoin#26158: bench: add "priority level" to the benchmark framework 2022-10-20 11:05:03 -04:00
duplicate_inputs.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
examples.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
gcs_filter.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
hashpadding.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
load_external.cpp Add LoadExternalBlockFile() benchmark 2022-10-24 13:02:35 -06:00
lockedpool.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
logging.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
mempool_eviction.cpp Merge bitcoin/bitcoin#17786: refactor: Nuke policy/fees->mempool circular dependencies 2022-11-18 17:04:49 -08:00
mempool_stress.cpp Merge bitcoin/bitcoin#17786: refactor: Nuke policy/fees->mempool circular dependencies 2022-11-18 17:04:49 -08:00
merkle_root.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
nanobench.cpp Replace current benchmarking framework with nanobench 2020-06-13 12:24:18 +02:00
nanobench.h Fix issues identified by codespell 2.2.1 and update ignored words 2022-09-15 13:03:40 +02:00
peer_eviction.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
poly1305.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
prevector.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
rollingbloom.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
rpc_blockchain.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
rpc_mempool.cpp Merge bitcoin/bitcoin#17786: refactor: Nuke policy/fees->mempool circular dependencies 2022-11-18 17:04:49 -08:00
strencodings.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
util_time.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
verify_script.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
wallet_balance.cpp refactor: unify test/util/wallet.h with wallet/test/util.h 2022-11-21 17:30:00 -03:00
wallet_create_tx.cpp refactor: unify test/util/wallet.h with wallet/test/util.h 2022-11-21 17:30:00 -03:00
wallet_loading.cpp refactor: move DuplicateMockDatabase to wallet/test/util.h 2022-11-21 17:30:00 -03:00