fuzz: Limit fuzzed time to years 2000-2100 #23992

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2201-fuzzTimeMin changing 2 files +2 −3
  1. MarcoFalke commented at 4:12 PM on January 6, 2022: member

    It doesn't make sense to fuzz times in the past, as Bitcoin Core will refuse to start in the past.

    Fix that and also remove a sanitizer suppression, which would be hit in net_processing in ProcessMessage:

    
                 if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
                     addr.nTime = nNow - 5 * 24 * 60 * 60; // <-- Here 
    

    This changes the format of fuzz inputs. Previously a time value was (de)serialized as 40 bytes, now it is 32 bytes.

  2. DrahtBot added the label Tests on Jan 6, 2022
  3. mzumsande commented at 9:17 PM on January 6, 2022: member

    Apperently this is not enough to remove the sanitizer suppression, see fuzzer fails for large values - the problem is that nTime is of type uint32_t, which can't go beyond the year 2106, whereas the fuzzed nNow is int64_t.

  4. fuzz: Limit fuzzed time to years 2000-2100 fa7238300c
  5. MarcoFalke force-pushed on Jan 10, 2022
  6. MarcoFalke renamed this:
    fuzz: Set min fuzzed time to y2k
    fuzz: Limit fuzzed time to years 2000-2100
    on Jan 10, 2022
  7. MarcoFalke commented at 1:32 PM on January 10, 2022: member

    Thanks, done!

  8. mzumsande commented at 2:26 PM on January 11, 2022: member

    Code Review ACK fa7238300c18938cdf627cacfc58d4b81602417f

    I think we don't lose a lot of generality by restricting ConsumeTime() like this, since it basically used for setting the mock time, where times outside the range 2000-2100 aren't realistic. Being able to remove the sanitizer suppression for all of net_processing seems more important.

  9. MarcoFalke commented at 2:36 PM on January 11, 2022: member

    2000-2100 aren't realistic

    Indeed. For now. If someone fixes the 2106 bug, then at the same time the fuzzed range can be extended.

  10. MarcoFalke merged this on Jan 17, 2022
  11. MarcoFalke closed this on Jan 17, 2022

  12. MarcoFalke deleted the branch on Jan 17, 2022
  13. sidhujag referenced this in commit b7804dbcc3 on Jan 18, 2022
  14. DrahtBot locked this on Jan 17, 2023
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-04-17 06:14 UTC

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