Skip to content

Support Dijkstra protocol parameters - #1309

Open
palas wants to merge 1 commit into
masterfrom
support-dijkstra-pparams
Open

Support Dijkstra protocol parameters#1309
palas wants to merge 1 commit into
masterfrom
support-dijkstra-pparams

Conversation

@palas

@palas palas commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Context

Add DijkstraEraBasedProtocolParametersUpdate with IntroducedInDijkstraPParams (the reference-script size and cost parameters new in Dijkstra), the fromLedgerPParamsUpdate conversion back into it, a Semigroup instance for DijkstraPParams updates and generators. The protocol version itself is not updatable in Dijkstra.

How to trust this PR

This is Conway's pattern extended by one era.

The new constructor, the IntroducedInDijkstraPParams record, its two conversion helpers, the Semigroup instance and the generators each mirror their Conway counterpart line-for-line, including the NoUpdate protocol-version arm, which is copied from the Conway instance directly above it.

The only genuinely new content is the four Dijkstra parameters, and those are read and written through the ledger's own ppu…L lenses, so there is no hand-rolled logic to check. Two previously-erroring TODO stubs are filled (fromLedgerPParamsUpdate and the generator dispatch), and the new generators plug into the existing era-generic test machinery.

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/

@palas palas self-assigned this Aug 22, 2026
Copilot AI lite review requested due to automatic review settings August 22, 2026 00:44
@palas
palas force-pushed the support-dijkstra-pparams branch from 08006cc to 63c8ee2 Compare August 22, 2026 00:46

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

Extends cardano-api’s era-based protocol-parameter update machinery to support DijkstraEra, following the existing Conway-era pattern and wiring it into conversions and generators.

Changes:

  • Added DijkstraEraBasedProtocolParametersUpdate plus IntroducedInDijkstraPParams and corresponding PParamsUpdate conversion helpers.
  • Implemented fromLedgerPParamsUpdate support for DijkstraEra and extended createEraBasedProtocolParamUpdate to include the new Dijkstra parameters.
  • Added a Semigroup instance for Ledger.DijkstraPParams StrictMaybe and enabled Dijkstra generators in the test-gen layer.

Reviewed changes

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

File Description
cardano-api/src/Cardano/Api/ProtocolParameters.hs Adds Dijkstra-era protocol-parameter update constructor, new Dijkstra-introduced parameter record, and ledger conversion in both directions.
cardano-api/src/Cardano/Api/Internal/Orphans/Misc.hs Adds Semigroup instance for Ledger.DijkstraPParams StrictMaybe mirroring the Conway pattern (including NoUpdate protocol version).
cardano-api/gen/Test/Gen/Cardano/Api/ProtocolParameters.hs Enables Dijkstra-era generation and introduces generators for the new Dijkstra-introduced parameters.
.changes/20260822_120000_cardano-api_palas_dijkstra_protocol_parameters.yml Documents the change (but needs reclassification to include breaking due to new public constructor).

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

Add DijkstraEraBasedProtocolParametersUpdate with
IntroducedInDijkstraPParams (the reference-script size and cost
parameters new in Dijkstra), the fromLedgerPParamsUpdate conversion
back into it, a Semigroup instance for DijkstraPParams updates and
generators. The protocol version itself is not updatable in Dijkstra.

Co-Authored-By: Konstantinos Lambrou-Latreille <konstantinos.lambrou@iohk.io>
@palas
palas force-pushed the support-dijkstra-pparams branch from 63c8ee2 to 810540e Compare August 22, 2026 01:00
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.

2 participants