Skip to content

cardano-testnet: Enforce SPOs come first and split node list into SPO and relay#6563

Merged
palas merged 3 commits intomasterfrom
split-nodes-list-into-spo-and-relay
May 7, 2026
Merged

cardano-testnet: Enforce SPOs come first and split node list into SPO and relay#6563
palas merged 3 commits intomasterfrom
split-nodes-list-into-spo-and-relay

Conversation

@palas
Copy link
Copy Markdown
Contributor

@palas palas commented May 6, 2026

Description

The NodeOption type was refactored from a sum type (SpoNodeOptions | RelayNodeOptions) into a record, and a new TestnetNodeOptions container enforces at the type level that there is at least one SPO (NonEmpty) and that SPOs come before relays (by structure). The parser also validates this ordering.

readNodeOptionsFromEnv now validates that node directories are consecutively numbered and that SPOs come before relays, matching the assumptions made by cardanoTestnet.

Follow-up PR: #6559 (adds --nodes flag for per-node binary configuration on top of this)

I would recommend looking at the diff with white-space disabled.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Running tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-9.6 and ghc-9.12
  • Self-reviewed the diff

@palas palas requested a review from a team as a code owner May 6, 2026 23:56
@palas palas self-assigned this May 6, 2026
@palas palas force-pushed the split-nodes-list-into-spo-and-relay branch from 9ca8af4 to 77fa7d8 Compare May 7, 2026 00:06
Comment thread cardano-testnet/src/Testnet/Start/Cardano.hs Outdated
Comment thread cardano-testnet/src/Testnet/Start/Types.hs Outdated
Comment thread cardano-testnet/src/Testnet/Start/Types.hs
@palas palas force-pushed the split-nodes-list-into-spo-and-relay branch from def6fd7 to 393ad15 Compare May 7, 2026 16:19
palas and others added 2 commits May 7, 2026 18:23
Co-authored-by: Mateusz Galazyn <228866+carbolymer@users.noreply.github.com>
@palas palas force-pushed the split-nodes-list-into-spo-and-relay branch from 393ad15 to eb5f40e Compare May 7, 2026 16:25
@palas palas enabled auto-merge May 7, 2026 16:33
@palas palas added this pull request to the merge queue May 7, 2026
Merged via the queue into master with commit d58363b May 7, 2026
29 checks passed
@palas palas deleted the split-nodes-list-into-spo-and-relay branch May 7, 2026 17:59
Comment thread cardano-testnet/src/Testnet/Start/Types.hs Outdated
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.

3 participants