stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 674 forks source link

Test STX are not transferred #1490

Closed friedger closed 4 years ago

friedger commented 4 years ago

Describe the bug After posting a stx transfer transaction the balances are not updated and the logs do not show any errors or warning. How to know what happened?

Steps To Reproduce Send a transaction with blockstack-cli (like https://docs.blockstack.org/core/smart/cli-wallet-quickstart.html), see the transaction id, see the balances are unchanged,

Expected behavior Balances are changed.

Environment (please complete the following information):

Additional context It is unclear what is happening, not very technical report, sorry.

diwakergupta commented 4 years ago

Can you include the transaction id, relevant STX addresses etc? Thanks!

friedger commented 4 years ago

The sender address is ST2P4S7Q4PHGQE9VGG6X8Z54MQQMN1E5047ZHVAF7

blockstack-cli send_tokens ST1WZ69T99RHQMQX3D91ZH2R37GV5NK8KDS5D5VDZ 1000 1 0 994d526b3b3409def4d3e481f9c4b3debaf9535cffed0769a7543601e1efa3c501 -t -T "http://127.0.0.1:20443/v2/transactions"
691a2735e0da3682a0383a7e64acea01cad02511ee25be2b57114918294b9e1a
kantai commented 4 years ago

The TXID 691a2735e0da3682a0383a7e64acea01cad02511ee25be2b57114918294b9e1a, does not appear to have propagated to the mempool -- and that sender address doesn't appear to have any STX:

$ curl -s 127.0.0.1:20443/v2/accounts/ST2P4S7Q4PHGQE9VGG6X8Z54MQQMN1E5047ZHVAF7?proof=0

{
  "balance": "0x00000000000000000000000000000000",
  "nonce": 0
}

This might be an issue with the error message either from core or blockstack-cli.

kantai commented 4 years ago

Yep -- this appears to be an issue in cli-blockstack's error handling. When trying to broadcast the message via CURL, I, appropriately, get an error:

$ ./cmd/index.js send_tokens ST1WZ69T99RHQMQX3D91ZH2R37GV5NK8KDS5D5VDZ 1000 1 0 994d526b3b3409def4d3e481f9c4b3debaf9535cffed0769a7543601e1efa3c501 -t -d -x -T "http://127.0.0.1:20443/v2/transactions" | xxd -r -p - | curl -X POST -H 'Content-Type: application/octet-stream' --data-binary "@-" 127.0.0.1:20443/v2/transactions | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   315    0   135  100   180    589    786 --:--:-- --:--:-- --:--:--  1375
{
  "txid": "691a2735e0da3682a0383a7e64acea01cad02511ee25be2b57114918294b9e1a",
  "error": "transaction rejected",
  "reason": "FeeTooLow(1, 180)"
}
friedger commented 4 years ago

I tried now

cargo run --bin blockstack-cli token-transfer  994d526b3b3409def4d3e481f9c4b3debaf9535cffed0769a7543601e1efa3c501 1000 2 ST1WZ69T99RHQMQX3D91ZH2R37GV5NK8KDS5D5VDZ  100 "My name is Pet3r" --testnet | xxd -r -p - | curl -X POST -H 'Content-Type: application/octet-stream' --data-binary "@-" 127.0.0.1:20443/v2/transactions 

The transactions was successful, but the nonce for account ST2P4S7Q4PHGQE9VGG6X8Z54MQQMN1E5047ZHVAF7 was not updated.

Tx ID a3be50ff8726b1f36e51b47b50ae50f5e0fe759f5b0a575c2ef087ac9dcfcf9c

friedger commented 4 years ago

Not sure whether some code was changed but with fees of 180+ uSTX I can reliably transfer tokens (using the blockstack-cli in stacks-blockchain) like this:

cargo run --bin blockstack-cli token-transfer 3af1c76f27c861d7a0f3e85543c0191dff8d8b8de6d27660aadb18b7f20400a901 1000 1 ST270EMD96BPJE79FPP8V457Y20W259HKR33ZMKWW  100 "My name is Pet3r" --testnet | xxd -r -p - | curl -X POST -H 'Content-Type: application/octet-stream' --data-binary "@-" neon.blockstack.org:20443/v2/transactions 
blockstack-devops commented 5 days ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.