Open Darkneew opened 2 years ago
Do you still have that account? Can you reproduce? 🤔 Unfortunately I can't. How much time elapsed between both transactions?
Hello, I had this issue with the account #513. I can also reproduce the bug as seen here. The screenshot shows the integrality of commands I ran.
I am using google chrome if that changes anything. Steps to reproduce :
:)
After some testing, I found out that asking the balance in transaction mode simply make convex forget 2000000 coins. The issue is completely reproducible and works on any account independant of the age of the account of or previous code run.
I guess when running balance in transaction mode, it checks the balance whilst removing coins for juice, which afterwards return to the account.
Also, this issue would give a lot of sense to another issue I found out recently : https://github.com/Convex-Dev/convex/issues/390
In this other issue, I can see when querying my balance that I have enough coins to make a transaction, but when doing the actual transaction, I get an insufficient fund error
Indeed I think this is because remaining transaction juice is reimbursed. @mikera Can you confirm?
Yes currently transaction juice is subtracted at start, and reimbursed at end. I'd like to change this so that this doesn't happen (since it is confusing) but it's a bit tricky because we need to stop people spending more juice than they have....
Does the substracted juice have an upper limit? If so, you can instead simply substract this amount from the balance, and display a "net balance"
I made a brand new account using the sandbox built in system to create an account, and here were my two first commands using the account, in transaction mode : We can see that either I gained coins by checking my balance (feels unlikely), either the first displayed balance wasn't my true balance.