contrib: Retry signet mining after grind failure #35327

pull spacegeologist wants to merge 1 commits into bitcoin:master from spacegeologist:codex-signet-miner-grind-retry changing 2 files +97 −21
  1. spacegeologist commented at 5:48 AM on May 20, 2026: none

    Fixes #30102.

    Motivation

    bitcoin-util grind can exhaust the nonce search space for a candidate signet block header on higher difficulty chains. When this happens, contrib/signet/miner currently exits instead of trying another candidate block.

    Changes

    Retry mining when the grinder fails with Could not satisfy difficulty target. The retry rebuilds the block with an incremented block time, giving the grinder a fresh header to search.

    Other grinder failures still raise the original subprocess error.

    Test

    The functional test wraps bitcoin-util grind so the first attempt reports target exhaustion and the second attempt delegates to the real grinder. The test uses a signed signet block and records both candidate headers to verify that the retry rebuilds the block before grinding again.

    Tested locally with:

    python3 -m py_compile contrib/signet/miner test/functional/tool_signet_miner.py
    git diff --check origin/master..HEAD
    conda-build-env/bin/ninja -C build-clang22-clean bitcoind bitcoin-cli bitcoin-util
    PATH=$PWD/conda-build-env/bin:$PATH DYLD_LIBRARY_PATH=$PWD/conda-build-env/lib HOME=$PWD/.conda-home CONDA_NUMBER_CHANNEL_NOTICES=0 CONDA_NO_PLUGINS=true CONDA_PKGS_DIRS=$PWD/.conda-pkgs XDG_CACHE_HOME=$PWD/.cache conda-build-env/bin/python build-clang22-clean/test/functional/test_runner.py --jobs=1 tool_signet_miner.py
    
  2. DrahtBot added the label Scripts and tools on May 20, 2026
  3. DrahtBot commented at 5:49 AM on May 20, 2026: 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/35327.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. contrib: Retry signet mining after grind failure
    bitcoin-util grind can exhaust the nonce search space on higher difficulty signet chains. Retry with a fresh block header by incrementing the block time when the grinder reports that it could not satisfy the target.
    
    Add functional test coverage for the retry path using a signed signet block. The grinder wrapper fails the first attempt, records each candidate header, and verifies the retry rebuilds the block before delegating to bitcoin-util grind.
    
    Fixes #30102.
    4cd373d7cf
  5. spacegeologist force-pushed on May 20, 2026
  6. spacegeologist marked this as ready for review on May 20, 2026
  7. sedited commented at 12:25 PM on May 20, 2026: contributor

    AI Slop.

  8. sedited closed this on May 20, 2026

  9. maflcko commented at 2:59 PM on May 20, 2026: member

    ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL_1FAEFB6177B4672DEE07F9D3AFC62588CCD2631EDCF22E8CCC1FB35B501C9C86

  10. spacegeologist commented at 3:24 PM on May 20, 2026: none

    Fair enough. Consider this attempt failed proof-of-work. :) Cheers.


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-22 20:51 UTC

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