OriginProtocol / OriginProtocol/origin-website

update_token_insight.py script failure

Open
#662 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
41
Forks
49
PR merge metrics
No merged PRs in 30d

Description

We seem to be hitting what I think are etherscan rate limiting when the update_token_insight.py script runs.

Seen in the logs:

2023-04-27T19:05:54.791682+00:00 app[scheduler.1237]: Error while fetching balance
2023-04-27T19:05:54.791698+00:00 app[scheduler.1237]: {'status': '0', 'message': 'NOTOK', 'result': 'Max rate limit reached'}
2023-04-27T19:05:54.840276+00:00 app[scheduler.1237]: Traceback (most recent call last):
2023-04-27T19:05:54.842113+00:00 app[scheduler.1237]: File "/app/logic/scripts/update_token_insight.py", line 483, in <module>
2023-04-27T19:05:54.842267+00:00 app[scheduler.1237]: fetch_reserved_wallet_balances()
2023-04-27T19:05:54.842271+00:00 app[scheduler.1237]: File "/app/logic/scripts/update_token_insight.py", line 453, in fetch_reserved_wallet_balances
2023-04-27T19:05:54.842340+00:00 app[scheduler.1237]: fetch_wallet_balance(token_stats.new_foundation_reserve_address)
2023-04-27T19:05:54.842342+00:00 app[scheduler.1237]: File "/app/logic/scripts/update_token_insight.py", line 389, in fetch_wallet_balance
2023-04-27T19:05:54.842406+00:00 app[scheduler.1237]: ogn_balance = fetch_wallet_token_balance(wallet, token_stats.ogn_contract)
2023-04-27T19:05:54.842407+00:00 app[scheduler.1237]: File "/app/logic/scripts/update_token_insight.py", line 359, in fetch_wallet_token_balance
2023-04-27T19:05:54.842467+00:00 app[scheduler.1237]: raise ValueError(resp["message"] or ("Failed to fetch %s balance" % token_addr))
2023-04-27T19:05:54.842478+00:00 app[scheduler.1237]: ValueError: NOTOK

Relevant code:
https://github.com/OriginProtocol/origin-website/blob/803fe4dc0e86b2f8be33e29e566442c7746cf556/logic/scripts/update_token_insight.py#L349

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read logic/scripts/update_token_insight.py around fetch_wallet_token_balance at line 349 and trace the calls shown in the traceback. Reproduce or inspect the scheduler failure, then define and verify the expected behavior when Etherscan returns “Max rate limit reached”; the issue does not specify the intended handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.