From aa5d06d145fc0b4a3265f810efb84b89dcf3677d Mon Sep 17 00:00:00 2001 From: kwxm Date: Mon, 28 Jul 2025 11:29:45 +0100 Subject: [PATCH 1/3] Try Roman's suggestion --- .../src/PlutusLedgerApi/Common/Versions.hs | 50 ++++++++++++------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs index e87b3aad69f..8315ffb55d8 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs @@ -221,7 +221,34 @@ batch6 = , LengthOfArray, ListToArray, IndexArray ] -{-| Given a ledger language, return a map indicating which builtin functions were +plutusV1builtins :: _ +plutusV1builtins = + Map.fromList + [ (alonzoPV, Set.fromList batch1) + , (pv11PV, Set.fromList (batch2 ++ batch3 ++ batch4 ++ batch5 ++ batch6)) + ] +{-# OPAQUE plutusV1builtins #-} + +plutusV2builtins :: _ +plutusV2builtins = + Map.fromList + [ (vasilPV, Set.fromList (batch1 ++ batch2)) + , (valentinePV, Set.fromList batch3) + , (plominPV, Set.fromList batch4b) + , (pv11PV , Set.fromList (batch4a ++ batch5 ++ batch6)) + ] +{-# OPAQUE plutusV2builtins #-} + +plutusV3builtins :: _ +plutusV3builtins = + Map.fromList + [ (changPV, Set.fromList (batch1 ++ batch2 ++ batch3 ++ batch4)) + , (plominPV, Set.fromList batch5) + , (pv11PV, Set.fromList batch6) + ] +{-# OPAQUE plutusV3builtins #-} + + {-| Given a ledger language, return a map indicating which builtin functions were introduced in which 'MajorProtocolVersion'. This __must__ be updated when new builtins are added. It is not necessary to add entries for protocol versions where no new builtins are added. See Note [New builtins/language versions and @@ -230,24 +257,9 @@ batch6 = builtinsIntroducedIn :: PlutusLedgerLanguage -> Map.Map MajorProtocolVersion (Set.Set DefaultFun) builtinsIntroducedIn = \case - PlutusV1 -> - Map.fromList - [ (alonzoPV, Set.fromList batch1) - , (pv11PV, Set.fromList (batch2 ++ batch3 ++ batch4 ++ batch5 ++ batch6)) - ] - PlutusV2 -> - Map.fromList - [ (vasilPV, Set.fromList (batch1 ++ batch2)) - , (valentinePV, Set.fromList batch3) - , (plominPV, Set.fromList batch4b) - , (pv11PV , Set.fromList (batch4a ++ batch5 ++ batch6)) - ] - PlutusV3 -> - Map.fromList - [ (changPV, Set.fromList (batch1 ++ batch2 ++ batch3 ++ batch4)) - , (plominPV, Set.fromList batch5) - , (pv11PV, Set.fromList batch6) - ] + PlutusV1 -> plutusV1builtins + PlutusV2 -> plutusV2builtins + PlutusV3 -> plutusV3builtins {- | Return a set containing the builtins which are available in a given LL in a given PV. All builtins are available in all LLs from `pv11PV` onwards. -} From 2c19ee0ca6c537f0680cc84637ab257edaf72a16 Mon Sep 17 00:00:00 2001 From: kwxm Date: Mon, 28 Jul 2025 11:30:04 +0100 Subject: [PATCH 2/3] Try Roman's suggestion --- .../src/PlutusLedgerApi/Common/Versions.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs index 8315ffb55d8..46515b1a021 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs @@ -231,11 +231,11 @@ plutusV1builtins = plutusV2builtins :: _ plutusV2builtins = - Map.fromList - [ (vasilPV, Set.fromList (batch1 ++ batch2)) - , (valentinePV, Set.fromList batch3) - , (plominPV, Set.fromList batch4b) - , (pv11PV , Set.fromList (batch4a ++ batch5 ++ batch6)) + Map.fromList + [ (vasilPV, Set.fromList (batch1 ++ batch2)) + , (valentinePV, Set.fromList batch3) + , (plominPV, Set.fromList batch4b) + , (pv11PV , Set.fromList (batch4a ++ batch5 ++ batch6)) ] {-# OPAQUE plutusV2builtins #-} From 7cc619d3b91eac06b50d4e98131989fa325a8224 Mon Sep 17 00:00:00 2001 From: kwxm Date: Mon, 28 Jul 2025 12:19:12 +0100 Subject: [PATCH 3/3] Try Roman's suggestion --- plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs index 46515b1a021..f70a6328f6c 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs @@ -221,7 +221,7 @@ batch6 = , LengthOfArray, ListToArray, IndexArray ] -plutusV1builtins :: _ +plutusV1builtins :: Map.Map MajorProtocolVersion (Set.Set DefaultFun) plutusV1builtins = Map.fromList [ (alonzoPV, Set.fromList batch1) @@ -229,7 +229,7 @@ plutusV1builtins = ] {-# OPAQUE plutusV1builtins #-} -plutusV2builtins :: _ +plutusV2builtins :: Map.Map MajorProtocolVersion (Set.Set DefaultFun) plutusV2builtins = Map.fromList [ (vasilPV, Set.fromList (batch1 ++ batch2)) @@ -239,7 +239,7 @@ plutusV2builtins = ] {-# OPAQUE plutusV2builtins #-} -plutusV3builtins :: _ +plutusV3builtins :: Map.Map MajorProtocolVersion (Set.Set DefaultFun) plutusV3builtins = Map.fromList [ (changPV, Set.fromList (batch1 ++ batch2 ++ batch3 ++ batch4))