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

Improve RPC provider request handling #3774

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Improve RPC provider request handling #3774

wants to merge 3 commits into from

Conversation

hyphenized
Copy link
Collaborator

This adds TahoRPCProvider to optimize RPC batching and request handling and sets it as default provider used since most
public RPCs support batching. This provider is configurable and sets sane defaults that seem to work fine with most of the public RPCs we use within the wallet.

Furthermore since options can be changed at runtime, the serial fallback provider should be able use error data to adjust the provider options if the already strict limits change in the future.

Use correct types for providers supported by serial-fallback-provider. Should also help avoid some type casts when accessing provider internals.
Added `TahoRPCProvider` to optimize RPC batching and request handling.
Batch limits can now be set per provider.

This also sets TahoRPCProvider as the default provider used since most
json 2.0 rpcs support batching. It does not handle cases where the provider
refuses to handle batches even if they consist of a single request, as is the
case with the flashbots rpc.
Reduced the max batch length from 20 to 10 for better compatibility with
public RPCs and added a configurable delay between requests to prevent
rate limit errors.
@hyphenized hyphenized self-assigned this Feb 6, 2025
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

Successfully merging this pull request may close these issues.

1 participant