0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-18 11:57:37 -05:00
bitcoin-bitcoin-core/src/test/fuzz
Ava Chow 011a895a82
Merge bitcoin/bitcoin#29015: kernel: Streamline util library
c7376babd1 doc: Clarify distinction between util and common libraries in libraries.md (Ryan Ofsky)
4f74c59334 util: Move util/string.h functions to util namespace (Ryan Ofsky)
4d05d3f3b4 util: add TransactionError includes and namespace declarations (Ryan Ofsky)
680eafdc74 util: move fees.h and error.h to common/messages.h (Ryan Ofsky)
02e62c6c9a common: Add PSBTError enum (Ryan Ofsky)
0d44c44ae3 util: move error.h TransactionError enum to node/types.h (Ryan Ofsky)
9bcce2608d util: move spanparsing.h to script/parsing.h (Ryan Ofsky)
6dd2ad4792 util: move spanparsing.h Split functions to string.h (Ryan Ofsky)
23cc8ddff4 util: move HexStr and HexDigit from util to crypto (TheCharlatan)
6861f954f8 util: move util/message to common/signmessage (Ryan Ofsky)
cc5f29fbea build: move memory_cleanse from util to crypto (Ryan Ofsky)
5b9309420c build: move chainparamsbase from util to common (Ryan Ofsky)
ffa27af24d test: Add check-deps.sh script to check for unexpected library dependencies (Ryan Ofsky)

Pull request description:

  Remove `fees.h`, `errors.h`, and `spanparsing.h` from the util library. Specifically:

  - Move `Split` functions from `util/spanparsing.h` to `util/string.h`, using `util` namespace for clarity.
  - Move remaining spanparsing functions to `script/parsing.h` since they are used for descriptor and miniscript parsing.
  - Combine `util/fees.h` and `util/errors.h` into `common/messages.h` so there is a place for simple functions that generate user messages to live, and these functions are not part of the util library.

  Motivation for this change is that the util library is a dependency of the kernel, and we should remove functionality from util that shouldn't be called by kernel code or kernel applications. These changes should also improve code organization and make functions easier to discover. Some of these same moves are (or were) part of #28690, but did not help with code organization, or made it worse, so it is better to move them and clean them up in the same PR so code only has to change one time.

ACKs for top commit:
  achow101:
    ACK c7376babd1
  TheCharlatan:
    Re-ACK c7376babd1
  hebasto:
    re-ACK c7376babd1.

Tree-SHA512: 5bcef16c1255463b1b69270548711e7ff78ca0dd34e300b95e3ca1ce52ceb34f83d9ddb2839e83800ba36b200de30396e504bbb04fa02c6d0c24a16d06ae523d
2024-06-12 17:12:54 -04:00
..
util [fuzz] Avoid endless waiting in FuzzedSock::{Wait,WaitMany} 2024-06-03 10:32:43 +01:00
addition_overflow.cpp build, msvc: Build fuzz.exe binary 2024-04-18 10:27:25 +01:00
addrman.cpp fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
asmap.cpp
asmap_direct.cpp
autofile.cpp fuzz: AutoFile with XOR 2023-11-14 17:41:54 +01:00
banman.cpp fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
base_encode_decode.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
bech32.cpp
bip324.cpp test: Use ECC_Context helper in bench and fuzz tests 2024-05-09 15:56:04 +02:00
bitdeque.cpp fuzz: Avoid timeout in bitdeque 2023-12-06 15:44:38 +01:00
bitset.cpp fuzz: Use std::span in FuzzBufferType 2024-06-12 15:21:31 +02:00
block.cpp fuzz: Drop unused version from fuzz input format 2023-11-30 11:27:21 +01:00
block_header.cpp
blockfilter.cpp
bloom_filter.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
buffered_file.cpp streams: Base BufferedFile on AutoFile instead of CAutoFile 2023-11-18 00:15:22 +10:00
chain.cpp chain: Rename HaveTxsDownloaded to HaveNumChainTxs 2023-10-06 19:43:32 +02:00
checkqueue.cpp refactor: Make CCheckQueue constructor start worker threads 2023-10-03 10:52:15 +01:00
coins_view.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
coinscache_sim.cpp Use Txid in COutpoint 2023-11-21 13:15:44 +00:00
connman.cpp fuzz: fix connman initialization 2024-01-09 15:15:36 -03:00
crypto.cpp refactor: use Span for SipHash::Write 2023-07-17 13:27:46 +02:00
crypto_aes256.cpp
crypto_aes256cbc.cpp
crypto_chacha20.cpp fuzz: support std::byte in Consume{Fixed,Variable}LengthByteVector 2023-08-17 15:31:56 -04:00
crypto_common.cpp
crypto_diff_fuzz_chacha20.cpp crypto: require key on ChaCha20 initialization 2023-08-17 15:31:27 -04:00
crypto_hkdf_hmac_sha256_l32.cpp
crypto_poly1305.cpp fuzz: support std::byte in Consume{Fixed,Variable}LengthByteVector 2023-08-17 15:31:56 -04:00
cuckoocache.cpp
decode_tx.cpp
descriptor_parse.cpp test: Use ECC_Context helper in bench and fuzz tests 2024-05-09 15:56:04 +02:00
deserialize.cpp assumeutxo: Add network magic ctor param to SnapshotMetadata 2024-05-24 18:44:02 +02:00
eval_script.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
fee_rate.cpp
feefrac.cpp Add fuzz test for FeeFrac 2024-03-18 10:32:00 -04:00
feeratediagram.cpp Avoid explicitly computing diagram; compare based on chunks 2024-04-22 09:36:36 -04:00
fees.cpp util: move fees.h and error.h to common/messages.h 2024-05-16 10:16:08 -05:00
flatfile.cpp Refactor: Remove unused FlatFilePos::SetNull 2023-03-21 13:54:11 +01:00
float.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
fuzz.cpp [fuzz] Avoid collecting initialization coverage 2024-05-23 17:26:26 +01:00
fuzz.h fuzz: Use std::span in FuzzBufferType 2024-06-12 15:21:31 +02:00
FuzzedDataProvider.h doc: fix typos 2023-11-07 10:21:51 +09:00
golomb_rice.cpp refactor: SpanReader without nVersion 2023-11-28 12:42:07 +01:00
headerssync.cpp Rename CalculateHeadersWork to CalculateClaimedHeadersWork 2024-03-05 10:01:24 -05:00
hex.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
http_request.cpp refactor: Remove call to ShutdownRequested from HTTPRequest 2023-12-04 15:39:15 -04:00
i2p.cpp fuzz: add I2P harness 2024-06-06 13:06:23 -07:00
integer.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
key.cpp refactor: remove unused CKey::Negate method 2024-06-03 16:59:43 +02:00
key_io.cpp test: Use ECC_Context helper in bench and fuzz tests 2024-05-09 15:56:04 +02:00
kitchen_sink.cpp util: add TransactionError includes and namespace declarations 2024-05-16 10:16:08 -05:00
load_external_block_file.cpp blockstorage: switch from CAutoFile to AutoFile 2023-11-18 03:01:03 +10:00
locale.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
merkleblock.cpp refactor: Use Txid in CMerkleBlock 2023-11-28 17:49:41 +01:00
message.cpp util: move util/message to common/signmessage 2024-05-16 11:16:08 -04:00
mini_miner.cpp [[refactor]] Check CTxMemPool options in constructor 2024-05-17 23:37:25 +02:00
miniscript.cpp tests, fuzz: use new NUMS_H const 2024-05-14 11:44:33 +02:00
minisketch.cpp [fuzz] Improve fuzzing stability for minisketch harness 2023-12-14 20:10:21 +00:00
muhash.cpp refactor: disable self-assign warning for tests 2024-06-06 14:14:08 +00:00
multiplication_overflow.cpp build, msvc: Build fuzz.exe binary 2024-04-18 10:27:25 +01:00
net.cpp fuzz: add target for local addresses 2024-02-29 14:13:58 -03:00
net_permissions.cpp Merge bitcoin/bitcoin#27114: p2p: Allow whitelisting manual connections 2024-03-12 12:59:02 -04:00
netaddress.cpp fuzz: extend ConsumeNetAddr() to return I2P and CJDNS addresses 2024-01-23 11:49:32 +01:00
netbase_dns_lookup.cpp p2p: return CSubNet in LookupSubNet 2023-05-30 16:27:21 -03:00
node_eviction.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
p2p_transport_serialization.cpp Merge bitcoin/bitcoin#29421: net: make the list of known message types a compile time constant 2024-05-21 13:59:33 -04:00
package_eval.cpp Merge bitcoin/bitcoin#29325: consensus: Store transaction nVersion as uint32_t 2024-06-12 10:32:31 +01:00
parse_hd_keypath.cpp Switch hardened derivation marker to h in descriptors 2023-04-04 18:33:08 +02:00
parse_numbers.cpp
parse_script.cpp
parse_univalue.cpp refactor: Revert addition of univalue sighash string check 2023-07-27 09:36:05 +02:00
partially_downloaded_block.cpp [[refactor]] Check CTxMemPool options in constructor 2024-05-17 23:37:25 +02:00
policy_estimator.cpp test: change m_submitted_in_package input to fuzz data provider boolean 2024-01-02 12:41:01 +01:00
policy_estimator_io.cpp fuzz: Remove FuzzedAutoFileProvider 2023-11-14 17:41:26 +01:00
poolresource.cpp refactor: Make 64-bit shift explicit 2024-05-02 00:16:33 +01:00
pow.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
prevector.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
primitives_transaction.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
process_message.cpp Merge bitcoin/bitcoin#29421: net: make the list of known message types a compile time constant 2024-05-21 13:59:33 -04:00
process_messages.cpp refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
protocol.cpp
psbt.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
random.cpp
rbf.cpp [[refactor]] Check CTxMemPool options in constructor 2024-05-17 23:37:25 +02:00
rolling_bloom_filter.cpp
rpc.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
script.cpp Add PubKeyDestination for P2PK scripts 2023-09-12 12:14:31 -04:00
script_assets_test_minimizer.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
script_descriptor_cache.cpp
script_flags.cpp Fix IWYU for the script_flags fuzz target 2023-11-23 17:57:53 +01:00
script_format.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
script_interpreter.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
script_ops.cpp
script_parsing.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
script_sigcache.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
script_sign.cpp test: Use ECC_Context helper in bench and fuzz tests 2024-05-09 15:56:04 +02:00
scriptnum_ops.cpp
secp256k1_ec_seckey_import_export_der.cpp
secp256k1_ecdsa_signature_parse_der_lax.cpp test: Use ECC_Context helper in bench and fuzz tests 2024-05-09 15:56:04 +02:00
signature_checker.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
signet.cpp Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
socks5.cpp netbase: use reliable send() during SOCKS5 handshake 2023-10-31 18:19:37 +01:00
span.cpp
string.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
strprintf.cpp
system.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
timeoffsets.cpp Add TimeOffsets helper class 2024-04-10 17:01:27 +02:00
torcontrol.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
transaction.cpp fuzz: Drop unused version from fuzz input format 2023-11-30 11:27:21 +01:00
tx_in.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
tx_out.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
tx_pool.cpp Merge bitcoin/bitcoin#29015: kernel: Streamline util library 2024-06-12 17:12:54 -04:00
txorphan.cpp Merge bitcoin/bitcoin#30000: p2p: index TxOrphanage by wtxid, allow entries with same txid 2024-05-15 09:56:17 -04:00
txrequest.cpp
util.cpp refactor: Rename CTransaction::nVersion to version 2024-06-07 13:55:23 -04:00
util.h Remove unused version.h include 2023-11-30 11:28:19 +01:00
utxo_snapshot.cpp assumeutxo: Add network magic ctor param to SnapshotMetadata 2024-05-24 18:44:02 +02:00
utxo_total_supply.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
validation_load_mempool.cpp [[refactor]] Check CTxMemPool options in constructor 2024-05-17 23:37:25 +02:00
vecdeque.cpp tests: add fuzz tests for VecDeque 2024-06-06 17:06:15 -04:00
versionbits.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00