bip-0327: use a portable monotonic clock in the reference self-test #2278

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:bip327-portable-monotonic-clock changing 1 files +1 −1
  1. fametrano commented at 6:50 PM on September 7, 2026: contributor

    bip-0327/reference.py's self-test reads time.clock_gettime_ns(time.CLOCK_MONOTONIC) for extra_in. Both symbols are documented "Availability: Unix" in CPython, so python3 reference.py raises AttributeError on Windows.

    time.monotonic_ns() is the portable monotonic clock CPython documents for measuring elapsed time, available on all platforms since 3.7. It returns the same nanosecond int, so .to_bytes(8, 'big') is unaffected.

    Not tested on Windows; verified against CPython's platform-availability docs.

  2. bip-0327: use a portable monotonic clock in the reference self-test
    reference.py reads time.clock_gettime_ns(time.CLOCK_MONOTONIC) to vary
    extra_in across signing iterations. Both symbols are documented
    "Availability: Unix", so `python3 reference.py` raises AttributeError on
    Windows.
    
    time.monotonic_ns() is the portable monotonic clock CPython documents for
    measuring elapsed time, available on all platforms since 3.7. Not tested
    on Windows.
    fc9a1bce34
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-09 03:10 UTC

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