Skip to content
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] - transaction build attempts to create UTxO with 0 lovelace as change #3041

Closed
catch-21 opened this issue Aug 6, 2021 · 1 comment · Fixed by #3188
Closed

[BUG] - transaction build attempts to create UTxO with 0 lovelace as change #3041

catch-21 opened this issue Aug 6, 2021 · 1 comment · Fixed by #3188
Labels
alonzo-purple Relates to the Alonzo Purple Testnet API&CLI-Backlog bug Something isn't working comp: cardano-cli era: alonzo type: bug Something is not working user type: internal Created by an IOG employee

Comments

@catch-21
Copy link
Contributor

catch-21 commented Aug 6, 2021

Internal/External
Internal if an IOHK staff member.

Area
Other Any other topic (Delegation, Ranking, ...).

Summary
When I use transaction build and balance the outputs so that there is no change then the cli still attempts to create a UTxO which fails due to minimum constraint.

Steps to reproduce
Steps to reproduce the behavior:

  1. Have some ada
0c58e04f797e1fbcc4c26730af010d24d74a1df11631363c279972654da3305d     1        10000000 lovelace + TxOutDatumHashNone
  1. Use transaction build to send 10 ada minus the exact fee of 167217 lovelace
$ CARDANO_NODE_SOCKET_PATH=node/node.sock cardano-cli transaction build --tx-in 0c58e04f797e1fbcc4c26730af010d24d74a1df11631363c279972654da3305d#1 --tx-out "$(<AlwaysSucceeds.addr)+9832783" --tx-out-datum-hash 9e1199a988ba72ffd6e9c269cadb3b53b5f360ff99f112d9b2ee30c4d74ad88b --change-address $(<acct.addr) --out-file txbody --alonzo-era --testnet-magic $(<node/db/protocolMagicId)
  1. Observe error
Command failed: transaction build  Error: The transaction does balance in its use of ada, however the net balance does not meet the minimum UTxO threshold. 
Balance: Lovelace 0
Offending output (change output): addr_test1vpl95kfrrvx6uxd54a9vwjw7nrv88g0euq70jn5jy8dlysshlxfrw + 
Minimum UTxO threshold: Lovelace 999978
The usual solution is to provide more inputs, or inputs with more ada to meet the minimum UTxO threshold

Expected behavior
When there's no remainder it should skip trying to create UTxO for change of 0 lovelace.

System info (please complete the following information):

  • OS Name: Mint
  • OS Version 20.2 (Uma)
  • Node version: cardano-node 1.28.0 - linux-x86_64 - ghc-8.10 git rev 708de68
  • CLI version: cardano-cli 1.28.0 - linux-x86_64 - ghc-8.10 git rev 708de68
@catch-21 catch-21 added bug Something isn't working alonzo-purple Relates to the Alonzo Purple Testnet labels Aug 6, 2021
@Titan-C
Copy link

Titan-C commented Aug 15, 2021

Either drop the zero change output or stop requiring --change-address to be mandatory once the transaction builder realizes there is no change left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alonzo-purple Relates to the Alonzo Purple Testnet API&CLI-Backlog bug Something isn't working comp: cardano-cli era: alonzo type: bug Something is not working user type: internal Created by an IOG employee
Projects
None yet
4 participants