avalanchego icon indicating copy to clipboard operation
avalanchego copied to clipboard

Packer has insufficient length for input

Open ekherit opened this issue 5 years ago • 3 comments

Describe the bug Unable to send avas from address 'X-BZUz5nMxahio79tzdxnYKsV3uS8o1gXDn'

curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.send", "params" :{ "assetID" :"AVA", "amount" :10000, "to" :"X-MrPGQFtvnW8UL8FDSgHueMwufQqL6RiJy", "username":"packer", "password":"packer12345!@#$%" } }' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X {"jsonrpc":"2.0","error":{"code":-32000,"message":"problem creating transaction: packer has insufficient length for input","data":null},"id":1}

To Reproduce The address 'X-BZUz5nMxahio79tzdxnYKsV3uS8o1gXDn' has more then 20k UTXO. Most of UTXO is 1 nAVA. I could successfully send 1000 nAVAs, but for 5000 the error arises.

Expected behavior Expect transaction id.

Additional context Gecko 0.5.7

By submitting this issue I agree to the Terms and Conditions of the Developer Accelerator Program.

ekherit avatar Jul 06 '20 09:07 ekherit

The transactions have a maximum size, and each additional UTXO being spent gets referenced in the transaction, so as you're spending more UTXOs in a single transaction, the transaction will get larger. This isn't really a bug since there needs to be a maximum transaction size, so if you want to recombine the UTXOs you'll have to do it through a few transactions.

aaronbuchwald avatar Jul 06 '20 14:07 aaronbuchwald

@aaronbuchwald Agreed, though let's give a more clear error message here

danlaine avatar Jul 06 '20 14:07 danlaine

@aaronbuchwald @danlaine
Thanks, I expected this. It would be nice to understand exactly how many UTXO can be in single transaction to minimize total time or fees. And I could not find in the API how specify list of input utxo I wanted in the transaction.

ekherit avatar Jul 07 '20 05:07 ekherit