check and merge config from toml and env#1962
Draft
asmogo wants to merge 5 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1962 +/- ##
==========================================
+ Coverage 71.48% 71.83% +0.34%
==========================================
Files 356 356
Lines 73857 74696 +839
==========================================
+ Hits 52798 53656 +858
+ Misses 21059 21040 -19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- check seed - no silent fallback to default config
1c0406f to
02961a9
Compare
- Don't reject on-chain-only configs: validate_lightning_config no longer
bails on an empty `[[ln]]`. from_env already guarantees at least one
payment backend (Lightning or on-chain), so the check was both redundant
and wrong for valid on-chain-only deployments.
- Remove duplicate TEST_MNEMONIC const that broke `cargo test` compilation.
- Share a single process-wide env lock between config.rs and lib.rs tests;
two separate mutexes over global std::env raced and made
test_env_var_only_config_all_backends flaky.
- Collapse the no-op LdkNode validation arm to `=> {}`.
- Drop misleading "of entropy" from the short-seed error (it measures
string bytes, not entropy).
- Fix indentation to satisfy `cargo fmt --check`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds upfront, fail-fast validation of cdk-mintd settings after TOML + env-var merge, so misconfiguration produces a clear error pointing at both the offending TOML key and env var instead of a silent default or a confusing downstream crash.
Notes to the reviewers
validate_settings()covers listen address, signing source (mnemonic / seed length / signatory URL), per-backend lightning config, database, auth, management-RPC, and Prometheus.#[serde(default)]added across config structs so partial TOML files merge cleanly with defaults and env vars.Settings::newsplit into try_new (Result) + new (panics on any error) — removes the old silent-fallback-to-defaults footgun.Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just quick-checkbefore committingcrates/cdk-ffi)