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

Make indexer properly resort to using gateway if chain isn't caught up #8397

Merged
merged 2 commits into from
May 8, 2024

Conversation

phelpsdb
Copy link
Contributor

@phelpsdb phelpsdb commented May 7, 2024

Description

The healthcheck will still return 200 if the chain is syncing, so we need to check the actual block number difference.

How Has This Been Tested?

audius-dn1.tikilabs.com now functional despite chain still catching up.

Copy link

changeset-bot bot commented May 7, 2024

⚠️ No Changeset found

Latest commit: 606c9c7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

web3endpoint = local_rpc
block_diff = math.abs(local_web3.eth.get_block_number() - gateway_web3.eth.get_block_number())
resp = requests.get(local_rpc + "/health")
if resp.status_code == 200 && block_diff < 10000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit pull 10000 as a const at the top

USE_LOCAL_RPC_IF_BEHIND_BLOCK_DIFFERENCE = 10000

or sthg like that 🤷

@phelpsdb phelpsdb marked this pull request as ready for review May 8, 2024 22:07
@phelpsdb phelpsdb merged commit a0e2033 into main May 8, 2024
11 checks passed
@phelpsdb phelpsdb deleted the phelpsdb-indexer-gateway branch May 8, 2024 22:15
audius-infra pushed a commit that referenced this pull request May 9, 2024
[a84cf8f] ddex: multi tenant (#8401) Steve Perkins
[a0e2033] Make indexer properly resort to using gateway if chain isn't caught up (#8397) Danny
[913c80b] DDEX users poller (#8380) Michelle Brier
[a144f6a] Index all memos (v1 and v2) and use cache in index_payment_router (#8400) Marcus Pasell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants