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

Error displaying balance upon account creation #231

Open
Darkneew opened this issue Aug 24, 2022 · 6 comments
Open

Error displaying balance upon account creation #231

Darkneew opened this issue Aug 24, 2022 · 6 comments

Comments

@Darkneew
Copy link
Contributor

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 :
Capture d’écran 2022-08-25 002507
We can see that either I gained coins by checking my balance (feels unlikely), either the first displayed balance wasn't my true balance.

@helins
Copy link
Member

helins commented Aug 25, 2022

Do you still have that account? Can you reproduce? 🤔
Unfortunately I can't. How much time elapsed between both transactions?

Screenshot 2022-08-25 at 11 43 12

@Darkneew
Copy link
Contributor Author

Hello,
I had this issue with the account #513.
Capture d’écran 2022-08-25 195018
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 :

  1. Open a window with no previous cookie or data (I simply go into guest mode)
  2. Open convex's sandbox
  3. Create a new account with the button that appear where you usually type code
  4. Run balance in transaction mode
  5. Run balance in query mode

:)

@Darkneew
Copy link
Contributor Author

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 :
Convex-Dev/convex#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

@helins
Copy link
Member

helins commented Aug 28, 2022

Indeed I think this is because remaining transaction juice is reimbursed.
@mikera Can you confirm?

@mikera
Copy link
Member

mikera commented Aug 30, 2022

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....

@Darkneew
Copy link
Contributor Author

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants