feature: Use different datadirs for different signets #34566

pull ekzyis wants to merge 1 commits into bitcoin:master from ekzyis:signet-datadirs changing 4 files +79 −18
  1. ekzyis commented at 7:46 pm on February 11, 2026: none

    closes #27494

    This adds support for syncing multiple signets.

    Each custom signet is stored in a different datadir, using the first 8 bytes of the signet challenge in hex as the suffix.

    The default signet is always stored without a suffix for backward compatibility, even if the default challenge is provided explicitly via -signetchallenge.

    This builds upon #29838.

    For those already familiar with #29838, here are the differences between #29838 and this that are visible to the user:

    • The suffix does not use the first 4 bytes of hash160(challenge), but rather the first 8 bytes of the unhashed challenge. If desired, I can use the message start instead as suggested in #29838 (comment).
    • If the default challenge is provided to -signetchallenge, #29838 added a suffix to the datadir, whereas this PR does not. This includes backward compatibility when the default signet is used explicitly, not only implicitly, even though the default signet consensus parameters aren’t used in the explicit case.1 A test was added for this case.

    Unlike #29838, this PR does not update tests that didn’t break (rpc_bind.py, interface_bitcoin_cli.py). I have found other tests where datadir_path is used in combination with self.chain (regexp: datadir_path.*chain). I considered it inconsistent to update some tests but not all of them. I’ve decided to not update all of them to keep the scope of this PR low until feedback. I can go through all tests in a follow-up PR to make sure they don’t break when they are ever used with (custom) signet, however unlikely that might be.

    I have done some manual testing like this:

    • bitcoind -signet: ‘signet’ directory is used, IBD
    • bitcoind -signet -signetchallenge=512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae: ‘signet’ directory is used, no IBD without -addnode (see #29838 (comment))
    • bitcoind -conf="signet_default.conf": ‘signet’ directory is used
    • bitcoind -conf="signet_custom.conf": ‘signet_0014d4528367459d’ directory is used
    • bitcoin-cli getblockchaininfo with the same options (-signet, -conf, or -signet -signetchallenge)
    0# signet_default.conf
    1signet=1
    2[signet]
    3signetchallenge=512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae
    
    0# signet_custom.conf
    1signet=1
    2[signet]
    3signetchallenge=0014d4528367459d54e1545b0d0a677d2a7d71d648e0
    

    I’m new to contributing to Bitcoin Core so it’s entirely possible that I’ve missed something obvious.

    Feedback welcome on where to best define the default signet challenge for the functional tests and the C++ code to avoid duplication.


    1. could be something for a follow-up PR, or maybe it’s intentional to not mix explicit with implicit options? ↩︎

  2. DrahtBot commented at 7:47 pm on February 11, 2026: contributor

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

    Reviews

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

  3. ekzyis marked this as a draft on Feb 11, 2026
  4. ekzyis commented at 8:04 pm on February 11, 2026: none

    Will keep this in draft until I fix why tool_signet_miner.py is failing in CI (but not locally for some reason)

    Update: Ah, it’s because the CI runs it with --usecli

  5. DrahtBot added the label CI failed on Feb 11, 2026
  6. ekzyis force-pushed on Feb 11, 2026
  7. ekzyis force-pushed on Feb 12, 2026
  8. ekzyis force-pushed on Feb 12, 2026
  9. ekzyis renamed this:
    feature: Use separate datadirs for each signet
    feature: Use different datadirs for different signets
    on Feb 12, 2026
  10. ekzyis force-pushed on Feb 12, 2026
  11. ekzyis force-pushed on Feb 12, 2026
  12. DrahtBot removed the label CI failed on Feb 12, 2026
  13. ekzyis marked this as ready for review on Feb 12, 2026
  14. Use different datadirs for different signets
    This adds support for syncing multiple signets.
    
    Each custom signet is stored in a different datadir, using the first 8 bytes
    of the signet challenge in hex as the suffix.
    
    The default signet is always stored without a suffix for backward compatibility,
    even if the default challenge is provided explicitly via -signetchallenge.
    
    Co-authored-by: Brandon Odiwuor <brandon.odiwuor@gmail.com>
    33f88e04a5
  15. ekzyis force-pushed on Feb 12, 2026


ekzyis DrahtBot


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-02-17 06:13 UTC

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