Repository navigation
Use cardano-config for cardano config parsing - #1379
Merged
Merged
Conversation
palas
requested review from
a team,
CarlosLopezDeLara,
Jimbo4350,
carbolymer,
disassembler and
erikd
as code owners
October 16, 2026 16:59
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Public API and consensus-initialization changes warrant human validation, with configured Dijkstra genesis selection still lacking regression coverage.
1 open finding
What changed in this PR
Replaces duplicated node-configuration parsing with cardano-config in ledger-state initialization.
Changes:
- Wraps
NodeConfigurationand exposes accessor functions. - Reuses validated genesis data, including configured Dijkstra genesis.
- Adds parsing tests and fixtures, updates dependencies, and documents breaking changes.
| File | Description |
|---|---|
| flake.lock | Updates the package repository pin. |
| cardano-api/test/cardano-api-test/Test/Cardano/Api/NodeConfig.hs | Tests configuration formats, triggers, and hash validation. |
| cardano-api/test/cardano-api-test/files/input/node-config/shelley-genesis.json | Adds Shelley fixture. |
| cardano-api/test/cardano-api-test/files/input/node-config/conway-genesis.json | Adds Conway fixture. |
| cardano-api/test/cardano-api-test/files/input/node-config/byron-genesis.json | Adds Byron fixture. |
| cardano-api/test/cardano-api-test/files/input/node-config/alonzo-genesis.json | Adds Alonzo fixture. |
| cardano-api/src/Cardano/Api/LedgerState.hs | Delegates parsing and genesis loading to cardano-config. |
| cardano-api/cardano-api.cabal | Adds cardano-config; removes yaml. |
| cabal.project | Updates the package index timestamp. |
| .changes/20261015_022558_cardano-api_palas_read_node_config_cardano_config.yml | Documents breaking API and behavior changes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merged
4 tasks done
carbolymer
approved these changes
Oct 19, 2026
carbolymer
left a comment
Contributor
There was a problem hiding this comment.
LGTM but I think exception handling really should be addressed.
…on's exceptions too
…sh, rewrite the changelog
… a separate function
…he Dijkstra genesis choice
4 tasks done
Jimbo4350
reviewed
Oct 20, 2026
Contributor
|
LGTM but #1379 (comment) needs to be at least documented/addressed. |
Jimbo4350
self-requested a review
October 20, 2026 19:53
…ed and clarify comments
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.

Context
cardano-apihas its own way of parsing the node configuration file. To avoid duplication, this PR removes it in favour of the functionality fromcardano-config.This has a couple of minor side effects:
And also, this PR, changes the implementation of
NodeConfigto just be a newtype wrapper aroundcardano-config'sNodeConfiguration. And to avoid storing computed values, fields just become accessor functions (same signature).Another minor side-effect is that now it is necessary for the genesis files to be there when parsing, and for things to be valid, including the hashes. Nevertheless, a choice that this PR makes is not carrying out any of the consistency checks that
resolveConfigurationWithdoes when it is used from the node.CI-related
Last 3 commits are just patches to get the CI to pass in all platforms.
How to trust this PR
Except for the side effects this is pretty much a refactoring. And it relies on code that comes from
cardano-config. The PR also includes a few new tests.Checklist
.changes/