Skip to content
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

fix(op-node/op-batcher/op-proposer): the fallback client should always try recover #118

Merged
merged 11 commits into from
Mar 7, 2024

Conversation

welkin22
Copy link
Contributor

Description

In extreme cases, all of our endpoint URLs may be unable to connect, and the rpcInitFunc will return an error, causing the recoverIfFirstRpcHealth function to not have a chance to execute. So when the endpoint URLs are restored, our currentIndex counter still points to the end of the urlList array, causing internal state confusion in the fallbackClient and permanently disabling the fallback function until the node is restarted.

Rationale

We use defer to ensure that no matter what the situation, recoverIfFirstRpcHealth will be executed.

Example

none

Changes

Notable changes:

  • Use defer to ensure that recoverIfFirstRpcHealth will always be executed regardless of the circumstances.
  • Add a judgment condition to avoid mistakenly closing firstRpc with lastRpc.Close(), which will cause confusion in subsequent logic execution.

owen-reorg
owen-reorg previously approved these changes Jan 30, 2024
@welkin22 welkin22 requested a review from owen-reorg February 1, 2024 08:07
Copy link
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Feb 16, 2024
@welkin22 welkin22 removed the Stale label Feb 18, 2024
Copy link
Contributor

github-actions bot commented Mar 4, 2024

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 4, 2024
@welkin22 welkin22 removed the Stale label Mar 4, 2024
aweneagle

This comment was marked as duplicate.

Copy link

@andyzhang2023 andyzhang2023 left a comment

Choose a reason for hiding this comment

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

looks good.

@owen-reorg owen-reorg merged commit 2fbabc7 into bnb-chain:develop Mar 7, 2024
9 checks passed
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.

4 participants