aiken-lang / aiken

A modern smart contract platform for Cardano
https://aiken-lang.org
Apache License 2.0
474 stars 92 forks source link

Update v2 cost models #1022

Closed MicroProofs closed 4 weeks ago

MicroProofs commented 1 month ago

So in Conway the plutusV2 cost model was updated, but not the PlutusV1 cost model.

This PR reflects the mainnet changes.

nau commented 4 weeks ago

No, this is wrong. They changed multiplyInteger after Conway in V1 and V2. Look at builtinCostModelB.json and builtinCostModelC.json. They both have multiplied_sized.

And according to (https://github.com/input-output-hk/plutus/blob/00beff4c8be236fa39123afd956abd910a2bbb50/plutus-ledger-api/src/PlutusLedgerApi/Common/ProtocolVersions.hs) semvar B is used for V1 and V2 after Chang.

nau commented 4 weeks ago

So builtins costs are now BuiltinSemanticVariant dependant, which is Plutus version and protocol version dependent.

MicroProofs commented 4 weeks ago

No, this is wrong. They changed multiplyInteger after Conway in V1 and V2. Look at builtinCostModelB.json and builtinCostModelC.json. They both have multiplied_sized.

And according to (https://github.com/input-output-hk/plutus/blob/00beff4c8be236fa39123afd956abd910a2bbb50/plutus-ledger-api/src/PlutusLedgerApi/Common/ProtocolVersions.hs) semvar B is used for V1 and V2 after Chang.

Cost model A is still the same and that represents PlutusV1

MicroProofs commented 4 weeks ago

Ok I see they changed it all to use cost model B