0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-10 10:52:31 -05:00
bitcoin-bitcoin-core/src/bench
merge-script d184fc3ba4
Merge bitcoin/bitcoin#30571: test: [refactor] Use m_rng directly
948238a683 test: Remove FastRandomContext global (Ryan Ofsky)
fa0fe08eca scripted-diff: [test] Use g_rng/m_rng directly (MarcoFalke)
fa54cab473 test: refactor: Accept any RandomNumberGenerator in RandMoney (MarcoFalke)
68f77dd21e test: refactor: Pass rng parameters to test functions (Ryan Ofsky)
fa19af555d test: refactor: Move g_insecure_rand_ctx.Reseed out of the helper that calls MakeRandDeterministicDANGEROUS (MarcoFalke)
3dc527f460 test: refactor: Give unit test functions access to test state (Ryan Ofsky)
fab023e177 test: refactor: Make unsigned promotion explicit (MarcoFalke)
fa2cb654ec test: Add m_rng alias for the global random context (MarcoFalke)
fae7e3791c test: Correct the random seed log on a prevector test failure (MarcoFalke)

Pull request description:

  This is mostly a style-cleanup for the tests' random generation:

  1) `g_insecure_rand_ctx` in the tests is problematic, because the name is a leftover when the generator was indeed insecure. However, now the generator is *deterministic*, because the seed is either passed in or printed (c.f. RANDOM_CTX_SEED). Stating that deterministic randomness is insecure in the tests seems redundant at best. Fix it by just using `m_rng` for the name.

  2) The global random context has many one-line aliases, such as `InsecureRand32`. This is problematic, because the same line of code may use the context directly and through a wrapper at the same time. For example in net_tests (see below). This inconsistency is harmless, but confusing. Fix it by just removing the one-line aliases.

  ```
  src/test/net_tests.cpp:        auto msg_data_1 = g_insecure_rand_ctx.randbytes<uint8_t>(InsecureRandRange(100000));
  ````

  3) The wrapper for randmoney has the same problem that the same unit test uses the context directly and through a wrapper at the same time. Also, it has a single type of Rng hardcoded. Fix it by accepting any type.

ACKs for top commit:
  hodlinator:
    ACK 948238a683
  ryanofsky:
    Code review ACK 948238a683. Only changes since last review were changing a comments a little bit.
  marcofleon:
    Code review ACK 948238a683. Only changes since my last review are the improvements in `prevector_tests`.

Tree-SHA512: 69c6b46a42cb743138ee8c87ff26a588dbe083e3efb3dca49b8a133ba5d3b09e8bf01c590ec7e121a7d77cb1fd7dcacd927a9ca139ac65e1f7c6d1ec46f93b57
2024-08-28 16:56:32 +01: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: [refactor] iwyu 2024-08-27 07:33:59 +02:00
base58.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
bech32.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
bench.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
bench.h bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
bench_bitcoin.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
bip324_ecdh.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
block_assemble.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
ccoins_caching.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
chacha20.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
checkblock.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
checkblockindex.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
checkqueue.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
cluster_linearize.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
CMakeLists.txt cmake: Implement install build target 2024-08-16 21:19:11 +01:00
coin_selection.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
crypto_hash.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
data.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +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#22838: descriptors: Be able to specify change and receiving in a single descriptor string 2024-08-28 15:56:15 +01:00
disconnected_transactions.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
duplicate_inputs.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
ellswift.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
examples.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
gcs_filter.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
hashpadding.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
index_blockfilter.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
load_external.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
lockedpool.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
logging.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
mempool_eviction.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
mempool_stress.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
merkle_root.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
nanobench.cpp Replace current benchmarking framework with nanobench 2020-06-13 12:24:18 +02:00
nanobench.h bench: Update nanobench to 4.3.11 2023-11-14 20:22:12 +01:00
parse_hex.cpp Add benchmark for TryParseHex 2024-02-28 17:23:54 +00:00
peer_eviction.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
poly1305.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
pool.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
prevector.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
random.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
readblock.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
rollingbloom.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
rpc_blockchain.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
rpc_mempool.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
sign_transaction.cpp Merge bitcoin/bitcoin#30571: test: [refactor] Use m_rng directly 2024-08-28 16:56:32 +01:00
streams_findbyte.cpp refactor: switch from CAutoFile to AutoFile 2023-11-18 03:01:41 +10:00
strencodings.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
util_time.cpp refactor: Remove unused GetTimeMillis 2023-05-08 12:40:48 +02:00
verify_script.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
wallet_balance.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
wallet_create.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
wallet_create_tx.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
wallet_ismine.cpp Merge bitcoin/bitcoin#22838: descriptors: Be able to specify change and receiving in a single descriptor string 2024-08-28 15:56:15 +01:00
wallet_loading.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00
xor.cpp bench: [refactor] iwyu 2024-08-27 07:33:59 +02:00