Skip to content

Reject unknown config options#216

Open
benthecarman wants to merge 2 commits into
lightningdevkit:mainfrom
benthecarman:deny-bad-config
Open

Reject unknown config options#216
benthecarman wants to merge 2 commits into
lightningdevkit:mainfrom
benthecarman:deny-bad-config

Conversation

@benthecarman
Copy link
Copy Markdown
Collaborator

I spent too long debugging why my node wasn't working only to find out I misspelled a config option. Now we'll throw an error if we see a config option we don't recognize.

Fail TOML parsing when unsupported config keys are present so typos do not get silently ignored. Keep the LSPS2 service section typed in all builds, while default builds still parse and ignore it unless the experimental feature is enabled.

@benthecarman benthecarman requested a review from tnull May 20, 2026 19:00
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 20, 2026

👋 Thanks for assigning @tnull 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.

Fail TOML parsing when unsupported config keys are present so typos do
not get silently ignored. Keep the LSPS2 service section typed in all
builds, while default builds still parse and ignore it unless the
experimental feature is enabled.
@tankyleo
Copy link
Copy Markdown
Contributor

Nice not sure if it's related, but I also got upset when my ldk-server-client silently dropped the config.toml file because I didn't set the network field IIRC.

@benthecarman
Copy link
Copy Markdown
Collaborator Author

Nice not sure if it's related, but I also got upset when my ldk-server-client silently dropped the config.toml file because I didn't set the network field IIRC.

? can you reproduce that seems weird

Copy link
Copy Markdown

@lorenzolfm lorenzolfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 729308c

@tankyleo
Copy link
Copy Markdown
Contributor

? can you reproduce that seems weird

Right here, it silently drops the error if the config file failed to parse.

let config = config_path.as_ref().and_then(|p| load_config(p).ok());

Wasn't sure if worth fixing

Before we would silently drop the config if we failed to parse it. This
can cause confusion as to why your cli isn't working correctly. Now if
you have a config file it'll throw an error if we can't parse it instead
of silently dropping it.
@benthecarman
Copy link
Copy Markdown
Collaborator Author

made a fix, good find!

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.

4 participants