fuzz: net, add `recv_flood_size`, `prefer_evict` in `ConsumeNode` #27678

pull brunoerg wants to merge 2 commits into bitcoin:master from brunoerg:2023-05-fuzz-net-consumenode changing 2 files +10 −2
  1. brunoerg commented at 7:41 PM on May 16, 2023: contributor

    This PR adds recv_flood_size and prefer_evict in CNodeOptions when creating a new CNode in ConsumeNode. I noticed they were missing while working on an improvement for net fuzzing.

    Checked that #27324 added recv_flood_size into CNodeOptions and #25962 addedprefer_evict.

  2. DrahtBot commented at 7:41 PM on May 16, 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.

  3. DrahtBot added the label Tests on May 16, 2023
  4. dergoegge commented at 8:16 AM on May 18, 2023: member

    I think this would be a good thing to do if our current targets would be fuzzing the logic that these params are influencing (afaict this is not the case right now) but without that it unfortunately just invalidates our input corpora.

    • prefer_evict is only used in CConnman::AttemptToEvictConnection which is currently not being fuzzed.
    • recv_flood_size is used to set the value of CNode::fPauseRecv which is used to determine if we should stop reading from the socket in CConnman::GenerateWaitSockets but this is also not being fuzzed.

    Feel free to double check: https://marcofalke.github.io/b-c-cov/fuzz.coverage/src/net.cpp.gcov.html

    So I would prefer not to do this, unless we are also adding targets that fuzz the desired logic.

  5. brunoerg commented at 10:10 AM on May 18, 2023: contributor

    So I would prefer not to do this, unless we are also adding targets that fuzz the desired logic.

    I noticed they were missing while working on net fuzzing improvement, so would be better to add recv_flood_size and prefer_evict just when adding coverage for functions that use them? I thought spliting could be better, but I can open a PR adding the targets or update this one.

  6. dergoegge commented at 10:12 AM on May 18, 2023: member

    so would be better to add them just when adding coverage for functions that use them?

    Yes I think that would be better, otherwise there is no need to add them.

  7. brunoerg commented at 10:13 AM on May 18, 2023: contributor

    Yes I think that would be better, otherwise there is no need to add them.

    Ok, cool. I will change this PR to draft.

  8. brunoerg marked this as a draft on May 18, 2023
  9. fanquake commented at 10:14 AM on May 18, 2023: member

    I think it can just be closed for now? Can be re-opened when there are relevant changes.

  10. brunoerg force-pushed on May 18, 2023
  11. brunoerg commented at 4:53 PM on May 18, 2023: contributor

    @dergoegge I just removed perfer_evict from ConsumeNode, kept recv_flood_size and added target for MarkReceivedMsgsForProcessing.

    MarkReceivedMsgsForProcessing uses m_recv_flood_size and plays with vRecvMsg which may be filled by ReceiveMsgBytes.

    If it makes sense for a PR scope, I can update the description and we can go ahead this way here. Otherwise, it's ok for me to close it for now and add recv_flood_size and prefer_evict alongside with more appropriate net targets.

  12. brunoerg force-pushed on May 18, 2023
  13. DrahtBot added the label CI failed on May 18, 2023
  14. fuzz: net, add `recv_flood_size` in `ConsumeNode` afed62652c
  15. fuzz: net, add coverage for `MarkReceivedMsgsForProcessing` 9419d4308e
  16. brunoerg force-pushed on May 19, 2023
  17. DrahtBot removed the label CI failed on May 19, 2023
  18. dergoegge commented at 10:54 AM on May 22, 2023: member

    MarkReceivedMsgsForProcessing uses m_recv_flood_size and plays with vRecvMsg which may be filled by ReceiveMsgBytes.

    This still doesn't do anything besides setting fPauseRecv. You'd also want to fuzz the logic that uses fPauseRecv (i.e. CConnman::SocketHandler).

    it's ok for me to close it for now and add recv_flood_size and prefer_evict alongside with more appropriate net targets.

    That would be better. Fwiw we already have a target for fuzzing the eviction logic in isolation called node_eviction, so prefer_evict is probably less interesting.

  19. brunoerg closed this on May 22, 2023

  20. bitcoin locked this on May 21, 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-20 03:13 UTC

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