Fix unsigned integer overflow in tapscript validation weight calculation #24217

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

    Change the tapscript validation weight constants from uint64_t to int64_t, since the type of m_validation_weight_left is also int64_t. Otherwise this will cause sanitizer warnings.

    This should be safe because signed integer overflow isn't expected to happen.

  2. Fix unsigned integer overflow in tapscript validation weight calculation fadc54b79b
  3. MarcoFalke cross-referenced this on Jan 31, 2022 from issue Fix unsigned integer overflows in interpreter by MarcoFalke
  4. MarcoFalke commented at 3:50 PM on January 31, 2022: member

    On my system, this commit doesn't change the binary for gcc with O2, but it does change it for clang

  5. DrahtBot added the label Consensus on Jan 31, 2022
  6. PastaPastaPasta approved
  7. PastaPastaPasta commented at 5:13 AM on February 1, 2022: contributor

    utACK fadc54b79b14ba0bbdcf5eff1277295851fe7a9e

  8. MarcoFalke commented at 10:39 AM on February 1, 2022: member

    centos 8 CI failure can be ignored

  9. theStack approved
  10. theStack commented at 12:28 PM on February 1, 2022: contributor

    Code-review ACK fadc54b79b14ba0bbdcf5eff1277295851fe7a9e

    For reference, these are the only instances where the constants VALIDATION_WEIGHT_{PER_SIGOP_PASSED,OFFSET} are used: https://github.com/bitcoin/bitcoin/blob/133f73e86bd7c3114263500be2fb5090dd76b4bc/src/script/interpreter.cpp#L386 https://github.com/bitcoin/bitcoin/blob/133f73e86bd7c3114263500be2fb5090dd76b4bc/src/script/interpreter.cpp#L1953

  11. luke-jr approved
  12. luke-jr commented at 8:53 PM on February 5, 2022: member

    utACK

  13. MarcoFalke merged this on Feb 7, 2022
  14. MarcoFalke closed this on Feb 7, 2022

  15. MarcoFalke deleted the branch on Feb 7, 2022
  16. sidhujag referenced this in commit 60fac3010d on Feb 7, 2022
  17. bitcoin locked this on Feb 7, 2023

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-05-20 06:53 UTC