fuzz: Mock CMainSignals in process_message(s) targets #26872

pull dergoegge wants to merge 3 commits into bitcoin:master from dergoegge:2023-01-fuzz-mock-signals changing 5 files +113 −10
  1. dergoegge commented at 2:47 PM on January 11, 2023: member

    Mocking CMainSignals gives us the ability to control when the CValidationInterface callbacks are called on PeerManager in the process_message(s) targets. It thereby makes these targets more deterministic/reproducable and slightly faster (per eyeball measurements 5%-10% more execs/s on my machine).

    Mostly looking for conceptual review on this because there is an argument to be made about fuzzing with the real CMainSignals in combination with TSan, so maybe preserving that behavior in another target could also make sense.

  2. [validation] Enable mocking GetMainSignals b6520fa8f5
  3. [fuzz] Mock GetMainSignals in process_message 11202f8b22
  4. [fuzz] Mock GetMainSignals in process_messages d45f1eba70
  5. dergoegge commented at 2:48 PM on January 11, 2023: member

    @MarcoFalke curious about your opinion on this (maybe this has been discussed before?)

  6. DrahtBot commented at 2:48 PM on January 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. A summary of reviews will appear here.

  7. maflcko commented at 2:56 PM on January 11, 2023: member

    For those targets, none of them should be ever hit, practically speaking. It might be better to add a new validationinterface fuzz target

  8. dergoegge commented at 3:31 PM on January 11, 2023: member

    For those targets, none of them should be ever hit, practically speaking.

    Ugh, I assumed it's possible because we add those easily spendable coinbase outputs and call SyncWithValidationInterfaceQueue, but yeah looking at the coverage there is no coverage for any of the validation callbacks. The SyncWithValidationInterfaceQueue does slow down the targets, so it's a little annoying to have that when it's practically never needed.

    I have been working on targets that more specifically fuzz certain protocol flows (e.g. the version handshake, block/tx relay). These targets mostly submit valid headers/blocks/txs to net_processing, so I guess what I am suggesting here makes more sense for them.

  9. dergoegge closed this on Jan 11, 2023

  10. bitcoin locked this on Jan 11, 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-28 21:14 UTC

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