Skip to content

Conversation

@tnull
Copy link
Collaborator

@tnull tnull commented Nov 24, 2025

Second attempt at #240.

This is a prefactor for a following PR then using EntropySource in a VssStoreBuilder to replace #713. Will open that once this one lands.

Previously, the `Builder` allowed setting different entropy sources via
its `set_entropy...` methods, defaulting to sourcing from an
auto-generated seed file in the storage path. While this allowed for
really easy setup, it spared the user to actually think about where to
store their node secret.

Here, we therefore introduce a mandatory `NodeEntropy` object that, as
before, allows the user to source entropy from BIP39 Mnemonic, seed
bytes, or a seed file. However, it doesn't implement any default and
hence intentionally requires manually setup by the user. Moreover, this
API refactor also allows to reuse the same object outside of the
`Node`'s `Builder` in a future commit.

As we're about to expose more entropy-related things, we here introduce
a new module and start moving related types there.
Now that we don't use the `Runtime` in `VssStore` anymore, we can in
fact revert to reuse the public interface.
@tnull tnull requested a review from benthecarman November 24, 2025 14:32
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Nov 24, 2025

👋 Thanks for assigning @benthecarman as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tnull tnull force-pushed the 2025-11-introduce-mandatory-node-entropy branch 9 times, most recently from dac3510 to 982f8b1 Compare November 24, 2025 17:25
Previously, the `Builder` allowed setting different entropy sources via
its `set_entropy...` methods, defaulting to sourcing from an
auto-generated seed file in the storage path. While this allowed for
really easy setup, it spared the user to actually think about where to
store their node secret.

Here, we therefore introduce a mandatory `NodeEntropy` object that, as
before, allows the user to source entropy from BIP39 Mnemonic, seed
bytes, or a seed file. However, it doesn't implement any default and
hence intentionally requires manually setup by the user. Moreover, this
API refactor also allows to reuse the same object outside of the
`Node`'s `Builder` in a future commit.
@tnull tnull force-pushed the 2025-11-introduce-mandatory-node-entropy branch from 982f8b1 to c06b118 Compare November 24, 2025 18:18
We add a simple test calling `read_or_generate_seed_file` twice,
asserting it returns the same value in both cases.
@tnull tnull requested a review from benthecarman December 2, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants