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

PLAT-955: default to local RPC and fallback to gateway #5239

Merged
merged 5 commits into from May 16, 2023

Conversation

alecsavvy
Copy link
Contributor

Description

Since ACDC has been functioning correctly for awhile discprov should be using its local node to index. This will reduce network latency and traffic to cloudflare will only be external RPC clients like web and mobile. There is a fallback if the node is unhealthy to use the RPC gateway should one node not report healthy.

Tests

Will run on a node on stage once build is complete.

Monitoring - How will this change be monitored? Are there sufficient logs / alerts?

Logs showing which web3 provider was chosen will appear on startup. This will tell us if discprov thinks its local node is unhealthy and if it fell back to the gateway.

@alecsavvy alecsavvy requested review from isaacsolo and a team May 16, 2023 16:16
web3endpoint = LOCAL_RPC
logger.info("web3_provider.py | using local RPC")
else:
# if local rpc isn't healthy fall back to gateway
Copy link
Member

Choose a reason for hiding this comment

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

could be

try:
  if 200:
    # LOCAL_RPC
  else:
    raise Exception('local rpc unhealthy')
except Exception as e:
   logger.warn(e)
   web3endpoint = os...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh nice! thanks

@alecsavvy alecsavvy merged commit ebdebcb into main May 16, 2023
15 of 17 checks passed
@alecsavvy alecsavvy deleted the as/plat-965-index-local-rpc branch May 16, 2023 23:38
alecsavvy added a commit that referenced this pull request May 17, 2023
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
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