Skip to content

[FR] - Command to calculate the correct Plutus Script Costs offline #945

Closed
1 of 1 issue completed
IntersectMBO/cardano-api
#771
@gitmachtl

Description

@gitmachtl

I came across a problem while adding new features in the scripts to automatically use the guardrail scripts for submitting a protocol-parameter or treasury-withdrawal action on conway (v10). The problem is, that there is no way to calculate the correct execution units costs for a given plutus script (file) without a synced live node running.
Because the only implementation we currently have is within the transaction build command.

By using the transaction build command and the option --calculate-plutus-script-cost FILE we get an output like:

[
    {
        "executionUnits": {
            "memory": 610371,
            "steps": 129445331
        },
        "lovelaceCost": 44552,
        "scriptHash": "fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64"
    }
]

Which is super nice, and the values for the execution units can than later be used for a transaction building via transaction build-raw for example. BUT, this does not work in offline mode.

When it comes to governance, we need a feature in cardano-cli to calculate the correct execution units for a governance action that involves the guardrails script.

Two possible options to integrate that?

  • A new command that takes the protocol-parameters file, the action-file and the compiled plutus-script file.
  • Adding the --calculate-plutus-script-cost parameter option into the build-estimate command.

So we can do such calculations also offline without a connected online node, which would also come in handy of doing automated tests or optimizations via iterations.

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions