Repository navigation
Conversation
Add NodeConfig.RedialBackoffMin: the delay before the first redial of an unreachable node. 0 redials immediately; later attempts back off as before (from 100ms when 0). MultiNodeConfig keeps the current 1s.
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.
When a node is declared unreachable,
unreachableLoopalways waits at least 1s before the first redial (NewRedialBackoff: min 1s, max 15s). The 1s is hardcoded and can't be configured.For a single RPC entry behind a proxy or load balancer, a common reason to become unreachable is that the backend serving the connection restarted. A fresh connection is usually available right away, so the wait is downtime for the chain on every backend restart. With several RPC entries failover hides this; with one entry it doesn't.
This adds
NodeConfig.RedialBackoffMin() time.Duration:0redials immediately. If that attempt fails, retries back off starting from 100ms (the backoff library's floor for a zero min), so there is no tight loop against an endpoint that is still down.NewRedialBackoff(chain ID recheck, syncing recheck, send-only nodes) are unchanged.No behavior change by default.
MultiNodeConfig.RedialBackoffMin()returns 1s, so chains usingMultiNodeConfigkeep the current timing. EVM exposes the value throughNodePoolin a separate PR.Merge order: this adds a method to
NodeConfig, so chainlink-evm can only bump multinode past this change once itsNodePool.RedialBackoffMinPR (below) is merged. That PR builds against the current multinode and can be merged first.Tests:
with RedialBackoffMin zero, redials immediatelyandwith RedialBackoffMin set, waits it before the first redial(first dial no earlier than 1s).aliveLooptests that move to unreachable without aDialmock relied on the hardcoded 1s wait; they now setredialBackoffMin: time.Secondexplicitly to keep testing the same thing.Requires Dependencies
None.
Resolves Dependencies
config: add NodePool.RedialBackoffMin(config: add NodePool.RedialBackoffMin chainlink-evm#585)