-
Notifications
You must be signed in to change notification settings - Fork 720
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
[BUG] - Underestimation of Mem and Cpu units with transaction build #5386
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days. |
Any work on this in the new version of the cli? |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days. |
Its more than a year now and this bug still exists. It was brought up IntersectMBO/cardano-api#302 but it was closed. What else is required to get some attention on this? |
@logicalmechanism thanks for the bump. Do you confirm that the bug still exists in the latest version of cardano-cli and cardano-api? There was a related fix in the meantime: IntersectMBO/cardano-api#622 - I don't know if that fixed this. |
Ah good catch I was using the cardano node 9.1.1. Just confirmed that it exists in all cardano-node tagged releases before the cardano-api update to 9.3.0.0. So cardano node tag versions 9.2.0+ should work as far as I can tell from my testing but all older versions have the bug. Pretty sure this commit fixed it. If I run into it again, I'll make a new issue but I will close this for now assuming it is solved in cardano-api 9.3.0.0. Thanks @carbolymer |
Area
Plutus Related to Plutus Scripts (Alonzo).
cardano-cli Relaated to the Cardano-CLI
Summary
Creating a smart contract transaction with
cardano-cli transaction build
results in an inaccurate mem and cpu estimation when using a fee-paying input UTxO that contains a token that must be returned to the change address using the--change-address
. The build function builds the transaction but fails at submission with the overspending budget error.In the example smart contract I am using, when the fee paying input is:
The tx.draft assumes the cost is
{5: [[0, 0, 121([]), [1649252, 510827641]]]}
where the--calculate-plutus-script-cost
parameter returnsThe estimation using
calculate-plutus-script-cost
is correct but the estimation withtransaction build
is incorrect.By removing the tokens from the input the
transaction build
calculates the correct fee and mem/cpu units.This input lets
build
and--calculate-plutus-script-cost
to return the same mem and cpu units.This should be reproducible with any contract.
Here is an example of the bash I used to reproduce this:
Expected behavior
The
cardano-cli
should be able to calculate the mem and cpu correctly like it is doing with--calculate-plutus-script-cost
with any fee-paying input that contains or does not contain tokens. Clearly, it can calculate it because--calculate-plutus-script-cost
is correct but that information is not being put into the out-file resulting in the overspending of the budget error.System info:
Ubuntu 22
cardano-node 8.1.1 - linux-x86_64 - ghc-8.10
git rev 6f79e5c
cardano-cli 8.1.1 - linux-x86_64 - ghc-8.10
git rev 6f79e5c
The text was updated successfully, but these errors were encountered: