Hello - I am on cardano-cli 9.2.1 and am experiencing something strange. I am trying to submit a cip68 transaction, and am using the following command to get the TX fee:
cardano-cli transaction build-raw --fee 265513 --invalid-before 130784180 --invalid-hereafter 131043380 --tx-in d45d25c1b60e9032b64eb5332a1dc1faffc84e426ae097b14e95edd97dda9dd1#0 --tx-out “addr1vxym96cddjlt68kpvxffwhvcr2zfpf4cmfaelea0czxs2vclhzx8h+1193870+1 2df27e01576ca7f0db2f4267c82021f584a31ee740b861b970f08ccf.000643b041737365743133” --tx-out-datum-embed-file /home/admin/cardano-projects/sales/cip68-test-2/db/policy/transaction-metadata/datum-Asset13.json --tx-out “addr1q87gw8wkg0c5q3ldelf5s2w8gnv0nm025qssfpkkvenq3whav7terpg8pscu62tpk25xfd3jxeefyufccppahrj23mssknmfyx+1168010+1 2df27e01576ca7f0db2f4267c82021f584a31ee740b861b970f08ccf.000de14041737365743133” --tx-out “addr1q9sre2jl229cavt2n0n34km0cq2ch34u83j6ms74zu5rjryj5dysang6xcyp62r6dwdm7pnv3nsdwwn7jzzhr03ur6tqsef289+10000000000” --tx-out “addr1q8g2c4925w3f5n5g8dectc57n9z08259k0727wuy82wgshvj5dysang6xcyp62r6dwdm7pnv3nsdwwn7jzzhr03ur6tqye45dh+10000000000” --mint “1 2df27e01576ca7f0db2f4267c82021f584a31ee740b861b970f08ccf.000de14041737365743133+1 2df27e01576ca7f0db2f4267c82021f584a31ee740b861b970f08ccf.000643b041737365743133” --minting-script-file “/home/admin/cardano-projects/sales/cip68-test-2/db/policy/keys/policy.script” --out-file “/home/admin/cardano-projects/sales/cip68-test-2/scripts/cardano-cli/tmp/fce72111-d5cf-4521-b4f3-7a870e0fbd70-tx.draft” && cardano-cli transaction calculate-min-fee --tx-body-file “/home/admin/cardano-projects/sales/cip68-test-2/scripts/cardano-cli/tmp/fce72111-d5cf-4521-b4f3-7a870e0fbd70-tx.draft” --witness-count 2 --protocol-params-file “/home/admin/cardano-projects/sales/cip68-test-2/scripts/cardano-cli/tmp/fce72111-d5cf-4521-b4f3-7a870e0fbd70-protocol.json” | cut -d " " -f1
The fee returned is: 265513
However, when I submit the transaction itself, I receive an error that the fee isn’t enough:
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError (UtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (FeeTooSmallUTxO (Coin 266701) (Coin 265513))))
Any ideas what’s going on?
Likely the command you used to precalculate that fee didn’t have values high enough to cover all possible values: particularly the inputs you are actually using in the failed transaction.
We’re paying by the number of bytes, and your calculated & required fees from the error message are within several hundred lovelace: suggesting you’re some bytes short.
See this discussion here which addresses this problem for a simpler transaction:
opened 07:39AM - 08 Jul 24 UTC
closed 02:53PM - 08 Jul 24 UTC
**External** - *Other*
**Summary**
`cardano-cli transaction calculate-min-fe… e` for version `8.24.0.0` calculates fees too low to submit the signed Tx with that fee to a `8.12.2` node and/or to the chain itself.
**Steps to reproduce**
1. Prepare & sign a transaction with the latest release version of `cardano-cli` at this time.
2. Observe that it is several thousand lovelace lower than customary values for version `8.x` prepared & submitted successfully.
3. See that Tx is rejected with the usual error `AlonzoInBabbageUtxoPredFailure (FeeTooSmallUTxO ...)`
4. (optional) Add several thousand lovelace + a little margin for error & see the Tx's get accepted OK.
**Expected behavior**
A returned `calculate-min-fee` value allowing a successful Tx submission.
**System info (please complete the following information):**
- OS Name: Ubuntu 22.04
- Observed in latest GitHub binary releases:
- Node version: 8.12.2
- CLI version: 8.24.0.0
**Additional context**
Submitted on Cardano Forum as below ([Does `calculate-min-fee` give fees too low for interim node?](https://forum.cardano.org/t/does-calculate-min-fee-give-fees-too-low-for-interim-node/133845)) with lightweight confirmation from 3 SPO's so far, and on Discord requesting an issue be filed (cc @disassembler), as reported & observed in this epoch 495:
---
Our pool recently took the node upgrade to `8.12.2` which we know removes the Conway genesis & many relevant parameters for the Conway era from the configuration, in anticipation of adding them back in `9.x`.
In our only recent use of `cardano-cli` since the upgrade (actual CLI version = `8.24.0.0`), `cardano-cli transaction calculate-min-fee` has been returning astonishingly lower values: thousands of lovelace lower than needed to accept Tx's on the chain. (We've gotten through this today by averaging fees according to what they were before the upgrade & adding a margin.)
I immediately double-checked that the `protocol.json` file passed as a parameter was the correct one downloaded for this epoch (**edit**: 495).
I did see that some arguments have been dropped from `calculate-min-fee` — including `--tx-in-count` and `--tx-out-count`, which we had always used before — although the results are the same whether or not these deprecated arguments are used.
We've had this problem today [**edit**: UTC 2024-07-06 16:00] with 2 types of Tx's: a transaction that combines some UTxO's at the same address into a single UTxO while withdrawing stake rewards, and a pool re-registration: both calculating fees too low by thousands of lovelace.
Here's the command sequence for the first example, giving us (consistently) the unusually & unusably low estimated fee (of 174653 lovelace compared to at least 180K even for 3 inputs _without_ the rewards withdrawal):
```
cardano-cli transaction build-raw \
--tx-in UTxO1 \
--tx-in UTxO2 \
--tx-in UTxO3 \
--withdrawal $(cat low/stake.addr)+0 \
--tx-out $(cat low/payment.addr)+0 \
--fee 0 \
--out-file balance.test
cardano-cli transaction calculate-min-fee \
--tx-body-file balance.test \
--witness-count 2 \
--protocol-params-file protocol.json
174653 # output (generally our fees in the 180K to 183K range)
```
I've been following developer & SPO threads through this release and the node lead's general advice was that "tooling could be affected on 8.12.x"... but by "tooling" I assumed things like pool installation scripts & not the CLI itself. I know if the fee calculations had changed then it would temporarily break things like the SPO scripts: but shouldn't the raw CLI work the way it always has? ...
---
I remarked when [reporting on IOG SPO Discord](https://discord.com/channels/826816523368005654/1229425972105838642/1259546786234634290):
> Something about the changed fee costing seems to have made advance fee calculations inaccurate (too low by several thousand lovelace) for ordinary transactions
and wonder if shunting out the Conway parameters has not led to some terms in the fee calculation equation being zeroed out.
1 Like
Alternatively, since you seem to calculate on pretty exactly the same transaction that you are also submitting: Is the witness count correct? Are you signing with exactly two keys?
Thanks for the suggestion, but yes, only two witnesses as far as I know - the policy and wallet keys.
Yes, thank you. I did see that earlier and tried it but doesn’t seem to be the issue.
1 Like