IntersectMBO / IntersectMBO/cardano-node
Migrate cardano-testnet default era from Conway to Dijkstra
- Dominant language
- Haskell
- Stars
- 3.2k
- Forks
- 754
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 20
Description
## Summary
`cardano-testnet`'s default test era is currently Conway. Now that Dijkstra support is wired in, we should migrate the default to Dijkstra so general-purpose tests exercise the latest era and we can flush out any code paths that fall through to `error` on a Dijkstra value.
## Current state
The canonical default lives in [`cardano-testnet/src/Testnet/Start/Types.hs:229`](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-testnet/src/Testnet/Start/Types.hs#L229):
```haskell
cardanoNodeEra = AnyShelleyBasedEra ShelleyBasedEraConway
```
Supporting defaults:
- `cardano-testnet/src/Testnet/Defaults.hs:184` — `defaultEra :: ShelleyBasedEra ConwayEra`
- `cardano-testnet/src/Testnet/Defaults.hs:472` — `eraToProtocolVersion` (already maps Dijkstra → PV 12)
Dijkstra is already in scope — `ShelleyBasedEraDijkstra`, `dijkstraGenesisDefaults`, and `TestDijkstraHardForkAtEpoch` are referenced throughout, so **no cardano-api bump is required**.
## Tests that hardcode Conway only because it's the default (migration candidates)
Generic tests pinned to Conway:
- `test/cardano-testnet-test/Cardano/Testnet/Test/FoldEpochState.hs:31`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs:84`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs:53`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/RegisterDeregisterStakeAddress.hs:51`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/BuildEstimate.hs:48`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/Scripts.hs:56, 206`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/BuildRaw.hs:61`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/CostCalculation.hs:64, 223, 338`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs:68`
- `test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs:68`
## Governance tests — also migration candidates
All 14 files under `test/cardano-testnet-test/Cardano/Testnet/Test/Gov/` (DReps, committee, treasury, proposals, etc.) currently use `ConwayEraOnwardsConway` / `ShelleyBasedEraConway`. Governance is `ConwayEraOnwards`, not Conway-only — these features exist in Dijkstra too, so the tests should run on the latest era to catch era-specific regressions. The `ConwayEraOnwardsConway` witness in those files is just "use the earliest era that has this feature"; there's no Conway-specific behavior being asserted.
If any individual gov test genuinely depends on pre-Dijkstra behavior that changed, it should be deliberately era-pinned with a comment explaining why — but that's the exception, not the default.
## `error` calls
Only one notable hit, and it's fine as-is — Dijkstra is Conway-onwards, so it won't fire:
- `src/Testnet/EpochStateProcessing.hs:41` — `error "Governance actions only available in Conway era onwards"`
## Known gaps
- `test/.../Test/Node/Shutdown.hs:132` already TODOs that `cardano-cli latest genesis create` doesn't yet support Dijkstra — Dijkstra genesis is currently written from `dijkstraGenesisDefaults` directly. Worth tracking for full parity but not a blocker.
- No `genesis.dijkstra.spec.json` fixture under `cardano-testnet/files/data/`, but genesis is generated dynamically so this isn't blocking either.
## Proposed approach
1. Flip the default in `Testnet/Start/Types.hs:229` to `AnyShelleyBasedEra ShelleyBasedEraDijkstra` and update `Defaults.hs:184` accordingly.
2. Run the test suite and chase any failures.
3. Migrate gov tests' era witnesses from `*OnwardsConway` to `*OnwardsDijkstra` (or have them follow the default), unless a specific test legitimately needs Conway pinning.
4. Fix any `error` paths that surface on Dijkstra.
5. File a follow-up if the cardano-cli genesis-create gap blocks anything.
Contributor guide
Assessment
This issue has not been assessed yet.