-
Notifications
You must be signed in to change notification settings - Fork 71
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
Differing asset balances on various nodes #271
Comments
This is what I see on my mac running syscoind: Jags-MacBook-Pro:src jsidhu$ ./syscoin-cli assetallocationinfo 777845ced7b6022b talavin true |
So if you had tried to collect interest and then send total amount from an alias to another then I think what happened was because during interest calculations a rounding error was introduced because of overflow (I've since fixed this in the 175k 3.1 fork) and then since nodes then have differing balances when you try to send the total some nodes think the balance is insufficient so it just does a NO-OP and doesn't update anything while others will go through and add to receiver and remove from sender balance. On my unit test I do extensive tests as can be seen here https://github.com/syscoin/syscoin/blob/dev-3.x-prep-3.2.0/src/test/syscoin_asset_tests.cpp#L531 and the 3 nodes all match up in balances exactly. So what I'd like to do is step through each transaction with you and get what the balance updates to each step to see where they start to differ. |
Explanation and your values look plausible. Right now it is getting late for me. I am usually available from 16 - 22 GMT. We can step through tomorrow if that fits for you or any other day this week if that is better, |
Can you try https://github.com/syscoin/syscoin/tree/dev-3.x you should see consistent numbers after reindexing I get this with assetinfo Jags-MacBook-Pro:src jsidhu$ ./syscoin-cli assetinfo 777845ced7b6022b true |
Have run the dev-3.x version on a Linux vm. I currently dont have the requirements for a windows build. Creating a transaction from talavin also works again. |
ok I would wait though to sent any of these anywhere... so mac/linux look like they match windows dont match still so i added a buffer.. i've released this 3.1.1 to fix transfer of assets when the balances are off by tiny amounts (1000 sats or less). Once cps exchange is updates you can send/recv them safely without worrying. |
Pls update to 3.1.2 and resync, once CPS is on that and resyncs your balances and transactions with them will also be fine. Pls open issue again if something else comes up. Thanks for the investigation! |
Summary
After executing a bunch of transactions via qt wallet on windows to transfer CPS, the balance on my aliases differs across nodes. Most transactions were executed with a witness (See transaction list at the end).
Right now it is impossible for me to see which transactions succeeded and on which alias some of my CPS coins are right now. For one alias I am even unable to create further asset transactions via qt console.
Pictures with balances of some aliases (Taken at block 169930 +- 10)
shows balances as seen on qt console on my windows machine. This does not change after reindex or deleting whole chain with downloading from scratch.
shows balances seen on 7 of my masternodes.
shows balances seen on 2 of my masternodes.
shows balances seen on 1 of my masternodes.
Masternodes are on 3.1.0 and running for months with same chain data. Updated and restarted when required. Just the 1 node in the last picture got its blockchain wiped after all this happened to see a freshly downloaded state.
Balance for talavin should be 159440.64207604
Balance for evelon should be 0.00000348 as tx 13 failed according to coinpayments
Balance for kuruna should be 60307.21105612 when tx 13 failed
Transactions that caused this
Problem started for me with a failed transaction (Number 13 below) to coinpayments. This transaction never arrived at coinpayments.
The following transactions (14 to 23) went fine and arrived. Difference is that I always left a fraction of coins on each alias.
More problems started to show after transaction 23 when I tried to sent from talavin. This always resulted in this error regardless of amount to send:
SYSCOIN_ALIAS_CONSENSUS_ERROR: ERRCODE: 5003 - Witness signature not found (code 16) (code -1)
I tried sending some coins to talavin (tx 24) to see if it changes anything. Coins arrived but error stayed the same.
After tx 24 I contacted coinpayments support regarding failed tx 13 and according to them it failed on the blockchain.
As the balance for evelon shows 0.00000000 (Windows qt wallet) on my client, I tried to recover them by sending a transaction from a previous point of the chain.
Tx 25 was sent from a too early point (client at block 164400) and should obviously fail.
Tx was then sent again (client at block 164430) which is visible as successful on some nodes but not all.
Transactions
Most commands were executed with a witness because the first transactions for interest did not work without one.
Command usage differs from their help text because they did not work exactly as described (Already reported in issue #259). First alias acted as witness and second got interest credited.
Executed commands on qt 3.0.6.2:
assetallocationcollectinterest 777845ced7b6022b talavin ALIAS (for 10 aliases)
assetallocationcollectinterest 777845ced7b6022b evelon talavin (once)
How assetallocationsend worked was that talavin acted as the witness and coins were transferred from INPUT
Executed commands on qt 3.0.6.2:
assetallocationsend 777845ced7b6022b talavin '[{"aliasto":"coinpayments","amount":AMOUNT}]' MEMO INPUT
This time commands were executed without witness as I noticed that it was not required in case of assetallocationsend
Executed commands on qt 3.1.0:
assetallocationsend 777845ced7b6022b evelon '[{"ownerto":OUTPUT,"amount":AMOUNT}]' "" ""
The text was updated successfully, but these errors were encountered: