Skip to content

Rube/19 rpc can fail#23

Merged
rube-de merged 1 commit intomasterfrom
rube/19-rpc-can-fail
Feb 11, 2026
Merged

Rube/19 rpc can fail#23
rube-de merged 1 commit intomasterfrom
rube/19-rpc-can-fail

Conversation

@rube-de
Copy link
Collaborator

@rube-de rube-de commented Feb 6, 2026

Implements a mulit rpc solution

@rube-de rube-de requested a review from Copilot February 6, 2026 13:45
@rube-de rube-de linked an issue Feb 6, 2026 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a multi-RPC provider solution to handle RPC endpoint failures through automatic failover. The implementation replaces single RPC URLs with indexed environment variables (SOURCE_RPC_URL_1, SOURCE_RPC_URL_2, etc.) and introduces a new MultiRpcWeb3Provider class that manages sequential failover across multiple RPC endpoints with exponential backoff.

Changes:

  • Introduced MultiRpcWeb3Provider class with automatic failover, rate limit handling, and chain ID validation
  • Updated configuration to parse indexed RPC URLs (SOURCE_RPC_URL_1, _2, _3, etc.) using parse_indexed_rpc_urls
  • Refactored PollingEventListener, ProofManager, and ROFLRelayer to use MultiRpcWeb3Provider instead of direct Web3 instances
  • Added comprehensive test coverage for failover scenarios, rate limiting, and integration with relayer components
  • Updated documentation, compose files, and error messages to reflect the new multi-RPC configuration

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
paymaster_relayer/utils/multi_rpc_provider.py New provider class implementing sequential failover with exponential backoff, rate limit handling, and chain ID validation
paymaster_relayer/config.py Added parse_indexed_rpc_urls function to parse numbered environment variables and updated SourceChainConfig to use list of URLs
paymaster_relayer/utils/polling_event_listener.py Refactored to accept MultiRpcWeb3Provider and execute operations within failover context for consistency
paymaster_relayer/proof_manager.py Updated to use source_provider.execute_with_failover for all Web3 operations instead of direct w3_source calls
paymaster_relayer/relayer.py Changed initialization to create MultiRpcWeb3Provider for source chain and pass provider to listeners
paymaster_relayer/__main__.py Updated error messages to reference indexed environment variables
paymaster_relayer/event_processor.py Minor formatting improvements (line wrapping for readability)
paymaster_relayer/utils/contract_utility.py Minor formatting change (line wrapping)
tests/test_multi_rpc_provider.py Comprehensive unit tests for failover scenarios, rate limiting, backoff, and error handling
tests/test_multi_rpc_integration.py Integration tests for relayer and event listener using multi-RPC provider
tests/test_config.py Tests for indexed URL parsing including edge cases (gaps, order, legacy URLs)
tests/test_retry_logic.py Updated mocks to use MultiRpcWeb3Provider with proper execute_with_failover simulation
tests/test_proof_generation.py Updated to create MultiRpcWeb3Provider and use source_provider instead of w3_source
tests/test_relayer.py Updated to pass MultiRpcWeb3Provider to PollingEventListener
compose.yaml Changed SOURCE_RPC_URL to SOURCE_RPC_URL_1 for all relayer services
compose.local.yaml Changed SOURCE_RPC_URL to SOURCE_RPC_URL_1 for all relayer services
README.md Updated documentation to describe indexed RPC URL environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rube-de rube-de requested a review from matevz February 6, 2026 15:48
@rube-de rube-de marked this pull request as ready for review February 6, 2026 15:48
@rube-de rube-de force-pushed the rube/19-rpc-can-fail branch 2 times, most recently from 16c41dd to ca16cfc Compare February 10, 2026 18:40
Sequential failover across multiple RPC endpoints with exponential
backoff. Replaces single SOURCE_RPC_URL with comma-delimited
SOURCE_RPC_URLS. Retries indefinitely on network failures with
graceful shutdown support.
@rube-de rube-de force-pushed the rube/19-rpc-can-fail branch from ca16cfc to 601bd6e Compare February 11, 2026 10:42
@rube-de rube-de merged commit 9f5d31f into master Feb 11, 2026
6 checks passed
@rube-de rube-de deleted the rube/19-rpc-can-fail branch February 11, 2026 10:43
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.

RPC can fail

2 participants