Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,6 @@ builtinMemoryModels = BuiltinCostModelBase
, paramLengthOfArray = Id $ ModelOneArgumentConstantCost 10
, paramListToArray = Id $ ModelOneArgumentLinearInX $ OneVariableLinearFunction 7 1
, paramIndexArray = Id $ ModelTwoArgumentsConstantCost 32
, paramInsertCoin = Id $ ModelFourArgumentsConstantCost 1
}
where identityFunction = OneVariableLinearFunction 0 1
20 changes: 20 additions & 0 deletions plutus-core/cost-model/data/builtinCostModelA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1206,4 +1206,24 @@
"type": "constant_cost"
}
}
, "insertCoin": {
"cpu": {
"arguments": 1000,
"type": "constant_cost"
},
"memory": {
"arguments": 10,
"type": "constant_cost"
}
}
, "unionValue": {
"cpu": {
"arguments": 1000,
"type": "constant_cost"
},
"memory": {
"arguments": 10,
"type": "constant_cost"
}
}
}
20 changes: 20 additions & 0 deletions plutus-core/cost-model/data/builtinCostModelB.json
Original file line number Diff line number Diff line change
Expand Up @@ -1206,4 +1206,24 @@
"type": "constant_cost"
}
}
, "insertCoin": {
"cpu": {
"arguments": 1000,
"type": "constant_cost"
},
"memory": {
"arguments": 10,
"type": "constant_cost"
}
}
, "unionValue": {
"cpu": {
"arguments": 1000,
"type": "constant_cost"
},
"memory": {
"arguments": 10,
"type": "constant_cost"
}
}
}
20 changes: 20 additions & 0 deletions plutus-core/cost-model/data/builtinCostModelC.json
Original file line number Diff line number Diff line change
Expand Up @@ -1224,4 +1224,24 @@
"type": "constant_cost"
}
}
, "insertCoin": {
"cpu": {
"arguments": 1000,
"type": "constant_cost"
},
"memory": {
"arguments": 10,
"type": "constant_cost"
}
}
, "unionValue": {
"cpu": {
"arguments": 1000,
"type": "constant_cost"
},
"memory": {
"arguments": 10,
"type": "constant_cost"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ data BuiltinCostModelBase f =
, paramLengthOfArray :: f ModelOneArgument
, paramListToArray :: f ModelOneArgument
, paramIndexArray :: f ModelTwoArguments
-- Values
, paramInsertCoin :: f ModelFourArguments
, paramUnionValue :: f ModelTwoArguments
}
deriving stock (Generic)
deriving anyclass (FunctorB, TraversableB, ConstraintsB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ unitCostTwoArguments = CostingFun (ModelTwoArgumentsConstantCost 1) (ModelTwo
unitCostThreeArguments :: CostingFun ModelThreeArguments
unitCostThreeArguments = CostingFun (ModelThreeArgumentsConstantCost 1) (ModelThreeArgumentsConstantCost 0)

unitCostFourArguments :: CostingFun ModelFourArguments
unitCostFourArguments = CostingFun (ModelFourArgumentsConstantCost 1) (ModelFourArgumentsConstantCost 0)

unitCostSixArguments :: CostingFun ModelSixArguments
unitCostSixArguments = CostingFun (ModelSixArgumentsConstantCost 1) (ModelSixArgumentsConstantCost 0)

Expand Down Expand Up @@ -355,6 +358,9 @@ unitCostBuiltinCostModel = BuiltinCostModelBase
, paramLengthOfArray = unitCostOneArgument
, paramListToArray = unitCostOneArgument
, paramIndexArray = unitCostTwoArguments
-- Values
, paramInsertCoin = unitCostFourArguments
, paramUnionValue = unitCostTwoArguments
}

unitCekParameters :: Typeable ann => MachineParameters CekMachineCosts DefaultFun (CekValue DefaultUni DefaultFun ann)
Expand Down