Repository navigation
feature: Use different datadirs for different signets - #34566
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34566. ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsNo conflicts as of last run. LLM Linter (✨ experimental)Possible places where comparison-specific test macros should replace generic comparisons:
2026-09-11 21:13:26 |
|
Will keep this in draft until I fix why Update: Ah, it's because the CI runs it with |
f848e12 to
6dadea4
Compare
3fe04ed to
5454907
Compare
5454907 to
33f88e0
Compare
|
This hasn't gotten any attention so far. @ajtowns do you want to take a look here since you opened the original issue? |
|
rebased on master (b730dc3) |
a2d7551 to
63cf334
Compare
|
concept ACK, I use a lot of different signets for educational projects and we could really use this. Personally I feel like using the magic bytes (message start) makes more sense and is less likely to collide between signet challenges |
ViniciusCestarii
left a comment
There was a problem hiding this comment.
ACK ab56c78
Reviewed and tested changes locally.
pinheadmz
left a comment
There was a problem hiding this comment.
ACK ab56c78
Built and tested (with and without --cli) on macos/arm64. Reviewed all changes, everything looks good. Tested with various arguments, challenges and cli commands. Tried running several signets from same machine. Happy to re-ack if @ViniciusCestarii nits are addressed.
A few non blocking notes below.
Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ACK ab56c78a9929a8e62d377de3dc64d8a81fd85284
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCAA5FiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmpo5R4bFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEOfimEtiick69L8P/1rJg++qSndTVfJs2obF
/4pmz7CrgGMaJ6fZZRc62pjGUFHYNtYQOqt9EfAP7sGUwAWXemvAiYacrXk6Am/u
OoxZC64wWcAOJgmHdxcAMK7UlErxe6oeUXzRKeLhbAlynzCjihiNtJFeeNGf3Mq4
z7mqiyaeCeq3U2JlRPVgUyI9lQcbhUhOC1hg1MuxaDnEtsAT1RfMhRvPYk5qfh/U
/wpsVQKowDL0CoxYbcuyHRvyRWJNfqDMWUJixEZwJvt4qL/56AGFArxvcYkR00ZJ
r17sHl/263L9FYLCk+OAAPZKhRIyXvMOXePAe1JRAkFDGzlbdiiUrbVncu3dJ8cT
kg2SMSsWMY05rBUj7GEsjfNQYz64+08yJaqdoouLZ/3uTL9WfHhKzC1LlUinQtUy
x5+Zfw1QFf/WDxoTl7zudpmYgLZm/avfmyiuedyPSncCJ8kaG1VlBsZdejscTjmI
2c5RG+bQSVp7Hg/8fYkRJr95wQF43Tk8uI2SOyaLvdiSZzHuFU/TqnMaOBPnmdon
KMS8zY6NGp2Nrd1GMpg8f/6xp9bWSW0UG46eEG+cT/7tOkJoXnUTz1RT4q6zmLH6
n1cXAaPbKDn7dXJIAFdRWbczxz1qt1zSCrAfV8IkXAAcPqyTaEIziqxxGNH+p56T
ir2Uz/aHIDqVjmxjiHRNJ+c2
=lFTf
-----END PGP SIGNATURE-----
pinheadmz's public key is on openpgp.org
|
Thanks for all the reviewz ❤️ 40b712e removed unnecessary test testing the test framework, see #34566 (comment) git range-diff master ab56c78 40b712e |
pinheadmz
left a comment
There was a problem hiding this comment.
re-ACK 40b712e
Minimal change since last review, just remove an unnecessary functional test.
Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ACK 40b712e80ba1930766892ac5da9dc50e1837f5fd
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCAA5FiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmpqC0gbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEOfimEtiick66Q4P/ims1GazlwLyVwwBSfZ3
7+DaxyZxlRlskkAOfa7lrt+txC3MYpNktIZ1swZQ7w4DbYyE7pyp4SLpwkrNEhgd
bZE4kWAvwBU2xrKT0SQx0SPKDc2mpkjOpBCqstZS0sR/t872/DkIh2gJE4JoxAOF
Bmmi0C1oxJ8QHVJT6QoM1J7GQym0hplBcRSDEfhDdH2NtjqMGF42n1E1tamPjKSG
LacGk1PxBhAF/BVn6Rg029GD8d6QzV+W6nSmpDSX6wP2VmguVn6heRbzDdZf20oE
hElJvY6bY8okzJDJkt+xNDsGCQjfmXDfct/i7mtHmkwJYnsawhhVhtFDN1xsWNBN
x9nRDjbXlEGJpz5JIJXX1W8ReK4q234jwaS0fXZUiUlLzA8jlfsJ6ZEe1VcJyX8l
nIEtKSaL41v5x15JjXcxZcGwTIcZ5DQg2h8j8ZDOPXvO1CwABngYLteDGs9aEseQ
iplcI+YgOR/jBqwrZmkA05M5I8BDZ0O/2Ruvgalok9nsgvrXoz2T53gNBJYzm8f8
GeSkFmK/Ok+LeKLeq3fP5fyVkCFaqUyfgaOwrT5R9aeFKSgtXthSmG3mDP+v9SLW
JI+oIPeHVLUpxs6CxP0UlNGlb3jQsZajhhmTbx0veqtSAslKwDqw7SusgE+gEEfi
hX2XKSzmoSCNZujNY7LDepNB
=sGEv
-----END PGP SIGNATURE-----
pinheadmz's public key is on openpgp.org
|
I also built and ran the fuzzer from this branch just to make sure nothing got bumped 👍 |
|
@ajtowns @pinheadmz @ViniciusCestarii can you take another look? Would be nice to ship this. |
pinheadmz
left a comment
There was a problem hiding this comment.
ACK f3be3f6
Built and tested on macos/arm64. Left a few non-blocking comments below. Major change since last review is moving the signet constants to a header file for cleaner build. New test coverage for empty challenge is nice too.
Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ACK f3be3f67a1817348f0aa219bfab7c3382c840333
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCAA5FiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmqhumUbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEOfimEtiick6F6QP/RaB91lhoD2YKgSajK51
eWNVehrfg80gp0amVijL7xer3nt11TkJTYrI1u52HXshsid6VAUH5I2eYaYdxSLF
vUWtYIIeP6/H71hb74ns8AOShMO+dOy0BssFBi1uycWuU0aEjvIs5eyY7gM4fYsU
vfN1CrnFQ8QixdIdtMn8XQ2sCAX66kVVJU+/HE9yV9QxnsWqVvziSmbjC0FeP/bo
KH+RI0aP2Gol2PhK/hQtn59+KNNPs6O5Kv74voKgtdM3kE1Llhb4oh95jDjfsl/f
/oTYlPBn8iCf9Z/IDfzHLroOeD7hKTeByh3JbF7r0Gu+YAg1RAoOZPNwZ9ZXZoSs
aofg1cVrNQz+PnUT12DNwF5+aE/f9vgkKrXg3FOyvc7hQ6qKMdwsxTt8YnDlFd+S
NEGYwaG6qtMOPXpeqmFTZDMP74JXkBLhpEm0d5soyoyn36+lDeGPMETSs9Asq9Hy
/s+vK2Fh/ihHpR2N8eerx8brUVVK0KicAKULr/gLYjjl17bIdsKljO4wWnQMWzfp
f6cCU29HSweyV1IynCrrgRJZm3o5gzySaGvt9RWOJEUbMfHUXJrMnWDToJBwLwyq
pksxkWqtOcJt2YA1g1k86z4SOqtl7UmptIB4dAq2dcKLKhQxRYAlDW3hcE64sLpA
icxpTE3TTiquEyK2YyHGtzJV
=yQq9
-----END PGP SIGNATURE-----
pinheadmz's public key is on openpgp.org
We want to reuse SIGNET_DEFAULT_CHALLENGE and GetSignetMessageStart in the following commit, so we import them from a new signet header in src/kernel. We created a new header file instead of reusing src/signet.h to avoid unnecessary changes to any CMakeLists.txt.
This adds support for syncing multiple signets. Each custom signet is stored in a different datadir, using the network magic (message start) 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 <[email protected]>
Co-authored-by: Brandon Odiwuor <[email protected]>
| @@ -0,0 +1,20 @@ | |||
| Network changes | |||
There was a problem hiding this comment.
I don't think this belongs in network changes, but not sure what header to give this either. Maybe "Updated Settings"?
There was a problem hiding this comment.
I think "Updated Settings" is better! IIRC I tried to find examples in the past of similar changes to see what they used, but couldn't find any or it was a skill issue.
(I'll wait a few days for more feedback before force-pushing a different commit.)
| -------------------------------|-------------------- | ||
| `-signet -signetchallenge=...` | *path_to_datadir*`/signet_XXXXXXXX/` | ||
|
|
||
| (It will still use `/signet/` for the default signet or if the default signet challenge is passed to `-signetchallenge`.) |
There was a problem hiding this comment.
nit: maybe "still" here is bad because it unnecessarily refers to missing context (the past) (like LLMs that include context of the conversation in their comments 😅)
|
ACK feeb00a Changes since last review are rephrasing an error message, adding a test for it, and rephrasing the release note. p.s. "Network Changes" may not be right for the release note, could just be "Signet Changes". Doesn't really matter until release time though right? Show Signaturepinheadmz's public key is on openpgp.org |
closes #27494
This adds support for syncing multiple signets.
Each custom signet is stored in a different datadir, using the network magic (message start) 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:
-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 wheredatadir_pathis used in combination withself.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:
manual testing
-addnode(see #29838 (comment)) or existing peers.dat:Tested RPC with
bitcoin-cli getblockchaininfowith the same options (-signet,-conf, or-signet -signetchallenge)I'm new to contributing to Bitcoin Core so it's entirely possible that I've missed something obvious.
Footnotes
could be something for a follow-up PR, or maybe it's intentional to not mix explicit with implicit options? ↩