Skip to content

Commit 9eba5de

Browse files
authored
[Builtins] Disable 'writeBits' for changPlus1 (#6536)
This disables `writeBits` for chang+1, so that we have more time to fix it as per #6528.
1 parent 944d4c5 commit 9eba5de

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ builtinsIntroducedIn = Map.fromList [
122122
]),
123123
((PlutusV3, changPlus1PV), Set.fromList [
124124
AndByteString, OrByteString, XorByteString, ComplementByteString,
125-
ReadBit, WriteBits, ReplicateByte,
125+
ReadBit, ReplicateByte,
126126
ShiftByteString, RotateByteString, CountSetBits, FindFirstSetBit,
127127
Ripemd_160
128128
]),
129129
((PlutusV3, futurePV), Set.fromList [
130-
ExpModInteger
130+
WriteBits, ExpModInteger
131131
])
132132
]
133133

plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ data ParamName =
288288
| ComplementByteString'memory'arguments'slope
289289
| ReadBit'cpu'arguments
290290
| ReadBit'memory'arguments
291-
| WriteBits'cpu'arguments'intercept
292-
| WriteBits'cpu'arguments'slope
293-
| WriteBits'memory'arguments'intercept
294-
| WriteBits'memory'arguments'slope
295291
| ReplicateByte'cpu'arguments'intercept
296292
| ReplicateByte'cpu'arguments'slope
297293
| ReplicateByte'memory'arguments'intercept
@@ -315,6 +311,10 @@ data ParamName =
315311
| Ripemd_160'memory'arguments
316312

317313
-- not enabled yet:
314+
-- WriteBits'cpu'arguments'intercept
315+
-- WriteBits'cpu'arguments'slope
316+
-- WriteBits'memory'arguments'intercept
317+
-- WriteBits'memory'arguments'slope
318318
-- ExpModInteger'cpu'arguments
319319
-- ExpModInteger'memory'arguments
320320
deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic)

plutus-ledger-api/test/Spec/CostModelParams.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tests =
2828
[ testCase "length" $ do
2929
166 @=? length v1_ParamNames
3030
185 @=? length v2_ParamNames
31-
297 @=? length v3_ParamNames
31+
293 @=? length v3_ParamNames
3232
, testCase "tripping paramname" $ do
3333
for_ v1_ParamNames $ \ p ->
3434
assertBool "tripping v1 cm params failed" $ Just p == readParamName (showParamName p)

plutus-ledger-api/test/Spec/Data/CostModelParams.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tests =
2626
[ testCase "length" $ do
2727
166 @=? length v1_ParamNames
2828
185 @=? length v2_ParamNames
29-
297 @=? length v3_ParamNames
29+
293 @=? length v3_ParamNames
3030
, testCase "tripping paramname" $ do
3131
for_ v1_ParamNames $ \ p ->
3232
assertBool "tripping v1 cm params failed" $ Just p == readParamName (showParamName p)

plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/Data/EvaluationContext.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ clearBuiltinCostModel r = r
7676
, paramXorByteString = mempty
7777
, paramComplementByteString = mempty
7878
, paramReadBit = mempty
79-
, paramWriteBits = mempty
8079
, paramReplicateByte = mempty
8180
, paramShiftByteString = mempty
8281
, paramRotateByteString = mempty
8382
, paramCountSetBits = mempty
8483
, paramFindFirstSetBit = mempty
8584
, paramRipemd_160 = mempty
85+
, paramWriteBits = mempty
8686
, paramExpModInteger = mempty
8787
}
8888

@@ -93,5 +93,6 @@ clearBuiltinCostModel' :: (m ~ MBuiltinCostModel) => m -> m
9393
clearBuiltinCostModel' r = r
9494
{ -- , paramIntegerToByteString = mempty -- Required for V2
9595
-- , paramByteStringToInteger = mempty -- Required for V2
96-
paramExpModInteger = mempty
96+
paramWriteBits = mempty
97+
, paramExpModInteger = mempty
9798
}

plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/EvaluationContext.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ clearBuiltinCostModel r = r
7777
, paramXorByteString = mempty
7878
, paramComplementByteString = mempty
7979
, paramReadBit = mempty
80-
, paramWriteBits = mempty
8180
, paramReplicateByte = mempty
8281
, paramShiftByteString = mempty
8382
, paramRotateByteString = mempty
8483
, paramCountSetBits = mempty
8584
, paramFindFirstSetBit = mempty
8685
, paramRipemd_160 = mempty
86+
, paramWriteBits = mempty
8787
, paramExpModInteger = mempty
8888
}
8989

@@ -94,5 +94,6 @@ clearBuiltinCostModel' :: (m ~ MBuiltinCostModel) => m -> m
9494
clearBuiltinCostModel' r = r
9595
{ -- , paramIntegerToByteString = mempty -- Required for V2
9696
-- , paramByteStringToInteger = mempty -- Required for V2
97-
paramExpModInteger = mempty
97+
paramWriteBits = mempty
98+
, paramExpModInteger = mempty
9899
}

0 commit comments

Comments
 (0)