IntersectMBO / IntersectMBO/cardano-api
gRPC: Dijkstra era support gaps in UTxO RPC
- Dominant language
- Haskell
- Stars
- 40
- Forks
- 30
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 30
Description
This is a work-in-progress tracking issue for Dijkstra era support gaps in cardano-rpc and the UTxO RPC integration.
It will be extended with new findings as Dijkstra support work continues.
## Native guard scripts (CIP-112) cannot be represented
The utxorpc spec's `NativeScript` message is a `oneof` over the six classic shapes (`script_pubkey`, `script_all`, `script_any`, `script_n_of_k`, `invalid_before`, `invalid_hereafter`).
Dijkstra native scripts add a guard constructor (`RequireGuard`, see `DijkstraNativeScript` in cardano-ledger-dijkstra) with no corresponding variant in the spec.
Until the spec gains a variant and the generated proto code is regenerated, guard-bearing native scripts cannot be faithfully serialised in `FetchBlock` responses.
## Script conversion crashes on guard-bearing native scripts
`fromAllegraTimelock` in cardano-api falls through to `error "TODO Dijkstra: fromAllegraTimelock: era not supported"` for the guard constructor.
`txToUtxoRpcTx` routes both transaction witness scripts and auxiliary data scripts through it via `fromShelleyBasedScript`.
Serving a Dijkstra block containing a guard-bearing native script would therefore crash the handler at runtime.
Planned mitigation: move cardano-rpc's script conversion onto a total, ledger-based conversion with an explicit guard case (see the review discussion in #1247).
## `RedeemerPurpose` enum has no guarding value
The `RedeemerPurpose` proto enum has no value for Dijkstra's guarding purpose.
cardano-rpc currently maps `GuardingScript` to `REDEEMER_PURPOSE_UNSPECIFIED` as an interim measure.
## Related
- #1246 tracks pre-existing wire-format issues discovered during the FetchBlock work.
Contributor guide
Assessment
This issue has not been assessed yet.