Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Builtins] Disable 'writeBits' for chang+1 #6536

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ builtinsIntroducedIn = Map.fromList [
]),
((PlutusV3, changPlus1PV), Set.fromList [
AndByteString, OrByteString, XorByteString, ComplementByteString,
ReadBit, WriteBits, ReplicateByte,
ReadBit, ReplicateByte,
ShiftByteString, RotateByteString, CountSetBits, FindFirstSetBit,
Ripemd_160
]),
((PlutusV3, futurePV), Set.fromList [
ExpModInteger
WriteBits, ExpModInteger
])
]

Expand Down
8 changes: 4 additions & 4 deletions plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ data ParamName =
| ComplementByteString'memory'arguments'slope
| ReadBit'cpu'arguments
| ReadBit'memory'arguments
| WriteBits'cpu'arguments'intercept
| WriteBits'cpu'arguments'slope
| WriteBits'memory'arguments'intercept
| WriteBits'memory'arguments'slope
| ReplicateByte'cpu'arguments'intercept
| ReplicateByte'cpu'arguments'slope
| ReplicateByte'memory'arguments'intercept
Expand All @@ -315,6 +311,10 @@ data ParamName =
| Ripemd_160'memory'arguments

-- not enabled yet:
-- WriteBits'cpu'arguments'intercept
-- WriteBits'cpu'arguments'slope
-- WriteBits'memory'arguments'intercept
-- WriteBits'memory'arguments'slope
-- ExpModInteger'cpu'arguments
-- ExpModInteger'memory'arguments
deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic)
Expand Down
2 changes: 1 addition & 1 deletion plutus-ledger-api/test/Spec/CostModelParams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tests =
[ testCase "length" $ do
166 @=? length v1_ParamNames
185 @=? length v2_ParamNames
297 @=? length v3_ParamNames
293 @=? length v3_ParamNames
, testCase "tripping paramname" $ do
for_ v1_ParamNames $ \ p ->
assertBool "tripping v1 cm params failed" $ Just p == readParamName (showParamName p)
Expand Down
2 changes: 1 addition & 1 deletion plutus-ledger-api/test/Spec/Data/CostModelParams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tests =
[ testCase "length" $ do
166 @=? length v1_ParamNames
185 @=? length v2_ParamNames
297 @=? length v3_ParamNames
293 @=? length v3_ParamNames
, testCase "tripping paramname" $ do
for_ v1_ParamNames $ \ p ->
assertBool "tripping v1 cm params failed" $ Just p == readParamName (showParamName p)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ clearBuiltinCostModel r = r
, paramXorByteString = mempty
, paramComplementByteString = mempty
, paramReadBit = mempty
, paramWriteBits = mempty
, paramReplicateByte = mempty
, paramShiftByteString = mempty
, paramRotateByteString = mempty
, paramCountSetBits = mempty
, paramFindFirstSetBit = mempty
, paramRipemd_160 = mempty
, paramWriteBits = mempty
, paramExpModInteger = mempty
}

Expand All @@ -93,5 +93,6 @@ clearBuiltinCostModel' :: (m ~ MBuiltinCostModel) => m -> m
clearBuiltinCostModel' r = r
{ -- , paramIntegerToByteString = mempty -- Required for V2
-- , paramByteStringToInteger = mempty -- Required for V2
paramExpModInteger = mempty
paramWriteBits = mempty
, paramExpModInteger = mempty
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ clearBuiltinCostModel r = r
, paramXorByteString = mempty
, paramComplementByteString = mempty
, paramReadBit = mempty
, paramWriteBits = mempty
, paramReplicateByte = mempty
, paramShiftByteString = mempty
, paramRotateByteString = mempty
, paramCountSetBits = mempty
, paramFindFirstSetBit = mempty
, paramRipemd_160 = mempty
, paramWriteBits = mempty
, paramExpModInteger = mempty
}

Expand All @@ -94,5 +94,6 @@ clearBuiltinCostModel' :: (m ~ MBuiltinCostModel) => m -> m
clearBuiltinCostModel' r = r
{ -- , paramIntegerToByteString = mempty -- Required for V2
-- , paramByteStringToInteger = mempty -- Required for V2
paramExpModInteger = mempty
paramWriteBits = mempty
, paramExpModInteger = mempty
}
Loading