Repository navigation
Use cardano-config for cardano config parsing
#1379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d967ab7
Read node configurations through cardano-config
palas 1fcd58a
Bump cardano-config to 2.2.2.0
palas fe6efc2
Make NodeConfig a newtype around cardano-config's NodeConfiguration
palas 099fce0
Check the node configuration test fixtures out with LF line endings
palas 5a15f13
Build on macOS against the default Xcode's SDK, not the Command Line …
palas 51f3856
Link the Windows cross build without unix-compat's msvcrt
palas f3b4405
Make readNodeConfig return a typed error, and catch the tracing secti…
palas f275197
Return config warnings, tidy the NodeConfig API, test each genesis ha…
palas c63fe0c
Return the configuration warnings from readNodeConfig instead of from…
palas ecaa0e6
Test the genesis files, the Byron constants, initialLedgerState and t…
palas 959c7b6
Ignore TestDijkstraHardForkAtEpoch without ExperimentalHardForksEnabl…
palas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.changes/20261015_022558_cardano-api_palas_read_node_config_cardano_config.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| project: cardano-api | ||
| pr: 1379 | ||
| kind: | ||
| - breaking | ||
| description: | | ||
| `readNodeConfig` and `initialLedgerState` now read node configurations with cardano-config. They accept both the old flat format and the new cardano-config format. | ||
| `readNodeConfig` now also reads the genesis files, and genesis hashes are now required. | ||
| A configuration is also rejected if it sets `ExperimentalHardForksEnabled` without a `DijkstraGenesisFile`, or if its tracing section cannot be read. | ||
| With `ExperimentalHardForksEnabled`, the Dijkstra genesis that is used is the one that the configuration specifies, instead of the example one. | ||
| Without `ExperimentalHardForksEnabled`, `TestDijkstraHardForkAtEpoch` is now ignored, as in the node. | ||
| `readNodeConfig` now fails with a `NodeConfigError` instead of `Text`; it carries cardano-config's errors. | ||
| `readNodeConfig` now also returns cardano-config's warnings, such as unknown keys. | ||
| `NodeConfig` is now a newtype around cardano-config's `NodeConfiguration` (`ncConfiguration`); its old fields are now functions with the same names. | ||
| `NodeConfig` no longer has a `FromJSON` instance: use `readNodeConfig`. | ||
| `PBftSignatureThreshold` and `LastKnownBlockVersion-Major`/`-Minor`/`-Alt` are no longer read, so `ncPBftSignatureThreshold` is always `Nothing` (the consensus default) and `ncByronProtocolVersion` is always 1.0.0; both are deprecated. `cardano-api` does not use these two values when reading or applying blocks. | ||
| `readByronGenesisConfig`, `readShelleyGenesisConfig`, `readAlonzoGenesisConfig` and `readConwayGenesisConfig` are now plain functions of `NodeConfig`. | ||
| `ncByronGenesisHash`, `ncShelleyGenesisHash`, `ncAlonzoGenesisHash` and `ncConwayGenesisHash` now return the hash, not a `Maybe`. | ||
| `GenesisConfigError` keeps only `NECardanoConfig`. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| cardano-rpc/gen/** linguist-generated=true | ||
| cardano-rpc/gen/** no-prettify | ||
|
|
||
| # Genesis hashes are taken over the raw file bytes, so a CRLF checkout on | ||
| # Windows would not match the hashes the node configuration tests pin. | ||
| cardano-api/test/cardano-api-test/files/input/node-config/*.json text eol=lf |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.