Skip to content

Commit ec8b99a

Browse files
authored
Revert "[Builtins] Disable 'writeBits' for changPlus1 (#6536)" (#6554)
This reverts commit 9eba5de.
1 parent 6a5d5a2 commit ec8b99a

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
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, ReplicateByte,
125+
ReadBit, WriteBits, ReplicateByte,
126126
ShiftByteString, RotateByteString, CountSetBits, FindFirstSetBit,
127127
Ripemd_160
128128
]),
129129
((PlutusV3, futurePV), Set.fromList [
130-
WriteBits, ExpModInteger
130+
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,6 +288,10 @@ 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
291295
| ReplicateByte'cpu'arguments'intercept
292296
| ReplicateByte'cpu'arguments'slope
293297
| ReplicateByte'memory'arguments'intercept
@@ -311,10 +315,6 @@ data ParamName =
311315
| Ripemd_160'memory'arguments
312316

313317
-- 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-
293 @=? length v3_ParamNames
31+
297 @=? 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-
293 @=? length v3_ParamNames
29+
297 @=? 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: 2 additions & 3 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
7980
, paramReplicateByte = mempty
8081
, paramShiftByteString = mempty
8182
, paramRotateByteString = mempty
8283
, paramCountSetBits = mempty
8384
, paramFindFirstSetBit = mempty
8485
, paramRipemd_160 = mempty
85-
, paramWriteBits = mempty
8686
, paramExpModInteger = mempty
8787
}
8888

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

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

Lines changed: 2 additions & 3 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
8081
, paramReplicateByte = mempty
8182
, paramShiftByteString = mempty
8283
, paramRotateByteString = mempty
8384
, paramCountSetBits = mempty
8485
, paramFindFirstSetBit = mempty
8586
, paramRipemd_160 = mempty
86-
, paramWriteBits = mempty
8787
, paramExpModInteger = mempty
8888
}
8989

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

0 commit comments

Comments
 (0)