Description
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, theaction-file
and thecompiled plutus-script
file. - Adding the
--calculate-plutus-script-cost
parameter option into thebuild-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.