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: ignore errors that caused by gap to keep peer connection #49

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

krish-nr
Copy link
Contributor

@krish-nr krish-nr commented Jan 19, 2024

Description

This PR is designed to address scenarios where dynamic-type peers in geth are too easily removed. In certain scenarios, we can increase the tolerance.

Rationale

In the context of opbnb, our block production rate and the number of transactions per block mean that there is a gap between the time geth finishes writing and the node's broadcast time. During this interval, for clients making requests to that node, it is possible that geth has not yet completed the persistence of the requested data at the moment of the request. This can trigger a peer disconnected event, even though the peer's status is actually healthy. Subsequently, extra waiting time is spent before the peer is added back. We would like peers in such situations to maintain the connection. When the block height is not more than a certain threshold behind, the connection should not be disconnected.

Example

N/A

Changes

Notable changes:

  • define and add err types
  • ignore specific err in handle loop

@krish-nr krish-nr force-pushed the krish/p2p_tolerence branch from d0193f8 to 7a10add Compare January 30, 2024 10:34
@krish-nr krish-nr marked this pull request as ready for review January 30, 2024 10:36
@github-actions github-actions bot requested review from redhdx and welkin22 January 30, 2024 10:37
Copy link
Contributor

@welkin22 welkin22 left a comment

Choose a reason for hiding this comment

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

LGTM

@owen-reorg owen-reorg merged commit 5d346de into bnb-chain:develop Feb 1, 2024
2 checks passed
andyzhang2023 pushed a commit to andyzhang2023/op-geth that referenced this pull request Mar 4, 2024
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