Implement Dijkstra era support (13 error stubs from node 10.6.2 bump)
Improvement
Introduced by: PR #5197 (node 10.6.2 bump)
## Context
The cardano-node 10.6.2 bump brings `cardano-api-10.23.0.0` which adds a new `Dijkstra` era constructor. PR #5197 adds `error "... DijkstraEra not yet supported"` stubs at 13 call sites to satisfy exhaustive pattern matching. These are runtime bombs that will crash if Dijkstra-era data is encountered.
Dijkstra era is not active on any network yet, so these are safe for now. They must be resolved before Dijkstra goes live.
## Stubs by category
### Era mapping / API layer (4 stubs — trivial)
Simple pattern-match additions to existing era enums.
| File | Function | Fix |
|---|---|---|
| `lib/api/.../Era.hs:111` | `fromReadEra` | Add `Read.Dijkstra -> ApiDijkstra` (needs `ApiDijkstra` constructor) |
| `lib/api/.../Era.hs:123` | `fromAnyCardanoEra` | Add `DijkstraEra -> ApiDijkstra` |
| `lib/primitive/.../Read/Eras.hs:32` | `fromAnyCardanoEra` | Add `DijkstraEra -> EraValue Dijkstra` |
| `lib/primitive/.../Shelley.hs:440` | `toCardanoEra` | Add `BlockDijkstra{} -> AnyCardanoEra DijkstraEra` |
### Transaction processing (3 stubs — moderate)
Depend on whether `ShelleyBasedEraDijkstra` exists in cardano-api.
| File | Function | Fix |
|---|---|---|
| `lib/primitive/.../Tx/TxExtended.hs:75` | `fromCardanoTx` | Add `ShelleyBasedEraDijkstra` case arm |
| `lib/primitive/.../Tx/Sealed.hs:48` | `fromCardanoApiTx` | Add `ShelleyBasedEraDijkstra` case arm |
| `lib/wallet/.../Transaction.hs:716` | `withRecentEraLedgerTx` | Add Dijkstra case if promoted to `IsRecentEra`, else `Nothing` |
### Network / query layer (2 stubs — moderate)
Local state queries. Depend on Dijkstra era promotion status.
| File | Function | Fix |
|---|---|---|
| `lib/network-layer/.../UTxO.hs:58` | `getUTxOByTxIn` | Add 9th arg to `onAnyEra` for Dijkstra |
| `lib/network-layer/.../Implementation.hs:694` | `_getUTxOByTxIn` | Add `DijkstraEra` case in empty-UTxO branch |
### Protocol parameters (1 stub — moderate)
| File | Function | Fix |
|---|---|---|
| `lib/wallet/.../Wallet.hs:2270` | `pparamsInRecentEra` | Add `Read.Dijkstra -> Write.InRecentEraDijkstra pparams` if recent, else non-recent |
### Block processing (1 stub — moderate)
| File | Function | Fix |
|---|---|---|
| `lib/wallet/.../Pools.hs:771` | `forAllBlocks` | Add `BlockDijkstra blk ->` handler with appropriate producer extractor |
### Test utilities (2 stubs — trivial)
| File | Function | Fix |
|---|---|---|
| `lib/local-cluster/.../ServiceSpec.hs:463` | `txOutFromOutput` | Add Dijkstra case mirroring Conway |
| `lib/unit/.../TransactionSpec.hs:1388` | `unsafeWithShelleyBasedEra` | Add `DijkstraEra` case with `shelleyBasedEraConstraints` |
## Blocking dependencies
1. **`ShelleyBasedEraDijkstra`** — must exist in cardano-api for transaction stubs
2. **`IsRecentEra` promotion** — determines whether Dijkstra gets `InRecentEra*` or `InNonRecentEra*` treatment (affects network, pparams, transaction stubs)
3. **`BlockDijkstra` constructor** — needed for block processing stub
## Summary
- **6 trivial** (pattern-match additions)
- **7 moderate** (depend on upstream era promotion status)
- **0 hard** (no new logic, just following established patterns)
0 条评论