Use cardano-config to read the node configuration - #6671
Open
jasagredo wants to merge 2 commits into
Open
Conversation
The node now recognises two configuration dialects and picks the parser
each one calls for:
* a legacy (pre-cardano-config) configuration is resolved with the
node's own POM parser, as before, and additionally with
cardano-config (which migrates it on the fly). The node runs on the
POM result; every field the two parsers disagree on is traced as a
non-fatal warning at startup, so the two can be reconciled before POM
is dropped.
* a cardano-config envelope configuration ({ $schema, Version,
Configuration }) is resolved with cardano-config alone. The POM
parser cannot read one at all — every setting lives nested under
Configuration, so POM sees a document with none of the keys it
requires — so it is not run, and a failure on this path is fatal
rather than a warning: there is no second parser to fall back to.
Its tracing configuration is resolved along with the rest and handed
to initTraceDispatcher, since trace-dispatcher's own file parser
would not find the tracing keys inside the envelope either.
CardanoConfigAdapter maps a cardano-config-resolved configuration onto
the node's own NodeConfiguration; CardanoConfigCompare diffs two of
those field by field; CardanoConfigResolve classifies the file and
dispatches. Fields the adapter cannot populate are listed in
adapterGaps, and each shows up concretely as a divergence in the
legacy cross-check.
cardano-node grows migrate/schema/resolve, spliced from the shared cardano-config:commands sublibrary. migrate and schema are cardano-config's own commands unchanged; resolve is a node-specific variant that, for a legacy configuration, additionally re-resolves it with the node's own parser and reports any discrepancy (exiting non-zero when they disagree), so it doubles as a CI parity check while the node still has two parsers. On an envelope configuration there is nothing to cross-check against and it says so. The test suite covers both dialects on a fixture configuration carried in both forms — config.json and the config-envelope.json that `cardano-node migrate` produces from it — asserting that the legacy form's parser divergences stay inside the documented residual set, that the envelope is classified as one and genuinely defeats the POM parser, and that migrating does not change what the configuration resolves to.
jasagredo
force-pushed
the
js/cardano-config-2
branch
from
September 1, 2026 14:13
31d88a6 to
fb6616c
Compare
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.
Add your description here, if it fixes a particular issue please provide a
link
to the issue.
Checklist
See Running tests for more details
CHANGELOG.mdfor affected packagecardano-node-chairman,cardano-submit-apiandcardano-testnetinstead need achangelog fragment in
<package>/.changes/, because theirCHANGELOG.mdis generatedfrom fragments at release time. Copy
_TEMPLATE.ymlfrom that directory, or runnix run github:input-output-hk/cardano-dev#herald -- new.cabalfiles are updatedhlint. See.github/workflows/check-hlint.ymlto get thehlintversionstylish-haskell. See.github/workflows/stylish-haskell.ymlto get thestylish-haskellversionghc-9.6andghc-9.12Note on CI
If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.