You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration/index.mdx
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,9 @@ This table lists the environment variables and their default values.
65
65
|`PROVIDER_RETRY_BASE_DELAY_MS`|`100`|`<delay in milliseconds>`| Base delay between retry attempts in milliseconds. |
66
66
|`PROVIDER_RETRY_MAX_DELAY_MS`|`2000`|`<delay in milliseconds>`| Maximum delay between retry attempts in milliseconds. |
67
67
|`PROVIDER_MAX_FAILOVERS`|`3`|`<number of failovers>`| Maximum number of failovers (switching to different providers). |
68
+
|`PROVIDER_FAILURE_THRESHOLD`|`3`|`<number>`| Number of consecutive failures before a provider is temporarily paused. When a provider reaches this threshold, it will be paused for the duration specified by `PROVIDER_PAUSE_DURATION_SECS`. Supports legacy env var `RPC_FAILURE_THRESHOLD`. |
69
+
|`PROVIDER_PAUSE_DURATION_SECS`|`60`|`<seconds>`| Duration in seconds that a provider remains paused after reaching the failure threshold. During this time, the relayer will attempt to use other available providers. Supports legacy env var `RPC_PAUSE_DURATION_SECS`. |
70
+
|`PROVIDER_FAILURE_EXPIRATION_SECS`|`60`|`<seconds>`| Duration in seconds after which individual failure records are considered stale and automatically removed. This allows providers to naturally recover over time even without explicit success calls. Failures older than this duration are not counted toward the failure threshold. |
68
71
|`ENABLE_SWAGGER`|`false`|`true, false`| Enable or disable Swagger UI for API documentation. |
69
72
|`KEYSTORE_PASSPHRASE`| `` |`<keystore passphrase>`| Passphrase for the keystore file used for signing transactions. |
70
73
|`BACKGROUND_WORKER_TRANSACTION_REQUEST_CONCURRENCY`|`50`|`<any positive number>`| Maximum number of concurrent transaction request jobs that can be processed simultaneously. |
The relayer automatically tracks the health of RPC providers and manages failover:
311
+
312
+
***Failure Tracking**: When a provider fails, the failure is recorded with a timestamp. Failures older than `PROVIDER_FAILURE_EXPIRATION_SECS` (default: 60 seconds) are automatically considered stale and removed.
313
+
314
+
***Automatic Pausing**: When a provider reaches `PROVIDER_FAILURE_THRESHOLD` (default: 3) failures within the expiration window, it is automatically paused for `PROVIDER_PAUSE_DURATION_SECS` (default: 60 seconds). During this pause period, the relayer will attempt to use other available providers.
315
+
316
+
***Automatic Recovery**: After the pause duration expires, the provider becomes available again. Additionally, if all failures expire (older than `PROVIDER_FAILURE_EXPIRATION_SECS`), the provider automatically recovers even if it hasn't reached the pause expiration time.
317
+
318
+
***Fallback Behavior**: If all non-paused providers are unavailable, the relayer will fall back to paused providers as a last resort, ensuring maximum availability.
319
+
320
+
You can configure these behaviors using the environment variables:
321
+
*`PROVIDER_FAILURE_THRESHOLD`: Number of failures before pausing (default: 3)
322
+
*`PROVIDER_PAUSE_DURATION_SECS`: How long to pause a failed provider (default: 60 seconds)
323
+
*`PROVIDER_FAILURE_EXPIRATION_SECS`: How long failures are remembered (default: 60 seconds)
0 commit comments