fuzz: Generate process_message targets individually #28066

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2307-fuzz-p2p-msg- changing 2 files +74 −50
  1. maflcko commented at 2:19 PM on July 11, 2023: member

    Now that LIMIT_TO_MESSAGE_TYPE is a runtime setting after commit 927b001502a74a7224f04cfe6ffddc9a59409ba1, it shouldn't hurt to also generate each message type individually. Something similar was done for the rpc target in commit cf4da5ec29f9e8cd6cc6577e5ecbd87174edba62.

  2. DrahtBot commented at 2:19 PM on July 11, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK stickies-v, brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #27742 ([NO MERGE] BIP331 Ancestor Package Relay by glozow)
    • #27534 (rpc: add 'getnetmsgstats', new rpc to view network message statistics by satsie)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot renamed this:
    fuzz: Generate process_message targets individually
    fuzz: Generate process_message targets individually
    on Jul 11, 2023
  4. DrahtBot added the label Tests on Jul 11, 2023
  5. refactor: Remove duplicate allNetMessageTypesVec
    With C++11 (and later), the duplicate variable is no longer needed.
    
    Also, run clang-format on the namespace, as the script in the next
    commit relies on a specific format. This prevents a clang-format run in
    the future from breaking the script. (Review hint: --ignore-all-space).
    fa1471e575
  6. in test/fuzz/test_runner.py:218 in fa288032f4 outdated
     211 | @@ -214,6 +212,28 @@ def generate_corpus(*, fuzz_pool, src_dir, build_dir, corpus_dir, targets):
     212 |          ).stdout.splitlines()
     213 |          lines = [l.split("\"", 1)[1].split("\"")[0] for l in lines if l.startswith("src/test/fuzz/rpc.cpp-    \"")]
     214 |          targets += [(rpc_target, {"LIMIT_TO_RPC_COMMAND": r}) for r in lines]
     215 | +        targets += [(rpc_target, {})]  # Allow for cross-pollination
     216 | +    if has_p2p_msg:
     217 | +        lines = subprocess.run(
     218 | +            ["grep", "--only-matching", "--perl-regexp", "--null-data", r"namespace NetMsgType(\n|.)*namespace NetMsgType", os.path.join(src_dir, "src", "protocol.cpp")],
    


    brunoerg commented at 4:21 PM on July 11, 2023:

    I think --perl-regexp won't work on MacOS.

    See (MacOS 13.0 (M1)):

    ➜  bitcoin-core-dev git:(28066-marco) ✗ ./test/fuzz/test_runner.py corpus process_message -g
    1 of 168 detected fuzz target(s) selected: process_message
    Generating corpus to corpus
    grep: unrecognized option `--perl-regexp'
    usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
            [-e pattern] [-f file] [--binary-files=value] [--color=when]
            [--context[=num]] [--directories=action] [--label] [--line-buffered]
            [--null] [pattern] [file ...]
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./test/fuzz/test_runner.py", line 365, in <module>
        main()
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./test/fuzz/test_runner.py", line 165, in main
        return generate_corpus(
               ^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./test/fuzz/test_runner.py", line 236, in generate_corpus
        targets = transform_targets(targets, src_dir)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./test/fuzz/test_runner.py", line 217, in transform_targets
        lines = subprocess.run(
                ^^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['grep', '--only-matching', '--perl-regexp', '--null-data', 'namespace NetMsgType(\\n|.)*namespace NetMsgType', '/Users/brunogarcia/projects/bitcoin-core-dev/src/protocol.cpp']' returned non-zero exit status 2.
    

    examples: https://github.com/sara-nl/GridScripts/issues/2 https://github.com/sara-nl/GridScripts/commit/963139b482751320b68cc74d008b6ce27e220f38


    maflcko commented at 5:33 PM on July 11, 2023:

    thx, fixed

  7. maflcko force-pushed on Jul 11, 2023
  8. brunoerg approved
  9. brunoerg commented at 6:15 PM on July 11, 2023: contributor

    ACK bbbb996c15aef7786c3a215ed16e1913b12b0f8c

    lgtm! running ./test/fuzz/test_runner.py corpus process_message -g on this PR,target becomes:

    [('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'version'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'verack'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'addr'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'addrv2'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendaddrv2'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'inv'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getdata'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'merkleblock'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getblocks'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'tx'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'headers'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'block'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getaddr'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'mempool'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'ping'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'pong'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'notfound'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filterload'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filteradd'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filterclear'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'feefilter'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendcmpct'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cmpctblock'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getblocktxn'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'blocktxn'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfilters'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfilter'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfcheckpt'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfcheckpt'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'wtxidrelay'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendtxrcncl'}), ('process_message', {})]
    

    on master:

    [('process_message', {})]
    
  10. in test/fuzz/test_runner.py:196 in bbbb996c15 outdated
     198 | -
     199 | -    Run {targets} without input, and outputs the generated corpus to
     200 | -    {corpus_dir}.
     201 | -    """
     202 | -    logging.info("Generating corpus to {}".format(corpus_dir))
     203 | +def transform_targets(targets, src_dir):
    


    stickies-v commented at 10:37 AM on July 12, 2023:

    I was thinking about suggesting this refactoring in the previous PR, glad to see it happen here. Since there's almost no code reuse between both targets, would prefer splitting it out into 2 smaller functions. The diff below does that, plus:

    • use pathlib
    • avoid removing and then re-adding the unlimited search target (not sure if having it at the beginning instead of at the end of targets makes a meaningful difference?)
    • add some docstrings

    <details> <summary>new code</summary>

    def transform_process_message_target(targets, src_dir):
        """Add a target per process message, and also keep ("process_message", {}) to allow for
        cross-pollination, or unlimited search"""
    
        p2p_msg_target = "process_message"
        has_p2p_msg = (p2p_msg_target, {}) in targets
        if has_p2p_msg:
            with open(Path(src_dir) / "src" / "protocol.cpp", "r", encoding="utf8") as f:
                lines = f.read().splitlines()
            lines = [l.split('"', 1)[1].split('"')[0] for l in lines if l.startswith("const char")]
            assert len(lines)
            targets += [(p2p_msg_target, {"LIMIT_TO_MESSAGE_TYPE": m}) for m in lines]
        return targets
    
    def transform_rpc_target(targets, src_dir):
        """Add a target per RPC command, and also keep ("rpc", {}) to allow for cross-pollination,
        or unlimited search"""
    
        rpc_target = "rpc"
        has_rpc = (rpc_target, {}) in targets
        if has_rpc: 
            lines = subprocess.run(
                ["git", "grep", "--function-context", "RPC_COMMANDS_SAFE_FOR_FUZZING{", Path(src_dir) / "src" / "test" / "fuzz" / "rpc.cpp"],
                check=True,
                stdout=subprocess.PIPE,
                text=True,
            ).stdout.splitlines()
            lines = [l.split("\"", 1)[1].split("\"")[0] for l in lines if l.startswith("src/test/fuzz/rpc.cpp-    \"")]
            assert len(lines)
            targets += [(rpc_target, {"LIMIT_TO_RPC_COMMAND": r}) for r in lines]
        return targets
    
    def generate_corpus(*, fuzz_pool, src_dir, build_dir, corpus_dir, targets):
        """Generates new corpus.
    
        Run {targets} without input, and outputs the generated corpus to
        {corpus_dir}.
        """
        logging.info("Generating corpus to {}".format(corpus_dir))
        targets = [(t, {}) for t in targets] # expand to add dictionary for target-specific env variables
        targets = transform_process_message_target(targets, src_dir)
        targets = transform_rpc_target(targets, src_dir)
    ...
    

    </details>

    <details> <summary>git diff</summary>

    diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py
    index bef1c52f7..7ffd938e6 100755
    --- a/test/fuzz/test_runner.py
    +++ b/test/fuzz/test_runner.py
    @@ -192,20 +192,29 @@ def main():
                 empty_min_time=args.empty_min_time,
             )
     
    +def transform_process_message_target(targets, src_dir):
    +    """Add a target per process message, and also keep ("process_message", {}) to allow for
    +    cross-pollination, or unlimited search"""
     
    -def transform_targets(targets, src_dir):
    -    rpc_target = "rpc"
         p2p_msg_target = "process_message"
    -    has_rpc = rpc_target in targets
    -    has_p2p_msg = p2p_msg_target in targets
    -    if has_rpc:
    -        targets.remove(rpc_target)
    +    has_p2p_msg = (p2p_msg_target, {}) in targets
         if has_p2p_msg:
    -        targets.remove(p2p_msg_target)
    -    targets = [(t, {}) for t in targets]
    -    if has_rpc:
    +        with open(Path(src_dir) / "src" / "protocol.cpp", "r", encoding="utf8") as f:
    +            lines = f.read().splitlines()
    +        lines = [l.split('"', 1)[1].split('"')[0] for l in lines if l.startswith("const char")]
    +        assert len(lines)
    +        targets += [(p2p_msg_target, {"LIMIT_TO_MESSAGE_TYPE": m}) for m in lines]
    +    return targets
    +
    +def transform_rpc_target(targets, src_dir):
    +    """Add a target per RPC command, and also keep ("rpc", {}) to allow for cross-pollination,
    +    or unlimited search"""
    +
    +    rpc_target = "rpc"
    +    has_rpc = (rpc_target, {}) in targets
    +    if has_rpc: 
             lines = subprocess.run(
    -            ["git", "grep", "--function-context", "RPC_COMMANDS_SAFE_FOR_FUZZING{", os.path.join(src_dir, "src", "test", "fuzz", "rpc.cpp")],
    +            ["git", "grep", "--function-context", "RPC_COMMANDS_SAFE_FOR_FUZZING{", Path(src_dir) / "src" / "test" / "fuzz" / "rpc.cpp"],
                 check=True,
                 stdout=subprocess.PIPE,
                 text=True,
    @@ -213,17 +222,8 @@ def transform_targets(targets, src_dir):
             lines = [l.split("\"", 1)[1].split("\"")[0] for l in lines if l.startswith("src/test/fuzz/rpc.cpp-    \"")]
             assert len(lines)
             targets += [(rpc_target, {"LIMIT_TO_RPC_COMMAND": r}) for r in lines]
    -        targets += [(rpc_target, {})]  # Allow for cross-pollination, or unlimited search
    -    if has_p2p_msg:
    -        with open(os.path.join(src_dir, "src", "protocol.cpp"), "r", encoding="utf8") as f:
    -            lines = f.read().splitlines()
    -        lines = [l.split('"', 1)[1].split('"')[0] for l in lines if l.startswith("const char")]
    -        assert len(lines)
    -        targets += [(p2p_msg_target, {"LIMIT_TO_MESSAGE_TYPE": m}) for m in lines]
    -        targets += [(p2p_msg_target, {})]  # Allow for cross-pollination, or unlimited search
         return targets
     
    -
     def generate_corpus(*, fuzz_pool, src_dir, build_dir, corpus_dir, targets):
         """Generates new corpus.
     
    @@ -231,7 +231,9 @@ def generate_corpus(*, fuzz_pool, src_dir, build_dir, corpus_dir, targets):
         {corpus_dir}.
         """
         logging.info("Generating corpus to {}".format(corpus_dir))
    -    targets = transform_targets(targets, src_dir)
    +    targets = [(t, {}) for t in targets] # expand to add dictionary for target-specific env variables
    +    targets = transform_process_message_target(targets, src_dir)
    +    targets = transform_rpc_target(targets, src_dir)
     
         def job(command, t, t_env):
             logging.debug(f"Running '{command}'")
    
    

    </details>


    maflcko commented at 12:18 PM on July 12, 2023:

    Thanks, added your docstrings

  11. in test/fuzz/test_runner.py:218 in bbbb996c15 outdated
     210 | @@ -213,7 +211,27 @@ def generate_corpus(*, fuzz_pool, src_dir, build_dir, corpus_dir, targets):
     211 |              text=True,
     212 |          ).stdout.splitlines()
     213 |          lines = [l.split("\"", 1)[1].split("\"")[0] for l in lines if l.startswith("src/test/fuzz/rpc.cpp-    \"")]
     214 | +        assert len(lines)
     215 |          targets += [(rpc_target, {"LIMIT_TO_RPC_COMMAND": r}) for r in lines]
     216 | +        targets += [(rpc_target, {})]  # Allow for cross-pollination, or unlimited search
     217 | +    if has_p2p_msg:
     218 | +        with open(os.path.join(src_dir, "src", "protocol.cpp"), "r", encoding="utf8") as f:
    


    stickies-v commented at 11:29 AM on July 12, 2023:

    Could make this a bit more robust by only considering lines within namespace NetMsgType?

        if has_p2p_msg:
            cmd = ["awk" , "/namespace NetMsgType {/,/} \/\/ namespace NetMsgType/ { print $0 }", str(Path(src_dir) / 'src' / 'protocol.cpp')]
            lines = subprocess.run(
                cmd,
                check=True,
                stdout=subprocess.PIPE,
                text=True,
            ).stdout.splitlines()
            lines = [l.split('"', 1)[1].split('"')[0] for l in lines if l.startswith("const char")]
    

    maflcko commented at 12:17 PM on July 12, 2023:

    awk will probably fail on macOS again? Also, there shouldn't be any risk in being too greedy, because the fuzz target also validates the argument. It seems more risky to be too little greedy.


    stickies-v commented at 12:23 PM on July 12, 2023:

    Works fine here (macOS 13.4) but I'm not familiar with its portability, so if that's been an issue in the past then yeah might not be ideal. I agree that being too greedy is not a huge risk but if we can be specific I think that's still preferred. Alternatively, could also use git grep with g_all_net_message_types like we do for the rpc target - didn't see that earlier.

        if has_p2p_msg:
            lines = subprocess.run(
                ["git", "grep", "--function-context", "g_all_net_message_types{", os.path.join(src_dir, "src", "protocol.cpp")],
                check=True,
                stdout=subprocess.PIPE,
                text=True,
            ).stdout.splitlines()
            lines = [l.split("\"", 1)[1].split("\"")[0] for l in lines if l.startswith("src/protocol.cpp-    NetMsgType::")]
    

    maflcko commented at 1:11 PM on July 12, 2023:

    Thx, pushed.

  12. stickies-v commented at 11:31 AM on July 12, 2023: contributor

    Concept ACK, reviewed code mechanically and looks good too.

  13. maflcko force-pushed on Jul 12, 2023
  14. maflcko force-pushed on Jul 12, 2023
  15. in test/fuzz/test_runner.py:221 in fa68242459 outdated
     226 | -    has_rpc = rpc_target in targets
     227 | -    if has_rpc:
     228 | -        targets.remove(rpc_target)
     229 | -    targets = [(t, {}) for t in targets]
     230 | +    has_rpc = (rpc_target, {}) in targets
     231 |      if has_rpc:
    


    stickies-v commented at 1:43 PM on July 12, 2023:

    nit: has_... is not really useful anymore i guess

        if (rpc_target, {}) in targets:
    

    maflcko commented at 1:52 PM on July 12, 2023:

    thx,fixed

  16. stickies-v approved
  17. stickies-v commented at 1:46 PM on July 12, 2023: contributor

    crACK fa6824245928dfdbfce75f7e62d646c7e09c9e77

    Seems sensible to take a similar approach as in #28015, but I'm not very familiar with fuzzing so my ACK is mostly on the mechanics of the code, which LGTM.

  18. DrahtBot requested review from brunoerg on Jul 12, 2023
  19. fuzz: Generate process_message targets individually
    Also, add an "rpc" target without LIMIT_TO_RPC_COMMAND set.
    fa6245da60
  20. maflcko force-pushed on Jul 12, 2023
  21. stickies-v commented at 1:55 PM on July 12, 2023: contributor

    re-crACK fa6245da6061050eb77ad07cd4caf8c596d89dc6

  22. brunoerg approved
  23. brunoerg commented at 1:59 PM on July 12, 2023: contributor

    reACK fa6245da6061050eb77ad07cd4caf8c596d89dc6

    code lgtm! better with git grep.

    targets with rpc and process_message:

    ➜  bitcoin-core-dev git:(28066-marco) ✗ ./test/fuzz/test_runner.py corpus process_message rpc -g
    2 of 168 detected fuzz target(s) selected: process_message rpc
    Generating corpus to corpus
    [('process_message', {}), ('rpc', {}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'version'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'verack'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'addr'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'addrv2'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendaddrv2'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'inv'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getdata'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'merkleblock'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getblocks'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'tx'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'headers'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'block'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getaddr'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'mempool'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'ping'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'pong'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'notfound'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filterload'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filteradd'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filterclear'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'feefilter'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendcmpct'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cmpctblock'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getblocktxn'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'blocktxn'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfilters'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfilter'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfcheckpt'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfcheckpt'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'wtxidrelay'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendtxrcncl'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'analyzepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'clearbanned'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'combinepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'combinerawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'converttopsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'createmultisig'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'createpsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'createrawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'decodepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'decoderawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'decodescript'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'deriveaddresses'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'descriptorprocesspsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'disconnectnode'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'echo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'echojson'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'estimaterawfee'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'estimatesmartfee'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'finalizepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'generate'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'generateblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getaddednodeinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getbestblockhash'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockchaininfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockcount'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockfilter'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockfrompeer'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockhash'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockheader'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockstats'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblocktemplate'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getchaintips'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getchaintxstats'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getconnectioncount'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getdeploymentinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getdescriptorinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getdifficulty'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getindexinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmemoryinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempoolancestors'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempooldescendants'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempoolentry'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempoolinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmininginfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnettotals'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnetworkhashps'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnetworkinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnodeaddresses'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getpeerinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getprioritisedtransactions'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getrawmempool'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getrawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getrpcinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'gettxout'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'gettxoutsetinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'gettxspendingprevout'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'help'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'invalidateblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'joinpsbts'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'listbanned'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'logging'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'mockscheduler'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'ping'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'preciousblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'prioritisetransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'pruneblockchain'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'reconsiderblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'scanblocks'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'scantxoutset'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'sendrawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'setmocktime'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'setnetworkactive'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'signmessagewithprivkey'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'signrawtransactionwithkey'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'submitblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'submitheader'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'submitpackage'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'syncwithvalidationinterfacequeue'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'testmempoolaccept'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'uptime'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'utxoupdatepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'validateaddress'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'verifychain'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'verifymessage'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'verifytxoutproof'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'waitforblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'waitforblockheight'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'waitfornewblock'})]
    

    only process message:

    ➜  bitcoin-core-dev git:(28066-marco) ✗ ./test/fuzz/test_runner.py corpus process_message -g    
    1 of 168 detected fuzz target(s) selected: process_message
    Generating corpus to corpus
    [('process_message', {}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'version'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'verack'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'addr'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'addrv2'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendaddrv2'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'inv'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getdata'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'merkleblock'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getblocks'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'tx'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'headers'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'block'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getaddr'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'mempool'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'ping'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'pong'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'notfound'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filterload'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filteradd'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'filterclear'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'feefilter'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendcmpct'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cmpctblock'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getblocktxn'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'blocktxn'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfilters'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfilter'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfheaders'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'getcfcheckpt'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'cfcheckpt'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'wtxidrelay'}), ('process_message', {'LIMIT_TO_MESSAGE_TYPE': 'sendtxrcncl'})]
    

    only rpc:

    ➜  bitcoin-core-dev git:(28066-marco) ✗ ./test/fuzz/test_runner.py corpus rpc -g
    1 of 168 detected fuzz target(s) selected: rpc
    Generating corpus to corpus
    [('rpc', {}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'analyzepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'clearbanned'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'combinepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'combinerawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'converttopsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'createmultisig'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'createpsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'createrawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'decodepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'decoderawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'decodescript'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'deriveaddresses'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'descriptorprocesspsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'disconnectnode'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'echo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'echojson'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'estimaterawfee'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'estimatesmartfee'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'finalizepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'generate'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'generateblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getaddednodeinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getbestblockhash'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockchaininfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockcount'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockfilter'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockfrompeer'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockhash'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockheader'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblockstats'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getblocktemplate'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getchaintips'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getchaintxstats'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getconnectioncount'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getdeploymentinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getdescriptorinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getdifficulty'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getindexinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmemoryinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempoolancestors'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempooldescendants'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempoolentry'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmempoolinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getmininginfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnettotals'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnetworkhashps'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnetworkinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getnodeaddresses'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getpeerinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getprioritisedtransactions'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getrawmempool'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getrawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'getrpcinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'gettxout'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'gettxoutsetinfo'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'gettxspendingprevout'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'help'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'invalidateblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'joinpsbts'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'listbanned'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'logging'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'mockscheduler'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'ping'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'preciousblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'prioritisetransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'pruneblockchain'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'reconsiderblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'scanblocks'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'scantxoutset'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'sendrawtransaction'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'setmocktime'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'setnetworkactive'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'signmessagewithprivkey'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'signrawtransactionwithkey'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'submitblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'submitheader'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'submitpackage'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'syncwithvalidationinterfacequeue'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'testmempoolaccept'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'uptime'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'utxoupdatepsbt'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'validateaddress'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'verifychain'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'verifymessage'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'verifytxoutproof'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'waitforblock'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'waitforblockheight'}), ('rpc', {'LIMIT_TO_RPC_COMMAND': 'waitfornewblock'})]
    
  24. maflcko commented at 7:15 AM on July 20, 2023: member

    Anything left to do for a test-only change with two ACKs or is this rfm?

  25. fanquake merged this on Jul 20, 2023
  26. fanquake closed this on Jul 20, 2023

  27. maflcko deleted the branch on Jul 20, 2023
  28. sidhujag referenced this in commit c1f0f65db8 on Jul 21, 2023
  29. bitcoin locked this on Dec 5, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 09:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me