bitcoin/src/test/fuzz
Andrew Chow 01bd9d7b99
Merge bitcoin/bitcoin#28523: rpc: add hidden getrawaddrman RPC to list addrman table entries
352d5eb2a9 test: getrawaddrman RPC (0xb10c)
da384a286b rpc: getrawaddrman for addrman entries (0xb10c)

Pull request description:

  Inspired by `getaddrmaninfo` (#27511), this adds a hidden/test-only `getrawaddrman` RPC. The RPC returns information on all addresses in the address manager new and tried tables. Addrman table contents can be used in tests and during development.

  The RPC result encodes the `bucket` and `position`, the internal location of addresses in the tables, in the address object's string key. This allows users to choose to consume or to ignore the location information. If the internals of the address manager implementation change, the location encoding might change too.

  ```
  getrawaddrman

  EXPERIMENTAL warning: this call may be changed in future releases.

  Returns information on all address manager entries for the new and tried tables.

  Result:
  {                                  (json object)
    "table" : {                      (json object) buckets with addresses in the address manager table ( new, tried )
      "bucket/position" : {          (json object) the location in the address manager table (<bucket>/<position>)
        "address" : "str",           (string) The address of the node
        "port" : n,                  (numeric) The port number of the node
        "network" : "str",           (string) The network (ipv4, ipv6, onion, i2p, cjdns) of the address
        "services" : n,              (numeric) The services offered by the node
        "time" : xxx,                (numeric) The UNIX epoch time when the node was last seen
        "source" : "str",            (string) The address that relayed the address to us
        "source_network" : "str"     (string) The network (ipv4, ipv6, onion, i2p, cjdns) of the source address
      },
      ...
    },
    ...
  }

  Examples:
  > bitcoin-cli getrawaddrman
  > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrawaddrman", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
  ```

ACKs for top commit:
  willcl-ark:
    reACK 352d5eb2a9
  amitiuttarwar:
    reACK 352d5eb2a9
  stratospher:
    reACK 352d5eb.
  achow101:
    ACK 352d5eb2a9

Tree-SHA512: cc462666b5c709617c66b0e3e9a17c4c81e9e295f91bdd9572492d1cb6466fc9b6d48ee805ebe82f9f16010798370effe5c8f4db15065b8c7c0d8637675d615e
2023-10-03 11:38:20 -04:00
..
util Merge bitcoin/bitcoin#26312: Remove Sock::Get() and Sock::Sock() 2023-10-03 09:57:46 -04:00
addition_overflow.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
addrman.cpp scripted-diff: use SER_PARAMS_OPFUNC 2023-09-14 10:25:26 +10:00
asmap.cpp
asmap_direct.cpp
autofile.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
banman.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
base_encode_decode.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
bech32.cpp
bip324.cpp fuzz: introduce and use ConsumePrivateKey helper 2023-09-06 13:59:12 +02:00
bitdeque.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
block.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
block_header.cpp
blockfilter.cpp
bloom_filter.cpp
buffered_file.cpp Make BufferedFile to be a CAutoFile wrapper 2023-09-15 14:34:17 +02:00
chain.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
checkqueue.cpp refactor: Use move semantics in CCheckQueue::Loop 2023-03-21 13:04:21 +00:00
coins_view.cpp fuzz: coins_view: remove an incorrect assertion 2023-08-11 18:11:07 +02:00
coinscache_sim.cpp Exercise non-DIRTY spent coins in caches in fuzz test 2023-02-03 10:33:31 -05:00
connman.cpp rpc: addnode arg to use BIP324 v2 p2p 2023-10-02 18:10:30 -04: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 [refactor] Add missing includes for next commit 2023-09-12 22:51:42 +02:00
deserialize.cpp fuzz: Rework addr fuzzing 2023-09-13 16:12:51 +02:00
eval_script.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
fee_rate.cpp
fees.cpp
flatfile.cpp Refactor: Remove unused FlatFilePos::SetNull 2023-03-21 13:54:11 +01:00
float.cpp
fuzz.cpp fuzz: Add missing PROVIDE_FUZZ_MAIN_FUNCTION guard to __AFL_FUZZ_INIT 2023-09-19 13:41:24 +02:00
fuzz.h scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
FuzzedDataProvider.h fuzz: Bump FuzzedDataProvider.h 2023-07-17 09:39:52 +02:00
golomb_rice.cpp Remove unused GetType() from OverrideStream, CVectorWriter, SpanReader 2023-09-19 14:19:57 +00:00
headerssync.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02: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 Merge bitcoin/bitcoin#25619: net: avoid overriding non-virtual ToString() in CService and use better naming 2023-02-17 13:34:40 -05:00
i2p.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
integer.cpp Clean up things that include script/standard.h 2023-08-14 17:38:27 -04:00
key.cpp Make WitnessUnknown members private 2023-09-12 12:14:31 -04:00
key_io.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
kitchen_sink.cpp
load_external_block_file.cpp Make BufferedFile to be a CAutoFile wrapper 2023-09-15 14:34:17 +02:00
locale.cpp
merkleblock.cpp
message.cpp fuzz: introduce and use ConsumePrivateKey helper 2023-09-06 13:59:12 +02:00
mini_miner.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
miniscript.cpp miniscript: make GetStackSize independent of P2WSH context 2023-08-25 11:56:09 +02:00
minisketch.cpp
muhash.cpp
multiplication_overflow.cpp
net.cpp Use serialization parameters for CAddress serialization 2023-09-05 10:13:25 +02:00
net_permissions.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
netaddress.cpp net, refactor: pass reference for peer address in GetReachabilityFrom 2023-06-05 11:02:47 -04:00
netbase_dns_lookup.cpp p2p, refactor: return std::optional<CNetAddr> in LookupHost 2023-05-26 13:41:07 -03:00
node_eviction.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
p2p_transport_serialization.cpp net: expose transport types/session IDs of connections in RPC and logs 2023-10-02 18:11:11 -04:00
package_eval.cpp Add package evaluation fuzzer 2023-09-27 16:27:05 -04: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 scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
policy_estimator.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
policy_estimator_io.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
poolresource.cpp Add PoolResource fuzzer 2023-03-23 19:38:38 +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
process_message.cpp assumeutxo cleanup: Move IsInitialBlockDownload & NotifyHeaderTip to ChainstateManager 2023-08-18 12:52:30 -04:00
process_messages.cpp net: move message conversion to wire bytes from PushMessage to SocketSendData 2023-08-23 20:13:49 -04:00
protocol.cpp
psbt.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
random.cpp
rbf.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
rolling_bloom_filter.cpp
rpc.cpp Merge bitcoin/bitcoin#28523: rpc: add hidden getrawaddrman RPC to list addrman table entries 2023-10-03 11:38:20 -04:00
script.cpp Add PubKeyDestination for P2PK scripts 2023-09-12 12:14:31 -04:00
script_assets_test_minimizer.cpp Remove unused GetType() from OverrideStream, CVectorWriter, SpanReader 2023-09-19 14:19:57 +00:00
script_bitcoin_consensus.cpp
script_descriptor_cache.cpp
script_flags.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05:00
script_format.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
script_interpreter.cpp
script_ops.cpp
script_sigcache.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
script_sign.cpp Merge bitcoin/bitcoin#25284: net: Use serialization parameters for CAddress serialization 2023-09-07 11:34:34 +01:00
scriptnum_ops.cpp
secp256k1_ec_seckey_import_export_der.cpp
secp256k1_ecdsa_signature_parse_der_lax.cpp Adapt to libsecp256k1 API changes 2022-12-13 15:08:24 -05: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 scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
socks5.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
span.cpp
spanparsing.cpp
string.cpp Merge bitcoin/bitcoin#27576: kernel: Remove args, settings, chainparams, chainparamsbase from kernel library 2023-06-09 14:58:49 -04:00
strprintf.cpp
system.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
timedata.cpp
torcontrol.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
transaction.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
tx_in.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
tx_out.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
tx_pool.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
txorphan.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
txrequest.cpp
util.cpp Add PubKeyDestination for P2PK scripts 2023-09-12 12:14:31 -04:00
util.h Merge bitcoin/bitcoin#25284: net: Use serialization parameters for CAddress serialization 2023-09-07 11:34:34 +01:00
utxo_snapshot.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00
utxo_total_supply.cpp [fuzz] Only check duplicate coinbase script when block was valid 2023-06-03 15:37:11 +02:00
validation_load_mempool.cpp refactor: Add and use kernel::ImportMempoolOptions 2023-08-07 11:32:34 +02:00
versionbits.cpp scripted-diff: Use new FUZZ_TARGET macro everywhere 2023-07-13 20:37:14 +02:00