GoodDollar / GoodDAPP

GoodDollar.org Wallet is the simplest access point to Claim your daily G$. It Is based on web3 and React native web.
good-dapp.vercel.app
MIT License
108 stars 57 forks source link

[BUG] Claim request failed #3683

Closed vldkh closed 2 years ago

vldkh commented 2 years ago

@Hadar Looks like it happens because of this error message:

Returned error: Transaction nonce is too low. Try incrementing the nonce.

image.png

Also, as you can see the next attempt is successful.

Dashboard - https://analytics.amplitude.com/gooddollar/chart/l9kegg6/edit/d06uajb?source=workspace User Look-Up - https://analytics.amplitude.com/gooddollar/project/288710/search/amplitude_id%3D190825262743

sirpy commented 2 years ago

@vldkh these kind of issues can happen once in a while. Do we have something systemic? ie same user experiencing it many times, or multiple users constantly experiencing it

vldkh commented 2 years ago

@sirpy This issue happens almost every day at 12 pm. And happens to ~300 users. Types of Errors:

But at least every second and third attempt is successful

image.png

sirpy commented 2 years ago

it is expected that some blockchain calls will fail. the first spike looks unusually high.

patpedrosa commented 2 years ago

Clear pattern there. Please fix.

sirpy commented 2 years ago

@johnsmith-gooddollar @patpedrosa the reasons for failure are mostly of 2 types

  1. user is out of Fuse tokens for gas, and passed our faucet limit
  2. blockchain issue

To solve we can do the following

  1. in case user can't use our faucet, buy for him fuse tokens via fuseswap (convert 2G$s), we need to show this as a TX on his feed. or ask him in a modal if he wants to do that
  2. in case of other errors we can retry 1-2 more times
johnsmith-gooddollar commented 2 years ago

@sirpy could we join buying tokens for g$ and claim in a single operation ? And display claim amount - 2g$ in the tx? Additionaly we could show "2G$ fee" and info sign "why this happened ?" linking to some faq ?

P.S also we could check for out of gas futons entitlement calculation and adjust claim value displaying on claim page. And also display the same 2G$ fee + additional info

sirpy commented 2 years ago

@johnsmith-gooddollar things to do:

  1. gatherStats in claim.js - shows an error dialog if it fails. it should fail silently. maybe also retry if it fails?
  2. retry claim operation if NOT "not a citizen or passed dialy tx limit" error
  3. force nonce when doing claim tx
sirpy commented 2 years ago

@patpedrosa do you want to do anything regarding the out of gas issue?

sirpy commented 2 years ago

@johnsmith-gooddollar This happened to me and I got the "not a citizen" error, all of these issues seem to be due to the web3 framework losing connection to the RPC endpoint. so I dont think we need fix 3, and 2 should change to: on claim perform some read call to the blockchain (like getBlockNumber()) to refresh the connection then perform the claim operation and retry once on ANY error

sirpy commented 2 years ago

@johnsmith-gooddollar d3262380b200422671efb942188ee4f651e99a50

vldkhh commented 2 years ago

@sirpy Now it happens to ~145 users each day. I guess it is normal behavior. Any thoughts? image.png