test: round difficulty and networkhashps #32725

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2025/06/getmininginfo-precision changing 1 files +7 −8
  1. Sjors commented at 9:40 AM on June 11, 2025: member

    Both are rational numbers. Client software should only use them to display information to humans. Followup calculations should use the underlying values such as target.

    Therefore it's not necessary to test the handling of these floating point values. Round them down to avoid spurious test failures.

    Fixes #32515

  2. test: round difficulty and networkhashps
    Both are rational numbers. Client software should only use them to
    display information to humans. Followup calculations should use the
    underlying values such as target.
    
    Therefore it's not necessary to test the handling of these floating
    point values. Round them down to avoid spurious test failures.
    
    Fixes #32515
    578ea3eedb
  3. DrahtBot commented at 9:40 AM on June 11, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32725.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK w0xlt, janb84, Prabhat1308, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. DrahtBot added the label Tests on Jun 11, 2025
  5. Sjors commented at 9:44 AM on June 11, 2025: member

    Note that mining_mainnet.py uses integer difficulty values (1 and 4) so it shouldn't have this issue.

  6. w0xlt commented at 5:38 PM on June 11, 2025: contributor
  7. janb84 commented at 12:31 PM on June 12, 2025: contributor

    ACK 578ea3eedb285519762087a4b27d953d8f61667f

    • Code review ✅
    • compiled & tested ✅

    The PR changes test to use a more reasonable rounded difficulty and networkhashps to remove false positives in testing.

  8. Prabhat1308 commented at 6:17 PM on June 16, 2025: contributor

    Code Review ACK 578ea3e

    Slightly relaxing the contraint seems fine in the context of the test .

  9. achow101 commented at 11:24 PM on June 20, 2025: member

    ACK 578ea3eedb285519762087a4b27d953d8f61667f

    Was unable to replicate the original test failure, but this change seems fine.

  10. achow101 merged this on Jun 20, 2025
  11. achow101 closed this on Jun 20, 2025

  12. stringintech referenced this in commit f19e7819e9 on Jul 19, 2025
  13. alexanderwiederin referenced this in commit 9997c3d993 on Jul 25, 2025
  14. alexanderwiederin referenced this in commit 8d6ebb9c4e on Jul 28, 2025
  15. alexanderwiederin referenced this in commit 533a4585b5 on Jul 28, 2025
  16. yuvicc referenced this in commit 22f55cf11d on Aug 26, 2025
  17. bug-castercv502 referenced this in commit d4bd8a1259 on Sep 28, 2025
  18. stickies-v referenced this in commit a19c56cd7c on Nov 4, 2025
  19. Kino1994 referenced this in commit d27ec96702 on Jun 28, 2026
  20. BigcoinBGC referenced this in commit d1e525787b on Jun 30, 2026
  21. bitcoin locked this on Jul 30, 2026

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-08-14 17:51 UTC

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