Repository navigation
feat(libp2p): validate config options at startup - #3659
Open
sharmis-tp wants to merge 1 commit into
Open
sharmis-tp wants to merge 1 commit into
sharmis-tp wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Related #1573
Adds config validation to the libp2p package only, as suggested on the issue; other modules can follow. validateConfig() now checks the options this package consumes directly with a valibot schema and fails fast with an InvalidParametersError that names the field, e.g. "Invalid libp2p config: addresses.listen.1 is not a valid multiaddr: foo".
Validated: address lists (listen, announce, noAnnounce, appendAnnounce, connectionManager.allow/deny) must parse as multiaddrs; connection manager limits and timeouts must be non-negative numbers (Infinity allowed); maxConnections must be > 0; connectionMonitor flags must be booleans; transportManager.faultTolerance must be a FaultTolerance value. Unknown keys are allowed so services keep their own options.
Notes & open questions
Change checklist