cardanoapi / hardfork-testing

Hardfork testing by Dquadrant Team (Project management repository)
0 stars 0 forks source link

Budget overspent on PlutusV3 only #44

Closed mesudip closed 2 weeks ago

mesudip commented 1 month ago

cardano-node = 9.0.0 cardano-api = 9.0.0

Test run log on local cluster


2.1 SimpleMarketV3 Flow : "Mint Native Asset"
Fee      :   8503
Tx Bytes (ledger):   8402
Tx Bytes (api)   :   8403

2.3 SimpleMarketV3 Flow : "Place on Sell"
Fee      :   903
Tx Bytes (ledger):   802
Tx Bytes (api)   :   803

2.4 SimpleMarketV3 Flow : "Withdraw"
Withdraw Tx Failed: FrameworkError: PlutusScriptError: "CekError : An error has occurred:
The machine terminated part way through evaluation due to overspending the budget.
The budget when the machine terminated was:\n({cpu: 9728648862\n| mem: -18267109})\nNegative numbers indicate the overspent budget; note that this only indicates the budget that was needed for the next step, not to run the program to completion. : []"

2.5 SimpleMarketV3 Flow : "Buy"
Buy Tx Failed: FrameworkError: PlutusScriptError: "CekError : An error has occurred:
The machine terminated part way through evaluation due to overspending the budget.
The budget when the machine terminated was:\n({cpu: 9728648862\n| mem: -18267109})\nNegative numbers indicate the overspent budget; note that this only indicates the budget that was needed for the next step, not to run the program to completion. : []"

2.6 SimpleMarketV3 Flow : "Withdraw with RefScript"
Withdraw with RefScript Tx Failed: FrameworkError: PlutusScriptError: "CekError : An error has occurred:
The machine terminated part way through evaluation due to overspending the budget.\nThe budget when the machine terminated was:\n({cpu: 9728648862\n| mem: -18267109})\nNegative numbers indicate the overspent budget; note that this only indicates the budget that was needed for the next step, not to run the program to completion. : []"

2.7 SimpleMarketV3 Flow : "Buy with RefScript"
Buy with RefScript Tx Failed: FrameworkError: PlutusScriptError: "CekError : An error has occurred:
The machine terminated part way through evaluation due to overspending the budget.\nThe budget when the machine terminated was:\n({cpu: 9728648862\n| mem: -18267109})\nNegative numbers indicate the overspent budget; note that this only indicates the budget that was needed for the next step, not to run the program to completion. : []"

Protocol parameter

PV3 cost model is copied from sanchonet

{
    "collateralPercentage": 150,
    "committeeMaxTermLength": 200,
    "committeeMinSize": 0,
    "costModels": {
        "PlutusV1": [205665,812,1,1,1000,571,0,1,1000,24177,4,1,1000,32,117366,10475,4,23000,100,23000,100,23000,100,23000,100,23000,100,23000,100,100,100,23000,100,19537,32,175354,32,46417,4,221973,511,0,1,89141,32,497525,14068,4,2,196500,453240,220,0,1,1,1000,28662,4,2,245000,216773,62,1,1060367,12586,1,208512,421,1,187000,1000,52998,1,80436,32,43249,32,1000,32,80556,1,57667,4,1000,10,197145,156,1,197145,156,1,204924,473,1,208896,511,1,52467,32,64832,32,65493,32,22558,32,16563,32,76511,32,196500,453240,220,0,1,1,69522,11687,0,1,60091,32,196500,453240,220,0,1,1,196500,453240,220,0,1,1,806990,30482,4,1927926,82523,4,265318,0,4,0,85931,32,205665,812,1,1,41182,32,212342,32,31220,32,32696,32,43357,32,32247,32,38314,32,57996947,18975,10
        ],
        "PlutusV2": [205665,812,1,1,1000,571,0,1,1000,24177,4,1,1000,32,117366,10475,4,23000,100,23000,100,23000,100,23000,100,23000,100,23000,100,100,100,23000,100,19537,32,175354,32,46417,4,221973,511,0,1,89141,32,497525,14068,4,2,196500,453240,220,0,1,1,1000,28662,4,2,245000,216773,62,1,1060367,12586,1,208512,421,1,187000,1000,52998,1,80436,32,43249,32,1000,32,80556,1,57667,4,1000,10,197145,156,1,197145,156,1,204924,473,1,208896,511,1,52467,32,64832,32,65493,32,22558,32,16563,32,76511,32,196500,453240,220,0,1,1,69522,11687,0,1,60091,32,196500,453240,220,0,1,1,196500,453240,220,0,1,1,1159724,392670,0,2,806990,30482,4,1927926,82523,4,265318,0,4,0,85931,32,205665,812,1,1,41182,32,212342,32,31220,32,32696,32,43357,32,32247,32,38314,32,35892428,10,9462713,1021,10,38887044,32947,10
        ],
        "PlutusV3": [205665,812,1,1,1000,571,0,1,1000,24177,4,1,1000,32,117366,10475,4,23000,100,23000,100,23000,100,23000,100,23000,100,23000,100,100,100,23000,100,19537,32,175354,32,46417,4,221973,511,0,1,89141,32,497525,14068,4,2,196500,453240,220,0,1,1,1000,28662,4,2,245000,216773,62,1,1060367,12586,1,208512,421,1,187000,1000,52998,1,80436,32,43249,32,1000,32,80556,1,57667,4,1000,10,197145,156,1,197145,156,1,204924,473,1,208896,511,1,52467,32,64832,32,65493,32,22558,32,16563,32,76511,32,196500,453240,220,0,1,1,69522,11687,0,1,60091,32,196500,453240,220,0,1,1,196500,453240,220,0,1,1,1159724,392670,0,2,806990,30482,4,1927926,82523,4,265318,0,4,0,85931,32,205665,812,1,1,41182,32,212342,32,31220,32,32696,32,43357,32,32247,32,38314,32,35190005,10,57996947,18975,10,39121781,32260,10,23000,100,23000,100,832808,18,3209094,6,331451,1,65990684,23097,18,114242,18,94393407,87060,18,16420089,18,2145798,36,3795345,12,889023,1,204237282,23271,36,129165,36,189977790,85902,36,33012864,36,388443360,1,401885761,72,2331379,72,1927926,82523,4,117366,10475,4,1292075,24469,74,0,1,936157,49601,237,0,1
        ]
    },
    "dRepActivity": 100,
    "dRepDeposit": 1000000,
    "dRepVotingThresholds": {
        "committeeNoConfidence": 0,
        "committeeNormal": 0.5,
        "hardForkInitiation": 0.5,
        "motionNoConfidence": 0,
        "ppEconomicGroup": 0.5,
        "ppGovGroup": 0.5,
        "ppNetworkGroup": 0.5,
        "ppTechnicalGroup": 0.5,
        "treasuryWithdrawal": 0.5,
        "updateToConstitution": 0
    },
    "executionUnitPrices": {
        "priceMemory": 5.77e-2,
        "priceSteps": 7.21e-5
    },
    "govActionDeposit": 1000000,
    "govActionLifetime": 1,
    "maxBlockBodySize": 65536,
    "maxBlockExecutionUnits": {
        "memory": 62000000,
        "steps": 20000000000
    },
    "maxBlockHeaderSize": 1100,
    "maxCollateralInputs": 3,
    "maxTxExecutionUnits": {
        "memory": 140000000,
        "steps": 10000000000
    },
    "maxTxSize": 16384,
    "maxValueSize": 5000,
    "minFeeRefScriptCostPerByte": 0,
    "minPoolCost": 0,
    "monetaryExpansion": 0.1,
    "poolPledgeInfluence": 0,
    "poolRetireMaxEpoch": 18,
    "poolVotingThresholds": {
        "committeeNoConfidence": 0.5,
        "committeeNormal": 0.5,
        "hardForkInitiation": 0.5,
        "motionNoConfidence": 0.5,
        "ppSecurityGroup": 0.5
    },
    "protocolVersion": {
        "major": 10,
        "minor": 0
    },
    "stakeAddressDeposit": 0,
    "stakePoolDeposit": 0,
    "stakePoolTargetNum": 100,
    "treasuryCut": 0.1,
    "txFeeFixed": 0,
    "txFeePerByte": 1,
    "utxoCostPerByte": 4310
}
mesudip commented 1 month ago

This ticket is a blocker on cardano-marketplace v2 vs v3 performance comparison.

For V2 vs V3, comparision, transactions are submitted to chain and reports are collected. We already have a report created on sanchonet, but the transactions are not going through in the latest version of private cluster.

mesudip commented 1 month ago

Current Progress:

There was a bug in contract where script was only partially evaluated due to extra parameters. This issue has been resolved and we are re-compiling the reports.

Note : PlutusV3 evaluation now supports checking the return type and reporting error if the returned type is not BuiltinUnit

spannercode commented 2 weeks ago

This is fixed already.