Skip to content

Add Plutus V4 support in the Dijkstra era - #1359

Merged
carbolymer merged 1 commit into
masterfrom
mgalazyn/fix/plutus-v4-script-support
Oct 9, 2026
Merged

carbolymer merged 1 commit into
masterfrom
mgalazyn/fix/plutus-v4-script-support

Conversation

@carbolymer

@carbolymer carbolymer commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

scriptLanguageSupportedInEra and toScriptInEra now accept Plutus V4 in the Dijkstra era.
Plutus V4 scripts can be used as witnesses, reference scripts and auxiliary scripts; hashing, JSON encoding and ledger conversion already handled V4.

Known gap: cardano-ledger-dijkstra 0.4.0.0 reads auxiliary scripts back only up to Plutus V3, so a Plutus V4 auxiliary script in Dijkstra is dropped on read-back until cardano-api picks up a ledger release with the fix:

This PR builds on the merged change that makes cardano-api fail instead of dropping unsupported scripts:

Context

Found while adding Plutus V4 support to cardano-cli:

The ledger added the Plutus V4 field of the Dijkstra transaction witness set, released in cardano-ledger-dijkstra 0.4.0.0:

How to trust this PR

A property checks that createTransactionBody accepts a Plutus V4 reference script on a Dijkstra output and keeps it on the ledger output.
The Dijkstra round-trip properties generate Plutus V4 witness scripts and pass against cardano-ledger-dijkstra 0.4.0.0.

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/

@carbolymer carbolymer self-assigned this Sep 25, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 3de5574 to c17c005 Compare September 25, 2026 09:28
@carbolymer carbolymer changed the title Add Plutus V4 support Reject unsupported inline Plutus scripts, add V4 in Dijkstra Sep 25, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch 2 times, most recently from 8d4d187 to 052dd93 Compare September 28, 2026 15:57
@carbolymer carbolymer changed the title Reject unsupported inline Plutus scripts, add V4 in Dijkstra Add Plutus V4 in Dijkstra and reject Plutus scripts unsupported by the era Sep 30, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 052dd93 to e5b02f2 Compare September 30, 2026 09:49
@carbolymer
carbolymer changed the base branch from master to mgalazyn/fix/unsupported-plutus-language-error September 30, 2026 13:48
@carbolymer
carbolymer added this pull request to stack #1364 September 30, 2026 13:48
@carbolymer carbolymer changed the title Add Plutus V4 in Dijkstra and reject Plutus scripts unsupported by the era Add Plutus V4 support in the Dijkstra era Sep 30, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from e5b02f2 to 2ac0c0b Compare September 30, 2026 13:58
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 2ac0c0b to accd0e8 Compare October 1, 2026 19:25
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from accd0e8 to 0b94a99 Compare October 1, 2026 20:13
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 0b94a99 to 058cd93 Compare October 7, 2026 07:19
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 058cd93 to 38a5bcd Compare October 7, 2026 13:33
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 38a5bcd to 6d175e1 Compare October 8, 2026 08:12
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 6d175e1 to 3658340 Compare October 8, 2026 08:38
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 3658340 to f8cb900 Compare October 8, 2026 13:53
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from f8cb900 to 81d1c23 Compare October 9, 2026 06:29
Base automatically changed from mgalazyn/fix/unsupported-plutus-language-error to master October 9, 2026 07:13
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch 3 times, most recently from 1d52c96 to 2fed823 Compare October 9, 2026 09:55
scriptLanguageSupportedInEra and toScriptInEra accept Plutus V4 in Dijkstra, so V4 scripts can be used as witnesses, reference scripts and auxiliary scripts.
cardano-ledger-dijkstra 0.4.0.0 carries the Plutus V4 field of the transaction witness set, so the Dijkstra round-trip properties pass.
It still reads auxiliary scripts back only up to Plutus V3, so a V4 auxiliary script is dropped on read-back until a ledger release with the eraMaxLanguage bump.
IntersectMBO/cardano-ledger#6109
@carbolymer
carbolymer force-pushed the mgalazyn/fix/plutus-v4-script-support branch from 2fed823 to aaaad09 Compare October 9, 2026 09:57
@carbolymer
carbolymer marked this pull request as ready for review October 9, 2026 10:02
Copilot AI balanced review requested due to automatic review settings October 9, 2026 10:02

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.

🟡 Changes recommended

The changelog should disclose the known V4 auxiliary-script read-back limitation.

1 open finding
What changed in this PR

Adds legacy API support for Plutus V4 scripts in the Dijkstra era.

Changes:

  • Enables Plutus V4 in scriptLanguageSupportedInEra.
  • Adds reference-script transaction-body coverage.
  • Adds a compatible-feature changelog fragment.
File Description
cardano-api/​src/​Cardano/​Api/​Plutus/​Internal/​Script.hs Enables the Dijkstra/V4 language pairing.
cardano-api/​test/​cardano-api-test/​Test/​Cardano/​Api/​Transaction/​Body/​Plutus/​Scripts.hs Tests preservation of a V4 reference script.
.changes/​plutus-v4-dijkstra-script-language-in-era.yml Documents the feature.

🧠 Review effort: Balanced


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

- compatible
description: |
`scriptLanguageSupportedInEra` and `toScriptInEra` now accept Plutus V4 in the Dijkstra era.
Plutus V4 scripts can be used as reference scripts in transaction outputs and as auxiliary scripts.
Just PlutusScriptV2InDijkstra
(ShelleyBasedEraDijkstra, PlutusScriptLanguage PlutusScriptV3) ->
Just PlutusScriptV3InDijkstra
(ShelleyBasedEraDijkstra, PlutusScriptLanguage PlutusScriptV4) ->

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.

We gotta kill this module after we release V12.

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.

totally

@carbolymer
carbolymer merged commit dad655e into master Oct 9, 2026
29 checks passed
@carbolymer
carbolymer deleted the mgalazyn/fix/plutus-v4-script-support branch October 9, 2026 12:45
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.

3 participants