fuzz: Rework rpc fuzz target #35860

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2608-fuzz-new-rpc changing 1 files +64 −48
  1. maflcko commented at 11:54 AM on August 1, 2026: member

    The rpc fuzz target constructs a vector of string args and passes that to RPCConvertValues.

    This has many issues:

    • Each of those strings could represent an array itself. E.g. via range argument or via ConsumeArrayRPCArgument. However, those strings may not be converted to an array via RPCConvertValues and just be passed on as string argument. Having a call to ConsumeArrayRPCArgument that ends up with a plain json string is confusing.
    • The strings could only represent an object or json null, when a raw string represented such a serialized json and was also converted to one via RPCConvertValues. Having a call to ConsumeScalarRPCArgument that was intended to give a raw string but ends up with a arbitrary json object is confusing.

    Fix those "stringly-typed" issues by making the fuzz target "type safe":

    • Rename ConsumeScalarRPCArgument to ConsumeBasicRPCArgument and return a proper UniValue from it.
    • The "consume string" case inside that function, which had a "double meaning" is turned into two type-safe cases: One that returns a json string and one that reads an arbitrary json from a string.
    • A new case for json null is added.
    • ConsumeRPCArgument is changed to cover both json arrays and json dicts properly.
    • Pass the resulting positional UniValue array directly to the RPC method, avoiding the need for RPCConvertValues.

    Making the fuzz target "type safe" is also the first step in making it schema-aware.

  2. DrahtBot added the label Fuzzing on Aug 1, 2026
  3. DrahtBot commented at 11:54 AM on August 1, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35860.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK dergoegge

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. maflcko force-pushed on Aug 1, 2026
  5. DrahtBot added the label CI failed on Aug 1, 2026
  6. DrahtBot commented at 12:51 PM on August 1, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task tidy: https://github.com/bitcoin/bitcoin/actions/runs/30698617249/job/91365600298</sub> <sub>LLM reason (✨ experimental): CI failed because clang-tidy reported misc-no-recursion errors (recursive call chain in test/fuzz/rpc.cpp, treated as warnings-as-errors).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. maflcko force-pushed on Aug 1, 2026
  8. maflcko force-pushed on Aug 1, 2026
  9. fuzz: Rework rpc fuzz target fa895bb77a
  10. maflcko force-pushed on Aug 1, 2026
  11. DrahtBot removed the label CI failed on Aug 1, 2026
  12. dergoegge approved
  13. dergoegge commented at 10:48 AM on August 3, 2026: member

    utACK fa895bb77a8a061734d6626fde40090ad231ad5d

  14. fanquake merged this on Aug 3, 2026
  15. fanquake closed this on Aug 3, 2026

  16. maflcko deleted the branch on Aug 3, 2026
Labels

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-08-03 23:51 UTC

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