Add RPC provider failover for block ingestor#6430
Open
dimitrovmaksim wants to merge 4 commits intographprotocol:masterfrom
Open
Add RPC provider failover for block ingestor#6430dimitrovmaksim wants to merge 4 commits intographprotocol:masterfrom
dimitrovmaksim wants to merge 4 commits intographprotocol:masterfrom
Conversation
Use saturating_sub to avoid underflow when limit is set to 0.
When do_poll() fails, the ingestor now probes the current provider before switching. If the current provider is unreachable, all alternatives are probed in parallel and the first healthy one is selected. This avoids unnecessary switches on non-RPC failures (e.g. DB errors, chain reorgs). Also limits latest_block_ptr retries to ENV_VARS.request_retries so failures surface to the failover logic instead of retrying indefinitely.
Simplify resolve_provider_idx into resolve_provider by returning a reference to the Arc<A> instead of a usize index, eliminating the separate indexing step at the call site.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #6213
When the block ingestor's polling fails and the current RPC provider is unreachable, the ingestor now automatically switches to a healthy alternative provider. If no alternative providers are configured, the current one will be retried indefinetelly, similar to the current logic.
How it works
Other changes