gitcoinco / web

Grow Open Source
https://gitcoin.co
Other
1.78k stars 771 forks source link

QR code checkout runs into errors / successful txs don't show in the interface #7585

Closed spm32 closed 4 years ago

spm32 commented 4 years ago

https://gitcoin.co/benhylau donated to two grants on Android using Coinomi but the tx won't go through even though WalletConnect is connected, zkSync just keeps loading and gives the error below.

The two grants funded were:

Relevant tx: https://etherscan.io/tx/0x6a8cc2b9ca80546b41050fc9172553a718b60c818d99230ecea7dec63613793a

He ran into the following error: https://gyazo.com/71257114cffb422070551c64d1ac60a8

benhylau commented 4 years ago

Just to clarify, that error above led me to not even able to make a Tx at all. Other times it is a different error, something like web3 unknown, etc. As long as I first check out my grants, then try to click Standard and WalletConnect from Coinomi, it'll hang for a long time even after I approve on my phone, then give me one of these errors. I think zkSync just hangs. So I was never able to make a Tx via this path.

At some point I decided to connect my wallet first, then go to cart, and then one time Standard succeeded. That's how my Tx was made. However, it just hung afterwards and the on-chain contributions never made their way to the Gitcoin side even after some hours. I was hoping maybe there is a backend scanner that will periodically check the blockchain to "pick up" Tx's as they may take hours on a busy network.

After speaking with @ceresstation he thinks a POST to DB never happened, and I think that's right as the UI never indicated that it did. The web app never updated after I made the Tx.

Expected behaviour: even if I turn off my computer then make the Tx, the Gitcoin backend should still pick up the Tx, and should not rely on the client to close contribution loops. I would expect a pending -> completed pattern where the latter state change is independent of my web client.

mds1 commented 4 years ago

Thanks for all the details @benhylau! I'll have to look into this one.

For this grants round, we'll manually add your contributions to DB to ensure the matching for them counts

benhylau commented 4 years ago

I don't think the manual ingestion worked. Doesn't show on the profile UI https://gitcoin.co/benhylau

owocki commented 4 years ago

hey @mds1 i still get this exception when trying to ingest them

WARNINGS:
?: (debug_toolbar.W001) debug_toolbar.middleware.DebugToolbarMiddleware is missing from MIDDLEWARE.
    HINT: Add debug_toolbar.middleware.DebugToolbarMiddleware to MIDDLEWARE.
marketing.UpcomingDate.last_modified: (fields.W161) Fixed default value provided.
    HINT: It seems you set a fixed date / time / datetime value as default for this field. This may not be what you want. If you want to have the current date as default, use `django.utils.timezone.now`
Traceback (most recent call last):
  File "./manage.py", line 59, in <module>
    execute_from_command_line(sys.argv)
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/ubuntu/gitcoin/coin/app/grants/management/commands/ingest_grant_txns.py", line 240, in handle
    r.raise_for_status()
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.zksync.io/api/v0.1/account//history/older_than
Sentry is attempting to send 0 pending error messages

wiuth this input


source: https://github.com/gitcoinco/web/issues/7585
handle = 'benhylau'
txid = '0x6a8cc2b9ca80546b41050fc9172553a718b60c818d99230ecea7dec63613793a'
token: 'ETH'
to_address: '0x7d655c57f71464b6f83811c55d84009cd9f5221c' # BulkCheckout
from_address: '0x53aE563fCB501221FC11EFDD05B96Ce7e1c350C0'
do_write: True
created_on: datetime.datetime(2020, 10, 1, 17, 43, tzinfo=pytz.UTC)
gitcoin_zksync_addr = '' # only for zkSync cases
mds1 commented 4 years ago

@owocki Replace the to_address with the checksum address! 0x7d655c57f71464B6f83811C55D84009Cd9f5221C

owocki commented 4 years ago

it worked!

ok backddating that contribution + re-running the clr calcs befoe payout :)

benhylau commented 4 years ago

Confirming that both Tx's show on my personal timeline:

Screen Shot 2020-10-09 at 12 43 05 AM

Thanks for being on top of this :D

mds1 commented 4 years ago

Awesome, thanks for your patience @benhylau!