aiken-lang / aiken

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

Update v2 cost models #1022

Closed MicroProofs closed 2 months ago

MicroProofs commented 2 months ago

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

This PR reflects the mainnet changes.

nau commented 2 months 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 2 months ago

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

MicroProofs commented 2 months 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 2 months ago

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