Skip to content

Render Dijkstra certificates in the friendly JSON view - #1430

Merged
palas merged 2 commits into
support-dijkstra-pparam-updatesfrom
render-dijkstra-friendly-certs
Aug 28, 2026
Merged

Render Dijkstra certificates in the friendly JSON view#1430
palas merged 2 commits into
support-dijkstra-pparam-updatesfrom
render-dijkstra-friendly-certs

Conversation

@palas

@palas palas commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Context

The friendly JSON renderer (what transaction view prints) hit an error stub for every Dijkstra-era certificate.

This PR adds renderDijkstraCertificate: it is the Conway renderer minus the certificate forms the era drops (Dijkstra no longer has the Shelley-era certificate shapes), so every certificate the era supports renders, and stake pool registrations include their pool parameters.

How to trust this PR

It is all straightforward to JSON conversion. The only doubt is whether we are covering all the right certificates (since there is a catch-all that prints "unsupported certificate". But it can be checked that they match the ones at: https://cardano-ledger.cardano.intersectmbo.org/cardano-ledger-dijkstra/Cardano-Ledger-Dijkstra-TxCert.html#t:DijkstraTxCert

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

[ "Drep credential" .= drepCredential
, "anchor " .= mbAnchor
]
_ -> "unsupported certificate" .= String (T.pack $ show cert)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's hidden in _? Shouldn't that be an error? at least a non-zero error code. This applies to conway as well.
I don't remember why COMPLETE pragma doesn't work here.

@palas palas Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a COMPLETE pragma here: https://github.com/IntersectMBO/cardano-ledger/blob/f3104f00f9819ba94de119c38bc3e0109982821f/eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs#L358-L371

In the first place, it doesn't work because it is done over DijkstraEra instead of DijkstraTxCert, but that also doesn't seem to work, may be a compiler issue.

So the only way to get it to work would be to recursively pattern match on DijkstraTxCert, but we are not supposed to do that, and is not wat we did for Conway.

And about it being an error instead: I think it is best to just print it uglily than failing if for some reason we miss a certificate

Copilot AI lite review requested due to automatic review settings August 28, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the transaction view friendly JSON renderer to support Dijkstra-era certificates by adding a Dijkstra-specific certificate renderer and wiring it into the era dispatch, eliminating the previous internal TODO error. It also simplifies simple-script JSON decoding for Conway/Dijkstra and adds a changelog fragment documenting the new behavior.

Changes:

  • Add renderDijkstraCertificate and use it in renderCertificate for Dijkstra era.
  • Refactor simple-script JSON decoding path to share logic between Conway and Dijkstra (upgrading timelocks for Dijkstra).
  • Add a .changes/ entry describing the feature.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cardano-cli/src/Cardano/CLI/EraBased/Script/Read/Common.hs Refactors JSON simple-script decoding to share logic between Conway and Dijkstra (with Dijkstra upgrade).
cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs Implements and hooks up Dijkstra-era certificate rendering for friendly JSON output.
.changes/20260827_155708_cardano-cli_palas_dijkstra_friendly_certs.yml Documents the new Dijkstra certificate rendering behavior in the changelog system.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs
The friendly renderer hit an error stub for every Dijkstra-era
certificate; add renderDijkstraCertificate, the Conway renderer minus
the certificate forms the era drops.

Co-Authored-By: Konstantinos Lambrou-Latreille <konstantinos.lambrou@iohk.io>
Co-Authored-By: Sebastian Nagel <sebastian.nagel@ncoding.at>
@palas
palas force-pushed the render-dijkstra-friendly-certs branch from ada125a to 94a0866 Compare August 28, 2026 12:18
The UpdateDRepTxCert arm of renderDijkstraCertificate emitted a JSON
field literally named "anchor " (trailing space), unlike every other
arm. The Conway renderer it was copied from has the same quirk; that
one is left untouched here because changing it affects released
output.
@palas
palas added this pull request to the merge queue Aug 28, 2026
Merged via the queue into master with commit b38438f Aug 28, 2026
25 checks passed
@palas
palas deleted the render-dijkstra-friendly-certs branch August 28, 2026 19:27
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.

4 participants