New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plutus script cost calculation cli command #3590
Labels
enhancement
New feature or request
Comments
iohk-bors bot
added a commit
that referenced
this issue
Feb 17, 2022
3587: Bump ledger and network dependencies r=denisshevchenko a=nc6 The changes here come from a few areas: - Refactoring of the ledger code to move the protocol concerns into their own package. - Some additional errors for Plutus scripts (not yet enabled). - Additional ledger events. - Remove ToJSON instances which have now migrated to the ledger codebase. - Change `TxIx` to be a `Word16`, which is its new bound in Shelley+ eras. This also incorporates `@bolt12's` changes from #3561. 3589: Update cli build command to calculate Plutus script cost r=Jimbo4350 a=Jimbo4350 Resolves: #3590 We introduce the following change: ``` cardano-cli transaction build ... (--out-file FILE | --calculate-plutus-script-cost FILE) ``` If you are only interested in the script cost, specify the `--calculate-plutus-script-cost` option. Example: ``` $CARDANO_CLI transaction build \ --alonzo-era \ --cardano-mode \ --testnet-magic "$TESTNET_MAGIC" \ --change-address "$utxoaddr" \ --tx-in "$plutusutxotxin" \ --tx-in-collateral "$txinCollateral" \ --tx-out "$dummyaddress+10000000" \ --tx-in-script-file "$plutusscriptinuse" \ --tx-in-datum-file "$datumfilepath" \ --protocol-params-file "$WORK/pparams.json" \ --tx-in-redeemer-file "$redeemerfilepath" \ --calculate-plutus-script-cost "$WORK/create-datum-output.scriptcost" > cat $WORK/create-datum-output.scriptcost [ { "executionUnits": { "memory": 1700, "steps": 476468 }, "lovelaceCost": 133, "scriptHash": "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656" } ] ``` Co-authored-by: Nicholas Clarke <nick@topos.org.uk> Co-authored-by: Armando Santos <armandoifsantos@gmail.com> Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
iohk-bors bot
added a commit
that referenced
this issue
Feb 17, 2022
3589: Update cli build command to calculate Plutus script cost r=Jimbo4350 a=Jimbo4350 Resolves: #3590 We introduce the following change: ``` cardano-cli transaction build ... (--out-file FILE | --calculate-plutus-script-cost FILE) ``` If you are only interested in the script cost, specify the `--calculate-plutus-script-cost` option. Example: ``` $CARDANO_CLI transaction build \ --alonzo-era \ --cardano-mode \ --testnet-magic "$TESTNET_MAGIC" \ --change-address "$utxoaddr" \ --tx-in "$plutusutxotxin" \ --tx-in-collateral "$txinCollateral" \ --tx-out "$dummyaddress+10000000" \ --tx-in-script-file "$plutusscriptinuse" \ --tx-in-datum-file "$datumfilepath" \ --protocol-params-file "$WORK/pparams.json" \ --tx-in-redeemer-file "$redeemerfilepath" \ --calculate-plutus-script-cost "$WORK/create-datum-output.scriptcost" > cat $WORK/create-datum-output.scriptcost [ { "executionUnits": { "memory": 1700, "steps": 476468 }, "lovelaceCost": 133, "scriptHash": "67f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656" } ] ``` 3593: Update MissingScript error in evaluateTransactionExecutionUnits r=Jimbo4350 a=Jimbo4350 Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be useful to have a cli command that takes a txbody, tx or Plutus script(s) and outputs the cost to execute the script in terms of Ada and execution units.
The text was updated successfully, but these errors were encountered: