From 81461a71b587cfce605deca860154729059fc01e Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Mon, 12 Feb 2024 16:08:41 +0100 Subject: [PATCH] chore: fix mapping cost models for old epochs --- CHANGELOG.md | 1 + src/utils/cost-models-map.ts | 10 +- .../unit/fixtures/cost-models-map-fixtures.ts | 1065 +++++++++++++++++ test/unit/tests/utils/cost-models-map.ts | 13 + 4 files changed, 1085 insertions(+), 4 deletions(-) create mode 100644 test/unit/fixtures/cost-models-map-fixtures.ts create mode 100644 test/unit/tests/utils/cost-models-map.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index c141d2d2..43377e9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - port configuration via config option `dbSync.port` +- error in `/epochs/n/parameters` for epochs without PlutusV1/PlutusV2 cost models ## [1.7.0] - 2023-08-30 diff --git a/src/utils/cost-models-map.ts b/src/utils/cost-models-map.ts index a51298bb..366df004 100644 --- a/src/utils/cost-models-map.ts +++ b/src/utils/cost-models-map.ts @@ -355,15 +355,17 @@ const plutusV2Names: Array = [ // eslint-disable-next-line @typescript-eslint/no-explicit-any export const costModelsMap = (costModels: any) => { + if (costModels === null || typeof costModels !== 'object') return null; + costModels = sortKeysInObject(costModels); - if (Object.keys(costModels.PlutusV1).length !== plutusV1Names.length) + if ('PlutusV1' in costModels && Object.keys(costModels.PlutusV1).length !== plutusV1Names.length) throw new Error('The size of the Plutus V1 cost model mismatched'); - if (Object.keys(costModels.PlutusV2).length !== plutusV2Names.length) + if ('PlutusV2' in costModels && Object.keys(costModels.PlutusV2).length !== plutusV2Names.length) throw new Error('The size of the Plutus V1 cost model mismatched'); - if (validation.isNumber(Object.keys(costModels.PlutusV1)[0])) { + if ('PlutusV1' in costModels && validation.isNumber(Object.keys(costModels.PlutusV1)[0])) { const PlutusV1: Record = {}; for (let index = 0; index < plutusV1Names.length; index++) @@ -372,7 +374,7 @@ export const costModelsMap = (costModels: any) => { costModels = { ...costModels, PlutusV1 }; } - if (validation.isNumber(Object.keys(costModels.PlutusV2)[0])) { + if ('PlutusV2' in costModels && validation.isNumber(Object.keys(costModels.PlutusV2)[0])) { const PlutusV2: Record = {}; for (let index = 0; index < plutusV2Names.length; index++) diff --git a/test/unit/fixtures/cost-models-map-fixtures.ts b/test/unit/fixtures/cost-models-map-fixtures.ts new file mode 100644 index 00000000..92f578a5 --- /dev/null +++ b/test/unit/fixtures/cost-models-map-fixtures.ts @@ -0,0 +1,1065 @@ +export const costModelsMapFixture = [ + { + name: 'invalid costModels - number', + costModels: 10, + result: null, +}, + { + name: 'invalid costModels - string', + costModels: 'aaa', + result: null, +}, + { + name: 'invalid costModels - array', + costModels: ['a', 2], + result: { + "0": "a", + "1": 2, + } +}, + { + name: 'epoch without costModels', + costModels: null, + result: null, +}, + { + name: 'epoch with formatted PlutusV1 costModels', + costModels: { + PlutusV1: { + 'bData-cpu-arguments': 150000, + 'iData-cpu-arguments': 150000, + 'trace-cpu-arguments': 150000, + 'mkCons-cpu-arguments': 150000, + 'fstPair-cpu-arguments': 150000, + 'mapData-cpu-arguments': 150000, + 'sndPair-cpu-arguments': 150000, + 'unBData-cpu-arguments': 150000, + 'unIData-cpu-arguments': 150000, + 'bData-memory-arguments': 32, + 'cekLamCost-exBudgetCPU': 29773, + 'cekVarCost-exBudgetCPU': 29773, + 'headList-cpu-arguments': 150000, + 'iData-memory-arguments': 32, + 'listData-cpu-arguments': 150000, + 'nullList-cpu-arguments': 150000, + 'tailList-cpu-arguments': 150000, + 'trace-memory-arguments': 32, + 'mkCons-memory-arguments': 32, + 'mkNilData-cpu-arguments': 150000, + 'unMapData-cpu-arguments': 150000, + 'cekApplyCost-exBudgetCPU': 29773, + 'cekConstCost-exBudgetCPU': 29773, + 'cekDelayCost-exBudgetCPU': 29773, + 'cekForceCost-exBudgetCPU': 29773, + 'chooseData-cpu-arguments': 150000, + 'chooseList-cpu-arguments': 150000, + 'chooseUnit-cpu-arguments': 150000, + 'constrData-cpu-arguments': 150000, + 'fstPair-memory-arguments': 32, + 'ifThenElse-cpu-arguments': 1, + 'mapData-memory-arguments': 32, + 'mkPairData-cpu-arguments': 150000, + 'sndPair-memory-arguments': 32, + 'unBData-memory-arguments': 32, + 'unIData-memory-arguments': 32, + 'unListData-cpu-arguments': 150000, + 'cekLamCost-exBudgetMemory': 100, + 'cekVarCost-exBudgetMemory': 100, + 'headList-memory-arguments': 32, + 'listData-memory-arguments': 32, + 'nullList-memory-arguments': 32, + 'sha2_256-memory-arguments': 4, + 'sha3_256-memory-arguments': 4, + 'tailList-memory-arguments': 32, + 'cekBuiltinCost-exBudgetCPU': 29773, + 'cekStartupCost-exBudgetCPU': 100, + 'mkNilData-memory-arguments': 32, + 'unConstrData-cpu-arguments': 150000, + 'unMapData-memory-arguments': 32, + 'cekApplyCost-exBudgetMemory': 100, + 'cekConstCost-exBudgetMemory': 100, + 'cekDelayCost-exBudgetMemory': 100, + 'cekForceCost-exBudgetMemory': 100, + 'chooseData-memory-arguments': 32, + 'chooseList-memory-arguments': 32, + 'chooseUnit-memory-arguments': 32, + 'constrData-memory-arguments': 32, + 'equalsData-memory-arguments': 1, + 'ifThenElse-memory-arguments': 1, + 'mkNilPairData-cpu-arguments': 150000, + 'mkPairData-memory-arguments': 32, + 'unListData-memory-arguments': 32, + 'blake2b_256-memory-arguments': 4, + 'sha2_256-cpu-arguments-slope': 29175, + 'sha3_256-cpu-arguments-slope': 82363, + 'cekBuiltinCost-exBudgetMemory': 100, + 'cekStartupCost-exBudgetMemory': 100, + 'equalsString-memory-arguments': 1, + 'indexByteString-cpu-arguments': 150000, + 'unConstrData-memory-arguments': 32, + 'addInteger-cpu-arguments-slope': 0, + 'decodeUtf8-cpu-arguments-slope': 1000, + 'encodeUtf8-cpu-arguments-slope': 1000, + 'equalsData-cpu-arguments-slope': 10000, + 'equalsInteger-memory-arguments': 1, + 'mkNilPairData-memory-arguments': 32, + 'blake2b_256-cpu-arguments-slope': 29175, + 'appendString-cpu-arguments-slope': 1000, + 'equalsString-cpu-arguments-slope': 1000, + 'indexByteString-memory-arguments': 1, + 'lengthOfByteString-cpu-arguments': 150000, + 'lessThanInteger-memory-arguments': 1, + 'sha2_256-cpu-arguments-intercept': 2477736, + 'sha3_256-cpu-arguments-intercept': 0, + 'addInteger-memory-arguments-slope': 1, + 'decodeUtf8-memory-arguments-slope': 8, + 'encodeUtf8-memory-arguments-slope': 8, + 'equalsByteString-memory-arguments': 1, + 'equalsInteger-cpu-arguments-slope': 1326, + 'modInteger-cpu-arguments-constant': 148000, + 'modInteger-memory-arguments-slope': 1, + 'addInteger-cpu-arguments-intercept': 197209, + 'consByteString-cpu-arguments-slope': 1000, + 'decodeUtf8-cpu-arguments-intercept': 150000, + 'encodeUtf8-cpu-arguments-intercept': 150000, + 'equalsData-cpu-arguments-intercept': 150000, + 'appendString-memory-arguments-slope': 1, + 'blake2b_256-cpu-arguments-intercept': 2477736, + 'equalsString-cpu-arguments-constant': 1000, + 'lengthOfByteString-memory-arguments': 4, + 'lessThanByteString-memory-arguments': 1, + 'lessThanInteger-cpu-arguments-slope': 497, + 'modInteger-memory-arguments-minimum': 1, + 'multiplyInteger-cpu-arguments-slope': 11218, + 'sliceByteString-cpu-arguments-slope': 5000, + 'subtractInteger-cpu-arguments-slope': 0, + 'appendByteString-cpu-arguments-slope': 621, + 'appendString-cpu-arguments-intercept': 150000, + 'divideInteger-cpu-arguments-constant': 148000, + 'divideInteger-memory-arguments-slope': 1, + 'equalsByteString-cpu-arguments-slope': 247, + 'equalsString-cpu-arguments-intercept': 150000, + 'addInteger-memory-arguments-intercept': 1, + 'consByteString-memory-arguments-slope': 1, + 'decodeUtf8-memory-arguments-intercept': 0, + 'encodeUtf8-memory-arguments-intercept': 0, + 'equalsInteger-cpu-arguments-intercept': 136542, + 'modInteger-memory-arguments-intercept': 0, + 'consByteString-cpu-arguments-intercept': 150000, + 'divideInteger-memory-arguments-minimum': 1, + 'lessThanByteString-cpu-arguments-slope': 248, + 'lessThanEqualsInteger-memory-arguments': 1, + 'multiplyInteger-memory-arguments-slope': 1, + 'quotientInteger-cpu-arguments-constant': 148000, + 'quotientInteger-memory-arguments-slope': 1, + 'sliceByteString-memory-arguments-slope': 1, + 'subtractInteger-memory-arguments-slope': 1, + 'appendByteString-memory-arguments-slope': 1, + 'appendString-memory-arguments-intercept': 0, + 'equalsByteString-cpu-arguments-constant': 150000, + 'lessThanInteger-cpu-arguments-intercept': 179690, + 'multiplyInteger-cpu-arguments-intercept': 61516, + 'remainderInteger-cpu-arguments-constant': 148000, + 'remainderInteger-memory-arguments-slope': 1, + 'sliceByteString-cpu-arguments-intercept': 150000, + 'subtractInteger-cpu-arguments-intercept': 197209, + 'verifyEd25519Signature-memory-arguments': 1, + 'appendByteString-cpu-arguments-intercept': 396231, + 'divideInteger-memory-arguments-intercept': 0, + 'equalsByteString-cpu-arguments-intercept': 112536, + 'quotientInteger-memory-arguments-minimum': 1, + 'consByteString-memory-arguments-intercept': 0, + 'lessThanEqualsByteString-memory-arguments': 1, + 'lessThanEqualsInteger-cpu-arguments-slope': 1366, + 'remainderInteger-memory-arguments-minimum': 1, + 'lessThanByteString-cpu-arguments-intercept': 103599, + 'multiplyInteger-memory-arguments-intercept': 0, + 'quotientInteger-memory-arguments-intercept': 0, + 'sliceByteString-memory-arguments-intercept': 0, + 'subtractInteger-memory-arguments-intercept': 1, + 'verifyEd25519Signature-cpu-arguments-slope': 1, + 'appendByteString-memory-arguments-intercept': 0, + 'remainderInteger-memory-arguments-intercept': 0, + 'lessThanEqualsByteString-cpu-arguments-slope': 248, + 'lessThanEqualsInteger-cpu-arguments-intercept': 145276, + 'modInteger-cpu-arguments-model-arguments-slope': 118, + 'verifyEd25519Signature-cpu-arguments-intercept': 3345831, + 'lessThanEqualsByteString-cpu-arguments-intercept': 103599, + 'divideInteger-cpu-arguments-model-arguments-slope': 118, + 'modInteger-cpu-arguments-model-arguments-intercept': 425507, + 'quotientInteger-cpu-arguments-model-arguments-slope': 118, + 'remainderInteger-cpu-arguments-model-arguments-slope': 118, + 'divideInteger-cpu-arguments-model-arguments-intercept': 425507, + 'quotientInteger-cpu-arguments-model-arguments-intercept': 425507, + 'remainderInteger-cpu-arguments-model-arguments-intercept': 425507 + } + }, + result: { + "PlutusV1": { + "addInteger-cpu-arguments-intercept": 197209, + "addInteger-cpu-arguments-slope": 0, + "addInteger-memory-arguments-intercept": 1, + "addInteger-memory-arguments-slope": 1, + "appendByteString-cpu-arguments-intercept": 396231, + "appendByteString-cpu-arguments-slope": 621, + "appendByteString-memory-arguments-intercept": 0, + "appendByteString-memory-arguments-slope": 1, + "appendString-cpu-arguments-intercept": 150000, + "appendString-cpu-arguments-slope": 1000, + "appendString-memory-arguments-intercept": 0, + "appendString-memory-arguments-slope": 1, + "bData-cpu-arguments": 150000, + "bData-memory-arguments": 32, + "blake2b_256-cpu-arguments-intercept": 2477736, + "blake2b_256-cpu-arguments-slope": 29175, + "blake2b_256-memory-arguments": 4, + "cekApplyCost-exBudgetCPU": 29773, + "cekApplyCost-exBudgetMemory": 100, + "cekBuiltinCost-exBudgetCPU": 29773, + "cekBuiltinCost-exBudgetMemory": 100, + "cekConstCost-exBudgetCPU": 29773, + "cekConstCost-exBudgetMemory": 100, + "cekDelayCost-exBudgetCPU": 29773, + "cekDelayCost-exBudgetMemory": 100, + "cekForceCost-exBudgetCPU": 29773, + "cekForceCost-exBudgetMemory": 100, + "cekLamCost-exBudgetCPU": 29773, + "cekLamCost-exBudgetMemory": 100, + "cekStartupCost-exBudgetCPU": 100, + "cekStartupCost-exBudgetMemory": 100, + "cekVarCost-exBudgetCPU": 29773, + "cekVarCost-exBudgetMemory": 100, + "chooseData-cpu-arguments": 150000, + "chooseData-memory-arguments": 32, + "chooseList-cpu-arguments": 150000, + "chooseList-memory-arguments": 32, + "chooseUnit-cpu-arguments": 150000, + "chooseUnit-memory-arguments": 32, + "consByteString-cpu-arguments-intercept": 150000, + "consByteString-cpu-arguments-slope": 1000, + "consByteString-memory-arguments-intercept": 0, + "consByteString-memory-arguments-slope": 1, + "constrData-cpu-arguments": 150000, + "constrData-memory-arguments": 32, + "decodeUtf8-cpu-arguments-intercept": 150000, + "decodeUtf8-cpu-arguments-slope": 1000, + "decodeUtf8-memory-arguments-intercept": 0, + "decodeUtf8-memory-arguments-slope": 8, + "divideInteger-cpu-arguments-constant": 148000, + "divideInteger-cpu-arguments-model-arguments-intercept": 425507, + "divideInteger-cpu-arguments-model-arguments-slope": 118, + "divideInteger-memory-arguments-intercept": 0, + "divideInteger-memory-arguments-minimum": 1, + "divideInteger-memory-arguments-slope": 1, + "encodeUtf8-cpu-arguments-intercept": 150000, + "encodeUtf8-cpu-arguments-slope": 1000, + "encodeUtf8-memory-arguments-intercept": 0, + "encodeUtf8-memory-arguments-slope": 8, + "equalsByteString-cpu-arguments-constant": 150000, + "equalsByteString-cpu-arguments-intercept": 112536, + "equalsByteString-cpu-arguments-slope": 247, + "equalsByteString-memory-arguments": 1, + "equalsData-cpu-arguments-intercept": 150000, + "equalsData-cpu-arguments-slope": 10000, + "equalsData-memory-arguments": 1, + "equalsInteger-cpu-arguments-intercept": 136542, + "equalsInteger-cpu-arguments-slope": 1326, + "equalsInteger-memory-arguments": 1, + "equalsString-cpu-arguments-constant": 1000, + "equalsString-cpu-arguments-intercept": 150000, + "equalsString-cpu-arguments-slope": 1000, + "equalsString-memory-arguments": 1, + "fstPair-cpu-arguments": 150000, + "fstPair-memory-arguments": 32, + "headList-cpu-arguments": 150000, + "headList-memory-arguments": 32, + "iData-cpu-arguments": 150000, + "iData-memory-arguments": 32, + "ifThenElse-cpu-arguments": 1, + "ifThenElse-memory-arguments": 1, + "indexByteString-cpu-arguments": 150000, + "indexByteString-memory-arguments": 1, + "lengthOfByteString-cpu-arguments": 150000, + "lengthOfByteString-memory-arguments": 4, + "lessThanByteString-cpu-arguments-intercept": 103599, + "lessThanByteString-cpu-arguments-slope": 248, + "lessThanByteString-memory-arguments": 1, + "lessThanEqualsByteString-cpu-arguments-intercept": 103599, + "lessThanEqualsByteString-cpu-arguments-slope": 248, + "lessThanEqualsByteString-memory-arguments": 1, + "lessThanEqualsInteger-cpu-arguments-intercept": 145276, + "lessThanEqualsInteger-cpu-arguments-slope": 1366, + "lessThanEqualsInteger-memory-arguments": 1, + "lessThanInteger-cpu-arguments-intercept": 179690, + "lessThanInteger-cpu-arguments-slope": 497, + "lessThanInteger-memory-arguments": 1, + "listData-cpu-arguments": 150000, + "listData-memory-arguments": 32, + "mapData-cpu-arguments": 150000, + "mapData-memory-arguments": 32, + "mkCons-cpu-arguments": 150000, + "mkCons-memory-arguments": 32, + "mkNilData-cpu-arguments": 150000, + "mkNilData-memory-arguments": 32, + "mkNilPairData-cpu-arguments": 150000, + "mkNilPairData-memory-arguments": 32, + "mkPairData-cpu-arguments": 150000, + "mkPairData-memory-arguments": 32, + "modInteger-cpu-arguments-constant": 148000, + "modInteger-cpu-arguments-model-arguments-intercept": 425507, + "modInteger-cpu-arguments-model-arguments-slope": 118, + "modInteger-memory-arguments-intercept": 0, + "modInteger-memory-arguments-minimum": 1, + "modInteger-memory-arguments-slope": 1, + "multiplyInteger-cpu-arguments-intercept": 61516, + "multiplyInteger-cpu-arguments-slope": 11218, + "multiplyInteger-memory-arguments-intercept": 0, + "multiplyInteger-memory-arguments-slope": 1, + "nullList-cpu-arguments": 150000, + "nullList-memory-arguments": 32, + "quotientInteger-cpu-arguments-constant": 148000, + "quotientInteger-cpu-arguments-model-arguments-intercept": 425507, + "quotientInteger-cpu-arguments-model-arguments-slope": 118, + "quotientInteger-memory-arguments-intercept": 0, + "quotientInteger-memory-arguments-minimum": 1, + "quotientInteger-memory-arguments-slope": 1, + "remainderInteger-cpu-arguments-constant": 148000, + "remainderInteger-cpu-arguments-model-arguments-intercept": 425507, + "remainderInteger-cpu-arguments-model-arguments-slope": 118, + "remainderInteger-memory-arguments-intercept": 0, + "remainderInteger-memory-arguments-minimum": 1, + "remainderInteger-memory-arguments-slope": 1, + "sha2_256-cpu-arguments-intercept": 2477736, + "sha2_256-cpu-arguments-slope": 29175, + "sha2_256-memory-arguments": 4, + "sha3_256-cpu-arguments-intercept": 0, + "sha3_256-cpu-arguments-slope": 82363, + "sha3_256-memory-arguments": 4, + "sliceByteString-cpu-arguments-intercept": 150000, + "sliceByteString-cpu-arguments-slope": 5000, + "sliceByteString-memory-arguments-intercept": 0, + "sliceByteString-memory-arguments-slope": 1, + "sndPair-cpu-arguments": 150000, + "sndPair-memory-arguments": 32, + "subtractInteger-cpu-arguments-intercept": 197209, + "subtractInteger-cpu-arguments-slope": 0, + "subtractInteger-memory-arguments-intercept": 1, + "subtractInteger-memory-arguments-slope": 1, + "tailList-cpu-arguments": 150000, + "tailList-memory-arguments": 32, + "trace-cpu-arguments": 150000, + "trace-memory-arguments": 32, + "unBData-cpu-arguments": 150000, + "unBData-memory-arguments": 32, + "unConstrData-cpu-arguments": 150000, + "unConstrData-memory-arguments": 32, + "unIData-cpu-arguments": 150000, + "unIData-memory-arguments": 32, + "unListData-cpu-arguments": 150000, + "unListData-memory-arguments": 32, + "unMapData-cpu-arguments": 150000, + "unMapData-memory-arguments": 32, + "verifyEd25519Signature-cpu-arguments-intercept": 3345831, + "verifyEd25519Signature-cpu-arguments-slope": 1, + "verifyEd25519Signature-memory-arguments": 1 + } + } +}, + { + name: 'epoch with formatted PlutusV1&PlutusV2 costModels', + costModels: { + PlutusV1: { + 'bData-cpu-arguments': 1000, + 'iData-cpu-arguments': 1000, + 'trace-cpu-arguments': 212342, + 'mkCons-cpu-arguments': 65493, + 'fstPair-cpu-arguments': 80436, + 'mapData-cpu-arguments': 64832, + 'sndPair-cpu-arguments': 85931, + 'unBData-cpu-arguments': 31220, + 'unIData-cpu-arguments': 43357, + 'bData-memory-arguments': 32, + 'cekLamCost-exBudgetCPU': 23000, + 'cekVarCost-exBudgetCPU': 23000, + 'headList-cpu-arguments': 43249, + 'iData-memory-arguments': 32, + 'listData-cpu-arguments': 52467, + 'nullList-cpu-arguments': 60091, + 'tailList-cpu-arguments': 41182, + 'trace-memory-arguments': 32, + 'mkCons-memory-arguments': 32, + 'mkNilData-cpu-arguments': 22558, + 'unMapData-cpu-arguments': 38314, + 'cekApplyCost-exBudgetCPU': 23000, + 'cekConstCost-exBudgetCPU': 23000, + 'cekDelayCost-exBudgetCPU': 23000, + 'cekForceCost-exBudgetCPU': 23000, + 'chooseData-cpu-arguments': 19537, + 'chooseList-cpu-arguments': 175354, + 'chooseUnit-cpu-arguments': 46417, + 'constrData-cpu-arguments': 89141, + 'fstPair-memory-arguments': 32, + 'ifThenElse-cpu-arguments': 80556, + 'mapData-memory-arguments': 32, + 'mkPairData-cpu-arguments': 76511, + 'sndPair-memory-arguments': 32, + 'unBData-memory-arguments': 32, + 'unIData-memory-arguments': 32, + 'unListData-cpu-arguments': 32247, + 'cekLamCost-exBudgetMemory': 100, + 'cekVarCost-exBudgetMemory': 100, + 'headList-memory-arguments': 32, + 'listData-memory-arguments': 32, + 'nullList-memory-arguments': 32, + 'sha2_256-memory-arguments': 4, + 'sha3_256-memory-arguments': 4, + 'tailList-memory-arguments': 32, + 'cekBuiltinCost-exBudgetCPU': 23000, + 'cekStartupCost-exBudgetCPU': 100, + 'mkNilData-memory-arguments': 32, + 'unConstrData-cpu-arguments': 32696, + 'unMapData-memory-arguments': 32, + 'cekApplyCost-exBudgetMemory': 100, + 'cekConstCost-exBudgetMemory': 100, + 'cekDelayCost-exBudgetMemory': 100, + 'cekForceCost-exBudgetMemory': 100, + 'chooseData-memory-arguments': 32, + 'chooseList-memory-arguments': 32, + 'chooseUnit-memory-arguments': 4, + 'constrData-memory-arguments': 32, + 'equalsData-memory-arguments': 1, + 'ifThenElse-memory-arguments': 1, + 'mkNilPairData-cpu-arguments': 16563, + 'mkPairData-memory-arguments': 32, + 'unListData-memory-arguments': 32, + 'blake2b_256-memory-arguments': 4, + 'sha2_256-cpu-arguments-slope': 30482, + 'sha3_256-cpu-arguments-slope': 82523, + 'cekBuiltinCost-exBudgetMemory': 100, + 'cekStartupCost-exBudgetMemory': 100, + 'equalsString-memory-arguments': 1, + 'indexByteString-cpu-arguments': 57667, + 'unConstrData-memory-arguments': 32, + 'addInteger-cpu-arguments-slope': 812, + 'decodeUtf8-cpu-arguments-slope': 14068, + 'encodeUtf8-cpu-arguments-slope': 28662, + 'equalsData-cpu-arguments-slope': 12586, + 'equalsInteger-memory-arguments': 1, + 'mkNilPairData-memory-arguments': 32, + 'blake2b_256-cpu-arguments-slope': 10475, + 'appendString-cpu-arguments-slope': 24177, + 'equalsString-cpu-arguments-slope': 52998, + 'indexByteString-memory-arguments': 4, + 'lengthOfByteString-cpu-arguments': 1000, + 'lessThanInteger-memory-arguments': 1, + 'sha2_256-cpu-arguments-intercept': 806990, + 'sha3_256-cpu-arguments-intercept': 1927926, + 'addInteger-memory-arguments-slope': 1, + 'decodeUtf8-memory-arguments-slope': 2, + 'encodeUtf8-memory-arguments-slope': 2, + 'equalsByteString-memory-arguments': 1, + 'equalsInteger-cpu-arguments-slope': 421, + 'modInteger-cpu-arguments-constant': 196500, + 'modInteger-memory-arguments-slope': 1, + 'addInteger-cpu-arguments-intercept': 205665, + 'consByteString-cpu-arguments-slope': 511, + 'decodeUtf8-cpu-arguments-intercept': 497525, + 'encodeUtf8-cpu-arguments-intercept': 1000, + 'equalsData-cpu-arguments-intercept': 1060367, + 'appendString-memory-arguments-slope': 1, + 'blake2b_256-cpu-arguments-intercept': 117366, + 'equalsString-cpu-arguments-constant': 187000, + 'lengthOfByteString-memory-arguments': 10, + 'lessThanByteString-memory-arguments': 1, + 'lessThanInteger-cpu-arguments-slope': 511, + 'modInteger-memory-arguments-minimum': 1, + 'multiplyInteger-cpu-arguments-slope': 11687, + 'sliceByteString-cpu-arguments-slope': 0, + 'subtractInteger-cpu-arguments-slope': 812, + 'appendByteString-cpu-arguments-slope': 571, + 'appendString-cpu-arguments-intercept': 1000, + 'divideInteger-cpu-arguments-constant': 196500, + 'divideInteger-memory-arguments-slope': 1, + 'equalsByteString-cpu-arguments-slope': 62, + 'equalsString-cpu-arguments-intercept': 1000, + 'addInteger-memory-arguments-intercept': 1, + 'consByteString-memory-arguments-slope': 1, + 'decodeUtf8-memory-arguments-intercept': 4, + 'encodeUtf8-memory-arguments-intercept': 4, + 'equalsInteger-cpu-arguments-intercept': 208512, + 'modInteger-memory-arguments-intercept': 0, + 'consByteString-cpu-arguments-intercept': 221973, + 'divideInteger-memory-arguments-minimum': 1, + 'lessThanByteString-cpu-arguments-slope': 156, + 'lessThanEqualsInteger-memory-arguments': 1, + 'multiplyInteger-memory-arguments-slope': 1, + 'quotientInteger-cpu-arguments-constant': 196500, + 'quotientInteger-memory-arguments-slope': 1, + 'sliceByteString-memory-arguments-slope': 0, + 'subtractInteger-memory-arguments-slope': 1, + 'appendByteString-memory-arguments-slope': 1, + 'appendString-memory-arguments-intercept': 4, + 'equalsByteString-cpu-arguments-constant': 245000, + 'lessThanInteger-cpu-arguments-intercept': 208896, + 'multiplyInteger-cpu-arguments-intercept': 69522, + 'remainderInteger-cpu-arguments-constant': 196500, + 'remainderInteger-memory-arguments-slope': 1, + 'sliceByteString-cpu-arguments-intercept': 265318, + 'subtractInteger-cpu-arguments-intercept': 205665, + 'verifyEd25519Signature-memory-arguments': 10, + 'appendByteString-cpu-arguments-intercept': 1000, + 'divideInteger-memory-arguments-intercept': 0, + 'equalsByteString-cpu-arguments-intercept': 216773, + 'quotientInteger-memory-arguments-minimum': 1, + 'consByteString-memory-arguments-intercept': 0, + 'lessThanEqualsByteString-memory-arguments': 1, + 'lessThanEqualsInteger-cpu-arguments-slope': 473, + 'remainderInteger-memory-arguments-minimum': 1, + 'lessThanByteString-cpu-arguments-intercept': 197145, + 'multiplyInteger-memory-arguments-intercept': 0, + 'quotientInteger-memory-arguments-intercept': 0, + 'sliceByteString-memory-arguments-intercept': 4, + 'subtractInteger-memory-arguments-intercept': 1, + 'verifyEd25519Signature-cpu-arguments-slope': 1021, + 'appendByteString-memory-arguments-intercept': 0, + 'remainderInteger-memory-arguments-intercept': 0, + 'lessThanEqualsByteString-cpu-arguments-slope': 156, + 'lessThanEqualsInteger-cpu-arguments-intercept': 204924, + 'modInteger-cpu-arguments-model-arguments-slope': 220, + 'verifyEd25519Signature-cpu-arguments-intercept': 9462713, + 'lessThanEqualsByteString-cpu-arguments-intercept': 197145, + 'divideInteger-cpu-arguments-model-arguments-slope': 220, + 'modInteger-cpu-arguments-model-arguments-intercept': 453240, + 'quotientInteger-cpu-arguments-model-arguments-slope': 220, + 'remainderInteger-cpu-arguments-model-arguments-slope': 220, + 'divideInteger-cpu-arguments-model-arguments-intercept': 453240, + 'quotientInteger-cpu-arguments-model-arguments-intercept': 453240, + 'remainderInteger-cpu-arguments-model-arguments-intercept': 453240 + }, + PlutusV2: { + 'bData-cpu-arguments': 1000, + 'iData-cpu-arguments': 1000, + 'trace-cpu-arguments': 212342, + 'mkCons-cpu-arguments': 65493, + 'fstPair-cpu-arguments': 80436, + 'mapData-cpu-arguments': 64832, + 'sndPair-cpu-arguments': 85931, + 'unBData-cpu-arguments': 31220, + 'unIData-cpu-arguments': 43357, + 'bData-memory-arguments': 32, + 'cekLamCost-exBudgetCPU': 23000, + 'cekVarCost-exBudgetCPU': 23000, + 'headList-cpu-arguments': 43249, + 'iData-memory-arguments': 32, + 'listData-cpu-arguments': 52467, + 'nullList-cpu-arguments': 60091, + 'tailList-cpu-arguments': 41182, + 'trace-memory-arguments': 32, + 'mkCons-memory-arguments': 32, + 'mkNilData-cpu-arguments': 22558, + 'unMapData-cpu-arguments': 38314, + 'cekApplyCost-exBudgetCPU': 23000, + 'cekConstCost-exBudgetCPU': 23000, + 'cekDelayCost-exBudgetCPU': 23000, + 'cekForceCost-exBudgetCPU': 23000, + 'chooseData-cpu-arguments': 19537, + 'chooseList-cpu-arguments': 175354, + 'chooseUnit-cpu-arguments': 46417, + 'constrData-cpu-arguments': 89141, + 'fstPair-memory-arguments': 32, + 'ifThenElse-cpu-arguments': 80556, + 'mapData-memory-arguments': 32, + 'mkPairData-cpu-arguments': 76511, + 'sndPair-memory-arguments': 32, + 'unBData-memory-arguments': 32, + 'unIData-memory-arguments': 32, + 'unListData-cpu-arguments': 32247, + 'cekLamCost-exBudgetMemory': 100, + 'cekVarCost-exBudgetMemory': 100, + 'headList-memory-arguments': 32, + 'listData-memory-arguments': 32, + 'nullList-memory-arguments': 32, + 'sha2_256-memory-arguments': 4, + 'sha3_256-memory-arguments': 4, + 'tailList-memory-arguments': 32, + 'cekBuiltinCost-exBudgetCPU': 23000, + 'cekStartupCost-exBudgetCPU': 100, + 'mkNilData-memory-arguments': 32, + 'unConstrData-cpu-arguments': 32696, + 'unMapData-memory-arguments': 32, + 'cekApplyCost-exBudgetMemory': 100, + 'cekConstCost-exBudgetMemory': 100, + 'cekDelayCost-exBudgetMemory': 100, + 'cekForceCost-exBudgetMemory': 100, + 'chooseData-memory-arguments': 32, + 'chooseList-memory-arguments': 32, + 'chooseUnit-memory-arguments': 4, + 'constrData-memory-arguments': 32, + 'equalsData-memory-arguments': 1, + 'ifThenElse-memory-arguments': 1, + 'mkNilPairData-cpu-arguments': 16563, + 'mkPairData-memory-arguments': 32, + 'unListData-memory-arguments': 32, + 'blake2b_256-memory-arguments': 4, + 'sha2_256-cpu-arguments-slope': 30482, + 'sha3_256-cpu-arguments-slope': 82523, + 'cekBuiltinCost-exBudgetMemory': 100, + 'cekStartupCost-exBudgetMemory': 100, + 'equalsString-memory-arguments': 1, + 'indexByteString-cpu-arguments': 57667, + 'unConstrData-memory-arguments': 32, + 'addInteger-cpu-arguments-slope': 812, + 'decodeUtf8-cpu-arguments-slope': 14068, + 'encodeUtf8-cpu-arguments-slope': 28662, + 'equalsData-cpu-arguments-slope': 12586, + 'equalsInteger-memory-arguments': 1, + 'mkNilPairData-memory-arguments': 32, + 'blake2b_256-cpu-arguments-slope': 10475, + 'appendString-cpu-arguments-slope': 24177, + 'equalsString-cpu-arguments-slope': 52998, + 'indexByteString-memory-arguments': 4, + 'lengthOfByteString-cpu-arguments': 1000, + 'lessThanInteger-memory-arguments': 1, + 'sha2_256-cpu-arguments-intercept': 806990, + 'sha3_256-cpu-arguments-intercept': 1927926, + 'addInteger-memory-arguments-slope': 1, + 'decodeUtf8-memory-arguments-slope': 2, + 'encodeUtf8-memory-arguments-slope': 2, + 'equalsByteString-memory-arguments': 1, + 'equalsInteger-cpu-arguments-slope': 421, + 'modInteger-cpu-arguments-constant': 196500, + 'modInteger-memory-arguments-slope': 1, + 'serialiseData-cpu-arguments-slope': 392670, + 'addInteger-cpu-arguments-intercept': 205665, + 'consByteString-cpu-arguments-slope': 511, + 'decodeUtf8-cpu-arguments-intercept': 497525, + 'encodeUtf8-cpu-arguments-intercept': 1000, + 'equalsData-cpu-arguments-intercept': 1060367, + 'appendString-memory-arguments-slope': 1, + 'blake2b_256-cpu-arguments-intercept': 117366, + 'equalsString-cpu-arguments-constant': 187000, + 'lengthOfByteString-memory-arguments': 10, + 'lessThanByteString-memory-arguments': 1, + 'lessThanInteger-cpu-arguments-slope': 511, + 'modInteger-memory-arguments-minimum': 1, + 'multiplyInteger-cpu-arguments-slope': 11687, + 'sliceByteString-cpu-arguments-slope': 0, + 'subtractInteger-cpu-arguments-slope': 812, + 'appendByteString-cpu-arguments-slope': 571, + 'appendString-cpu-arguments-intercept': 1000, + 'divideInteger-cpu-arguments-constant': 196500, + 'divideInteger-memory-arguments-slope': 1, + 'equalsByteString-cpu-arguments-slope': 62, + 'equalsString-cpu-arguments-intercept': 1000, + 'serialiseData-memory-arguments-slope': 2, + 'addInteger-memory-arguments-intercept': 1, + 'consByteString-memory-arguments-slope': 1, + 'decodeUtf8-memory-arguments-intercept': 4, + 'encodeUtf8-memory-arguments-intercept': 4, + 'equalsInteger-cpu-arguments-intercept': 208512, + 'modInteger-memory-arguments-intercept': 0, + 'serialiseData-cpu-arguments-intercept': 1159724, + 'consByteString-cpu-arguments-intercept': 221973, + 'divideInteger-memory-arguments-minimum': 1, + 'lessThanByteString-cpu-arguments-slope': 156, + 'lessThanEqualsInteger-memory-arguments': 1, + 'multiplyInteger-memory-arguments-slope': 1, + 'quotientInteger-cpu-arguments-constant': 196500, + 'quotientInteger-memory-arguments-slope': 1, + 'sliceByteString-memory-arguments-slope': 0, + 'subtractInteger-memory-arguments-slope': 1, + 'appendByteString-memory-arguments-slope': 1, + 'appendString-memory-arguments-intercept': 4, + 'equalsByteString-cpu-arguments-constant': 245000, + 'lessThanInteger-cpu-arguments-intercept': 208896, + 'multiplyInteger-cpu-arguments-intercept': 69522, + 'remainderInteger-cpu-arguments-constant': 196500, + 'remainderInteger-memory-arguments-slope': 1, + 'sliceByteString-cpu-arguments-intercept': 265318, + 'subtractInteger-cpu-arguments-intercept': 205665, + 'verifyEd25519Signature-memory-arguments': 10, + 'appendByteString-cpu-arguments-intercept': 1000, + 'divideInteger-memory-arguments-intercept': 0, + 'equalsByteString-cpu-arguments-intercept': 216773, + 'quotientInteger-memory-arguments-minimum': 1, + 'serialiseData-memory-arguments-intercept': 0, + 'consByteString-memory-arguments-intercept': 0, + 'lessThanEqualsByteString-memory-arguments': 1, + 'lessThanEqualsInteger-cpu-arguments-slope': 473, + 'remainderInteger-memory-arguments-minimum': 1, + 'lessThanByteString-cpu-arguments-intercept': 197145, + 'multiplyInteger-memory-arguments-intercept': 0, + 'quotientInteger-memory-arguments-intercept': 0, + 'sliceByteString-memory-arguments-intercept': 4, + 'subtractInteger-memory-arguments-intercept': 1, + 'verifyEd25519Signature-cpu-arguments-slope': 1021, + 'appendByteString-memory-arguments-intercept': 0, + 'remainderInteger-memory-arguments-intercept': 0, + 'verifyEcdsaSecp256k1Signature-cpu-arguments': 20000000000, + 'lessThanEqualsByteString-cpu-arguments-slope': 156, + 'lessThanEqualsInteger-cpu-arguments-intercept': 204924, + 'modInteger-cpu-arguments-model-arguments-slope': 220, + 'verifyEcdsaSecp256k1Signature-memory-arguments': 20000000000, + 'verifyEd25519Signature-cpu-arguments-intercept': 9462713, + 'lessThanEqualsByteString-cpu-arguments-intercept': 197145, + 'verifySchnorrSecp256k1Signature-memory-arguments': 20000000000, + 'divideInteger-cpu-arguments-model-arguments-slope': 220, + 'modInteger-cpu-arguments-model-arguments-intercept': 453240, + 'quotientInteger-cpu-arguments-model-arguments-slope': 220, + 'verifySchnorrSecp256k1Signature-cpu-arguments-slope': 0, + 'remainderInteger-cpu-arguments-model-arguments-slope': 220, + 'divideInteger-cpu-arguments-model-arguments-intercept': 453240, + 'quotientInteger-cpu-arguments-model-arguments-intercept': 453240, + 'verifySchnorrSecp256k1Signature-cpu-arguments-intercept': 20000000000, + 'remainderInteger-cpu-arguments-model-arguments-intercept': 453240 + } + }, + result: { + "PlutusV1": { + "addInteger-cpu-arguments-intercept": 205665, + "addInteger-cpu-arguments-slope": 812, + "addInteger-memory-arguments-intercept": 1, + "addInteger-memory-arguments-slope": 1, + "appendByteString-cpu-arguments-intercept": 1000, + "appendByteString-cpu-arguments-slope": 571, + "appendByteString-memory-arguments-intercept": 0, + "appendByteString-memory-arguments-slope": 1, + "appendString-cpu-arguments-intercept": 1000, + "appendString-cpu-arguments-slope": 24177, + "appendString-memory-arguments-intercept": 4, + "appendString-memory-arguments-slope": 1, + "bData-cpu-arguments": 1000, + "bData-memory-arguments": 32, + "blake2b_256-cpu-arguments-intercept": 117366, + "blake2b_256-cpu-arguments-slope": 10475, + "blake2b_256-memory-arguments": 4, + "cekApplyCost-exBudgetCPU": 23000, + "cekApplyCost-exBudgetMemory": 100, + "cekBuiltinCost-exBudgetCPU": 23000, + "cekBuiltinCost-exBudgetMemory": 100, + "cekConstCost-exBudgetCPU": 23000, + "cekConstCost-exBudgetMemory": 100, + "cekDelayCost-exBudgetCPU": 23000, + "cekDelayCost-exBudgetMemory": 100, + "cekForceCost-exBudgetCPU": 23000, + "cekForceCost-exBudgetMemory": 100, + "cekLamCost-exBudgetCPU": 23000, + "cekLamCost-exBudgetMemory": 100, + "cekStartupCost-exBudgetCPU": 100, + "cekStartupCost-exBudgetMemory": 100, + "cekVarCost-exBudgetCPU": 23000, + "cekVarCost-exBudgetMemory": 100, + "chooseData-cpu-arguments": 19537, + "chooseData-memory-arguments": 32, + "chooseList-cpu-arguments": 175354, + "chooseList-memory-arguments": 32, + "chooseUnit-cpu-arguments": 46417, + "chooseUnit-memory-arguments": 4, + "consByteString-cpu-arguments-intercept": 221973, + "consByteString-cpu-arguments-slope": 511, + "consByteString-memory-arguments-intercept": 0, + "consByteString-memory-arguments-slope": 1, + "constrData-cpu-arguments": 89141, + "constrData-memory-arguments": 32, + "decodeUtf8-cpu-arguments-intercept": 497525, + "decodeUtf8-cpu-arguments-slope": 14068, + "decodeUtf8-memory-arguments-intercept": 4, + "decodeUtf8-memory-arguments-slope": 2, + "divideInteger-cpu-arguments-constant": 196500, + "divideInteger-cpu-arguments-model-arguments-intercept": 453240, + "divideInteger-cpu-arguments-model-arguments-slope": 220, + "divideInteger-memory-arguments-intercept": 0, + "divideInteger-memory-arguments-minimum": 1, + "divideInteger-memory-arguments-slope": 1, + "encodeUtf8-cpu-arguments-intercept": 1000, + "encodeUtf8-cpu-arguments-slope": 28662, + "encodeUtf8-memory-arguments-intercept": 4, + "encodeUtf8-memory-arguments-slope": 2, + "equalsByteString-cpu-arguments-constant": 245000, + "equalsByteString-cpu-arguments-intercept": 216773, + "equalsByteString-cpu-arguments-slope": 62, + "equalsByteString-memory-arguments": 1, + "equalsData-cpu-arguments-intercept": 1060367, + "equalsData-cpu-arguments-slope": 12586, + "equalsData-memory-arguments": 1, + "equalsInteger-cpu-arguments-intercept": 208512, + "equalsInteger-cpu-arguments-slope": 421, + "equalsInteger-memory-arguments": 1, + "equalsString-cpu-arguments-constant": 187000, + "equalsString-cpu-arguments-intercept": 1000, + "equalsString-cpu-arguments-slope": 52998, + "equalsString-memory-arguments": 1, + "fstPair-cpu-arguments": 80436, + "fstPair-memory-arguments": 32, + "headList-cpu-arguments": 43249, + "headList-memory-arguments": 32, + "iData-cpu-arguments": 1000, + "iData-memory-arguments": 32, + "ifThenElse-cpu-arguments": 80556, + "ifThenElse-memory-arguments": 1, + "indexByteString-cpu-arguments": 57667, + "indexByteString-memory-arguments": 4, + "lengthOfByteString-cpu-arguments": 1000, + "lengthOfByteString-memory-arguments": 10, + "lessThanByteString-cpu-arguments-intercept": 197145, + "lessThanByteString-cpu-arguments-slope": 156, + "lessThanByteString-memory-arguments": 1, + "lessThanEqualsByteString-cpu-arguments-intercept": 197145, + "lessThanEqualsByteString-cpu-arguments-slope": 156, + "lessThanEqualsByteString-memory-arguments": 1, + "lessThanEqualsInteger-cpu-arguments-intercept": 204924, + "lessThanEqualsInteger-cpu-arguments-slope": 473, + "lessThanEqualsInteger-memory-arguments": 1, + "lessThanInteger-cpu-arguments-intercept": 208896, + "lessThanInteger-cpu-arguments-slope": 511, + "lessThanInteger-memory-arguments": 1, + "listData-cpu-arguments": 52467, + "listData-memory-arguments": 32, + "mapData-cpu-arguments": 64832, + "mapData-memory-arguments": 32, + "mkCons-cpu-arguments": 65493, + "mkCons-memory-arguments": 32, + "mkNilData-cpu-arguments": 22558, + "mkNilData-memory-arguments": 32, + "mkNilPairData-cpu-arguments": 16563, + "mkNilPairData-memory-arguments": 32, + "mkPairData-cpu-arguments": 76511, + "mkPairData-memory-arguments": 32, + "modInteger-cpu-arguments-constant": 196500, + "modInteger-cpu-arguments-model-arguments-intercept": 453240, + "modInteger-cpu-arguments-model-arguments-slope": 220, + "modInteger-memory-arguments-intercept": 0, + "modInteger-memory-arguments-minimum": 1, + "modInteger-memory-arguments-slope": 1, + "multiplyInteger-cpu-arguments-intercept": 69522, + "multiplyInteger-cpu-arguments-slope": 11687, + "multiplyInteger-memory-arguments-intercept": 0, + "multiplyInteger-memory-arguments-slope": 1, + "nullList-cpu-arguments": 60091, + "nullList-memory-arguments": 32, + "quotientInteger-cpu-arguments-constant": 196500, + "quotientInteger-cpu-arguments-model-arguments-intercept": 453240, + "quotientInteger-cpu-arguments-model-arguments-slope": 220, + "quotientInteger-memory-arguments-intercept": 0, + "quotientInteger-memory-arguments-minimum": 1, + "quotientInteger-memory-arguments-slope": 1, + "remainderInteger-cpu-arguments-constant": 196500, + "remainderInteger-cpu-arguments-model-arguments-intercept": 453240, + "remainderInteger-cpu-arguments-model-arguments-slope": 220, + "remainderInteger-memory-arguments-intercept": 0, + "remainderInteger-memory-arguments-minimum": 1, + "remainderInteger-memory-arguments-slope": 1, + "sha2_256-cpu-arguments-intercept": 806990, + "sha2_256-cpu-arguments-slope": 30482, + "sha2_256-memory-arguments": 4, + "sha3_256-cpu-arguments-intercept": 1927926, + "sha3_256-cpu-arguments-slope": 82523, + "sha3_256-memory-arguments": 4, + "sliceByteString-cpu-arguments-intercept": 265318, + "sliceByteString-cpu-arguments-slope": 0, + "sliceByteString-memory-arguments-intercept": 4, + "sliceByteString-memory-arguments-slope": 0, + "sndPair-cpu-arguments": 85931, + "sndPair-memory-arguments": 32, + "subtractInteger-cpu-arguments-intercept": 205665, + "subtractInteger-cpu-arguments-slope": 812, + "subtractInteger-memory-arguments-intercept": 1, + "subtractInteger-memory-arguments-slope": 1, + "tailList-cpu-arguments": 41182, + "tailList-memory-arguments": 32, + "trace-cpu-arguments": 212342, + "trace-memory-arguments": 32, + "unBData-cpu-arguments": 31220, + "unBData-memory-arguments": 32, + "unConstrData-cpu-arguments": 32696, + "unConstrData-memory-arguments": 32, + "unIData-cpu-arguments": 43357, + "unIData-memory-arguments": 32, + "unListData-cpu-arguments": 32247, + "unListData-memory-arguments": 32, + "unMapData-cpu-arguments": 38314, + "unMapData-memory-arguments": 32, + "verifyEd25519Signature-cpu-arguments-intercept": 9462713, + "verifyEd25519Signature-cpu-arguments-slope": 1021, + "verifyEd25519Signature-memory-arguments": 10 + }, + "PlutusV2": { + "addInteger-cpu-arguments-intercept": 205665, + "addInteger-cpu-arguments-slope": 812, + "addInteger-memory-arguments-intercept": 1, + "addInteger-memory-arguments-slope": 1, + "appendByteString-cpu-arguments-intercept": 1000, + "appendByteString-cpu-arguments-slope": 571, + "appendByteString-memory-arguments-intercept": 0, + "appendByteString-memory-arguments-slope": 1, + "appendString-cpu-arguments-intercept": 1000, + "appendString-cpu-arguments-slope": 24177, + "appendString-memory-arguments-intercept": 4, + "appendString-memory-arguments-slope": 1, + "bData-cpu-arguments": 1000, + "bData-memory-arguments": 32, + "blake2b_256-cpu-arguments-intercept": 117366, + "blake2b_256-cpu-arguments-slope": 10475, + "blake2b_256-memory-arguments": 4, + "cekApplyCost-exBudgetCPU": 23000, + "cekApplyCost-exBudgetMemory": 100, + "cekBuiltinCost-exBudgetCPU": 23000, + "cekBuiltinCost-exBudgetMemory": 100, + "cekConstCost-exBudgetCPU": 23000, + "cekConstCost-exBudgetMemory": 100, + "cekDelayCost-exBudgetCPU": 23000, + "cekDelayCost-exBudgetMemory": 100, + "cekForceCost-exBudgetCPU": 23000, + "cekForceCost-exBudgetMemory": 100, + "cekLamCost-exBudgetCPU": 23000, + "cekLamCost-exBudgetMemory": 100, + "cekStartupCost-exBudgetCPU": 100, + "cekStartupCost-exBudgetMemory": 100, + "cekVarCost-exBudgetCPU": 23000, + "cekVarCost-exBudgetMemory": 100, + "chooseData-cpu-arguments": 19537, + "chooseData-memory-arguments": 32, + "chooseList-cpu-arguments": 175354, + "chooseList-memory-arguments": 32, + "chooseUnit-cpu-arguments": 46417, + "chooseUnit-memory-arguments": 4, + "consByteString-cpu-arguments-intercept": 221973, + "consByteString-cpu-arguments-slope": 511, + "consByteString-memory-arguments-intercept": 0, + "consByteString-memory-arguments-slope": 1, + "constrData-cpu-arguments": 89141, + "constrData-memory-arguments": 32, + "decodeUtf8-cpu-arguments-intercept": 497525, + "decodeUtf8-cpu-arguments-slope": 14068, + "decodeUtf8-memory-arguments-intercept": 4, + "decodeUtf8-memory-arguments-slope": 2, + "divideInteger-cpu-arguments-constant": 196500, + "divideInteger-cpu-arguments-model-arguments-intercept": 453240, + "divideInteger-cpu-arguments-model-arguments-slope": 220, + "divideInteger-memory-arguments-intercept": 0, + "divideInteger-memory-arguments-minimum": 1, + "divideInteger-memory-arguments-slope": 1, + "encodeUtf8-cpu-arguments-intercept": 1000, + "encodeUtf8-cpu-arguments-slope": 28662, + "encodeUtf8-memory-arguments-intercept": 4, + "encodeUtf8-memory-arguments-slope": 2, + "equalsByteString-cpu-arguments-constant": 245000, + "equalsByteString-cpu-arguments-intercept": 216773, + "equalsByteString-cpu-arguments-slope": 62, + "equalsByteString-memory-arguments": 1, + "equalsData-cpu-arguments-intercept": 1060367, + "equalsData-cpu-arguments-slope": 12586, + "equalsData-memory-arguments": 1, + "equalsInteger-cpu-arguments-intercept": 208512, + "equalsInteger-cpu-arguments-slope": 421, + "equalsInteger-memory-arguments": 1, + "equalsString-cpu-arguments-constant": 187000, + "equalsString-cpu-arguments-intercept": 1000, + "equalsString-cpu-arguments-slope": 52998, + "equalsString-memory-arguments": 1, + "fstPair-cpu-arguments": 80436, + "fstPair-memory-arguments": 32, + "headList-cpu-arguments": 43249, + "headList-memory-arguments": 32, + "iData-cpu-arguments": 1000, + "iData-memory-arguments": 32, + "ifThenElse-cpu-arguments": 80556, + "ifThenElse-memory-arguments": 1, + "indexByteString-cpu-arguments": 57667, + "indexByteString-memory-arguments": 4, + "lengthOfByteString-cpu-arguments": 1000, + "lengthOfByteString-memory-arguments": 10, + "lessThanByteString-cpu-arguments-intercept": 197145, + "lessThanByteString-cpu-arguments-slope": 156, + "lessThanByteString-memory-arguments": 1, + "lessThanEqualsByteString-cpu-arguments-intercept": 197145, + "lessThanEqualsByteString-cpu-arguments-slope": 156, + "lessThanEqualsByteString-memory-arguments": 1, + "lessThanEqualsInteger-cpu-arguments-intercept": 204924, + "lessThanEqualsInteger-cpu-arguments-slope": 473, + "lessThanEqualsInteger-memory-arguments": 1, + "lessThanInteger-cpu-arguments-intercept": 208896, + "lessThanInteger-cpu-arguments-slope": 511, + "lessThanInteger-memory-arguments": 1, + "listData-cpu-arguments": 52467, + "listData-memory-arguments": 32, + "mapData-cpu-arguments": 64832, + "mapData-memory-arguments": 32, + "mkCons-cpu-arguments": 65493, + "mkCons-memory-arguments": 32, + "mkNilData-cpu-arguments": 22558, + "mkNilData-memory-arguments": 32, + "mkNilPairData-cpu-arguments": 16563, + "mkNilPairData-memory-arguments": 32, + "mkPairData-cpu-arguments": 76511, + "mkPairData-memory-arguments": 32, + "modInteger-cpu-arguments-constant": 196500, + "modInteger-cpu-arguments-model-arguments-intercept": 453240, + "modInteger-cpu-arguments-model-arguments-slope": 220, + "modInteger-memory-arguments-intercept": 0, + "modInteger-memory-arguments-minimum": 1, + "modInteger-memory-arguments-slope": 1, + "multiplyInteger-cpu-arguments-intercept": 69522, + "multiplyInteger-cpu-arguments-slope": 11687, + "multiplyInteger-memory-arguments-intercept": 0, + "multiplyInteger-memory-arguments-slope": 1, + "nullList-cpu-arguments": 60091, + "nullList-memory-arguments": 32, + "quotientInteger-cpu-arguments-constant": 196500, + "quotientInteger-cpu-arguments-model-arguments-intercept": 453240, + "quotientInteger-cpu-arguments-model-arguments-slope": 220, + "quotientInteger-memory-arguments-intercept": 0, + "quotientInteger-memory-arguments-minimum": 1, + "quotientInteger-memory-arguments-slope": 1, + "remainderInteger-cpu-arguments-constant": 196500, + "remainderInteger-cpu-arguments-model-arguments-intercept": 453240, + "remainderInteger-cpu-arguments-model-arguments-slope": 220, + "remainderInteger-memory-arguments-intercept": 0, + "remainderInteger-memory-arguments-minimum": 1, + "remainderInteger-memory-arguments-slope": 1, + "serialiseData-cpu-arguments-intercept": 1159724, + "serialiseData-cpu-arguments-slope": 392670, + "serialiseData-memory-arguments-intercept": 0, + "serialiseData-memory-arguments-slope": 2, + "sha2_256-cpu-arguments-intercept": 806990, + "sha2_256-cpu-arguments-slope": 30482, + "sha2_256-memory-arguments": 4, + "sha3_256-cpu-arguments-intercept": 1927926, + "sha3_256-cpu-arguments-slope": 82523, + "sha3_256-memory-arguments": 4, + "sliceByteString-cpu-arguments-intercept": 265318, + "sliceByteString-cpu-arguments-slope": 0, + "sliceByteString-memory-arguments-intercept": 4, + "sliceByteString-memory-arguments-slope": 0, + "sndPair-cpu-arguments": 85931, + "sndPair-memory-arguments": 32, + "subtractInteger-cpu-arguments-intercept": 205665, + "subtractInteger-cpu-arguments-slope": 812, + "subtractInteger-memory-arguments-intercept": 1, + "subtractInteger-memory-arguments-slope": 1, + "tailList-cpu-arguments": 41182, + "tailList-memory-arguments": 32, + "trace-cpu-arguments": 212342, + "trace-memory-arguments": 32, + "unBData-cpu-arguments": 31220, + "unBData-memory-arguments": 32, + "unConstrData-cpu-arguments": 32696, + "unConstrData-memory-arguments": 32, + "unIData-cpu-arguments": 43357, + "unIData-memory-arguments": 32, + "unListData-cpu-arguments": 32247, + "unListData-memory-arguments": 32, + "unMapData-cpu-arguments": 38314, + "unMapData-memory-arguments": 32, + "verifyEcdsaSecp256k1Signature-cpu-arguments": 20000000000, + "verifyEcdsaSecp256k1Signature-memory-arguments": 20000000000, + "verifyEd25519Signature-cpu-arguments-intercept": 9462713, + "verifyEd25519Signature-cpu-arguments-slope": 1021, + "verifyEd25519Signature-memory-arguments": 10, + "verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 20000000000, + "verifySchnorrSecp256k1Signature-cpu-arguments-slope": 0, + "verifySchnorrSecp256k1Signature-memory-arguments": 20000000000 + } + }, +} +]; diff --git a/test/unit/tests/utils/cost-models-map.ts b/test/unit/tests/utils/cost-models-map.ts new file mode 100644 index 00000000..bcb4ea52 --- /dev/null +++ b/test/unit/tests/utils/cost-models-map.ts @@ -0,0 +1,13 @@ +import { costModelsMapFixture } from '../../fixtures/cost-models-map-fixtures.js'; +import * as costModelsMapUtils from '../../../../src/utils/cost-models-map.js'; +import { describe, expect, test } from 'vitest'; + +describe('costModelsMap utils', () => { + costModelsMapFixture.map(fixture => { + test(fixture.name, async () => { + const result = costModelsMapUtils.costModelsMap(fixture.costModels); + + expect(result).toStrictEqual(fixture.result); + }); + }); +});