Skip to content

Plutus V4 and dijkstraPV - #7898

Merged
zliu41 merged 4 commits into
masterfrom
zliu41/v4
Aug 19, 2026
Merged

Plutus V4 and dijkstraPV#7898
zliu41 merged 4 commits into
masterfrom
zliu41/v4

Conversation

@zliu41

@zliu41 zliu41 commented Aug 16, 2026

Copy link
Copy Markdown
Member

Most of the code mirrors the Plutus V3 counterpart.

@zliu41
zliu41 requested a review from a team August 17, 2026 03:35

@SeungheonOh SeungheonOh 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.

I have one small comment. Rest seems good

Comment thread plutus-ledger-api/test/Spec/Versions.hs
Base automatically changed from zliu41/unit to master August 17, 2026 19:39
@zliu41
zliu41 merged commit 5c1c4c6 into master Aug 19, 2026
8 checks passed
@zliu41
zliu41 deleted the zliu41/v4 branch August 19, 2026 02:39

@kwxm kwxm 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.

This looks OK to me. It reminded me of a few things that we should fix though.

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.

I don't think this code even works any more. It was used on the old script dump, which we don't have any more. I've made an issue to check it and remove it (although the results of the analysis may still be of some interest).

Your additions look correct though!

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 do still want this.

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.

This file can probably also go, but I'll look into that after this PR is merged.

PlutusV1 -> alonzoPV
PlutusV2 -> vasilPV
PlutusV3 -> changPV
PlutusV4 -> dijkstraPV

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.

Isn't Dijkstra the name of an era, not an HF? I think we've been using the names of the forks here, but we probably don't yet know the name of the fork that'll introduce Dijkstra. We might want to change this once we do.

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.

Also, do we know whether we'll be enabling the batch 7 builtins (multiIndexArray etc) at the Dijkstra HF, or just PlutusV4? If we are then some other things may need to be changed in this file.

Map.fromList
[
( dijkstraPV
, Set.fromList (batch1 ++ batch2 ++ batch3 ++ batch4 ++ batch5 ++ batch6)

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.

Do we know yet whether or not we'll be enabling the batch 7 builtins (multiIndexArray etc) at the Dijkstra HF, or just PlutusV4? If we are then this will have to be changed.

V3.deserialiseScript changPV $
errorScript <> "remdr3"
assertEqual "remdr4" (RemainderError "remdr4") $
fromLeft (Prelude.error "Expected Reft, got Right") $

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.

Suggested change
fromLeft (Prelude.error "Expected Reft, got Right") $
fromLeft (Prelude.error "Expected Left, got Right") $

, mkTest changPV builtins1
, mkTest plominPV builtins1
, mkTest newestPV (allBuiltins \\ builtins7)
, mkTest vanRossemPV (allBuiltins \\ builtins7)

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.

Good. We should probably have done this before, when van Rossem actually happened.

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.

This should all be simpler from now on, since all builtins are available for all ledger languages. I'll make an issue to check these tests and maybe simplify them.

V3.deserialiseScript changPV $
errorScript <> "remdr3"
assertEqual "remdr4" (RemainderError "remdr4") $
fromLeft (Prelude.error "Expected Reft, got Right") $

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.

Suggested change
fromLeft (Prelude.error "Expected Reft, got Right") $
fromLeft (Prelude.error "Expected Left, got Right") $

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 really should try to reduce the duplication between these tests and the Spec tests. There's an issue for that that's been open since February 2025, but there's always more important stuff to do.

mCostModel :: MCostModel
mCostModel =
-- nothing to clear because v4 does not exist (yet).
-- nothing to clear yet because V4 currently has the same builtin as V3.

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.

I think it always will, These tests need to be rethought: see #6089, open since May 2024.

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