-
Notifications
You must be signed in to change notification settings - Fork 396
fix(operator): Operator panic's when reconnect fails after max retries #1692
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
Closed
PatStiles
wants to merge
4
commits into
staging
from
960-fix-operator-panic-when-reconnect-fails-after-max-retries
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,18 +32,21 @@ const ( | |||||
| NetworkMultiplier float64 = 2 // Multiplier factor computed exponential retry interval is scaled by. | ||||||
| NetworkNumRetries uint64 = 3 // Total number of retries attempted. | ||||||
|
|
||||||
| // Retry Params for Sending Tx to Chain | ||||||
| // Retry Parameters for Sending a Tx to Chain | ||||||
| ChainInitialInterval = 12 * time.Second // Initial delay for retry interval for contract calls. Corresponds to 1 ethereum block. | ||||||
| ChainMaxInterval = 2 * time.Minute // Maximum interval for an individual retry. | ||||||
|
|
||||||
| // Retry Params for WaitForTransactionReceipt in the Fee Bump | ||||||
| // Retry Parameters for WaitForTransactionReceipt in the Fee Bump | ||||||
| WaitForTxMaxInterval = 2 * time.Second // Maximum interval for an individual retry. | ||||||
| WaitForTxNumRetries = 0 // Total number of retries attempted. If 0, retries indefinitely until maxElapsedTime is reached. | ||||||
|
|
||||||
| // Retry Parameters for RespondToTaskV2 in the Fee Bump | ||||||
| RespondToTaskV2MaxInterval = time.Millisecond * 500 // Maximum interval for an individual retry. | ||||||
| RespondToTaskV2MaxElapsedTime = 0 // Maximum time all retries may take. `0` corresponds to no limit on the time of the retries. | ||||||
| RespondToTaskV2NumRetries uint64 = 0 // Total number of retries attempted. If 0, retries indefinitely until maxElapsedTime is reached. | ||||||
| RespondToTaskV2MaxInterval = time.Millisecond * 500 // Maximum interval for an individual retry. | ||||||
| RespondToTaskV2MaxElapsedTime = 0 // Maximum time all retries may take. `0` corresponds to no limit on the time of the retries. | ||||||
| RespondToTaskV2NumRetries = 0 // Total number of retries attempted. If 0, retries indefinitely until maxElapsedTime is reached. | ||||||
|
|
||||||
| // Retry Parameters for SubscribeToNewTasksV3 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed! |
||||||
| SubscribeToNewTasksNumRetries = 0 // Total number of retries attempted. If 0, retries indefinitely until maxElapsedTime is reached. | ||||||
| ) | ||||||
|
|
||||||
| type RetryParams struct { | ||||||
|
|
@@ -102,6 +105,17 @@ func WaitForTxRetryParams(maxElapsedTime time.Duration) *RetryParams { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| func SubscribeToNewTasksParams() *RetryParams { | ||||||
| return &RetryParams{ | ||||||
| InitialInterval: NetworkInitialInterval, | ||||||
| MaxInterval: NetworkMaxInterval, | ||||||
| MaxElapsedTime: NetworkMaxElapsedTime, | ||||||
| RandomizationFactor: NetworkRandomizationFactor, | ||||||
| Multiplier: NetworkMultiplier, | ||||||
| NumRetries: SubscribeToNewTasksNumRetries, | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /* | ||||||
| Retry and RetryWithData are custom retry functions used in Aligned's aggregator and operator to facilitate consistent retry logic across the system. | ||||||
| They are interfaces for around Cenk Alti (https://github.com/cenkalti) backoff library (https://github.com/cenkalti/backoff). We would like to thank him for his great work. | ||||||
|
|
||||||
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.
Uh oh!
There was an error while loading. Please reload this page.