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

Improving RPC health check robustness #30

Open
Keyrxng opened this issue Jul 22, 2024 · 10 comments
Open

Improving RPC health check robustness #30

Keyrxng opened this issue Jul 22, 2024 · 10 comments

Comments

@Keyrxng
Copy link
Contributor

Keyrxng commented Jul 22, 2024

The handler is now a proxy which routes on-chain read/writes through it handling retry and reselection logic. The original issue was that eth_call is not supported was being thrown by some endpoints due to network sync issues on the provider's part. While the proxy approach resolves this indirectly it could be beneficial to deal with the underlying issue.

While we can do our best to serve a healthy provider from the beginning it's possible a user call may still fail although with an improved health check this is far less likely and with our proxy the other endpoints should be also be perfectly healthy


Option 1

Current: fetch block number and ensure it's valid data
Proposed: block number + permit2 read op

The health check can be improved by a number of methods but one that makes sense to me is repeating the eth_call which highlighted the issue originally


The downsides with this is:

  1. That it has been proven that the same eth_call can and will fail intermittently even with some of the best RPCs for that network, so would require best-of 3 calls for example
  2. If checks are 'fragile' like this then it's entirely possible we encounter a 'no providers found' scenario in error
  3. The more checks added the higher the chance the above happens
  4. It's still possible for a call to fail due to provider error
  5. The more calls we add the higher the network demand on load
  6. ^ the slower we are to returning a provider
  7. Our data/provider is static after load unless re-rendered/recalled

The upsides with this is:

  1. We are guaranteed healthy endpoints
  2. Less chance retry logic will be executed

Option 2

Adopt a polling-based approach, first gather our healthy endpoints and then poll them according to config settings ensuring that they remain healthy and pop them if they fault. We could collect the first pool using just the block number check and then any that make it to round two are polled with eth_call read ops.

Downsides:

  • Perpetual read ops called
  • runtime network demand depending on settings and amount of providers to poll
  • We may hit call limits with our check and serve it for the user to get rate limited (low chance)

Upsides:

  • Dynamic health status
  • Potentially makes retry logic obsolete
  • network load demand is on par with option 1

Option two would require a pretty big overhaul of the current system as opposed to option one

Any other suggestions are welcome

related issue context ubiquity/pay.ubq.fi#235 (comment)

@0x4007
Copy link
Member

0x4007 commented Jul 22, 2024

2 seems more robust so that seems like the better choice.

@surafeldev
Copy link

/start

@surafeldev
Copy link

/help

Copy link
Contributor

ubiquity-os bot commented Sep 26, 2024

Available Commands

Command Description Example
/help List all available commands. /help
/allow Allows the user to modify the given label. /allow @user1 label
/query Returns the user's wallet, access, and multiplier information. /query @ubiquibot
/start Assign yourself to the issue. /start
/stop Unassign yourself from the issue. /stop
/wallet Register your wallet address for payments. /wallet ubq.eth

@surafeldev
Copy link

/wallet 0x0013f4217f6a8B48A92f7EA5d811A5F8D8364B93

Copy link
Contributor

ubiquity-os bot commented Sep 26, 2024

+ Successfully registered wallet address

@surafeldev
Copy link

/start

Copy link
Contributor

ubiquity-os bot commented Sep 26, 2024

! No labels are set.

Copy link
Contributor

ubiquity-os bot commented Sep 30, 2024

@surafeldev, this task has been idle for a while. Please provide an update.

1 similar comment
Copy link
Contributor

ubiquity-os bot commented Oct 4, 2024

@surafeldev, this task has been idle for a while. Please provide an update.

0x4007 added a commit that referenced this issue Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants