Skip to content

eth: not begin to sync during processing broadcasted blocks or hash#3167

Merged
buddh0 merged 2 commits intobnb-chain:developfrom
buddh0:avoid-unnecessary-sync
Jun 16, 2025
Merged

eth: not begin to sync during processing broadcasted blocks or hash#3167
buddh0 merged 2 commits intobnb-chain:developfrom
buddh0:avoid-unnecessary-sync

Conversation

@buddh0
Copy link
Contributor

@buddh0 buddh0 commented Jun 13, 2025

Description

eth: not begin to sync during processing broadcasted blocks or hash

Rationale

A node may begin syncing after receiving a block but before it has been fully imported.
While syncing, fast finality voting is disabled. Since syncing can occasionally take up to a minute, the validator may miss one or more voting opportunities.
This behavior is unnecessary and should be avoided.

in testnet, sync too many times
image

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

galaio
galaio previously approved these changes Jun 13, 2025
zzzckck
zzzckck previously approved these changes Jun 13, 2025
@zzzckck zzzckck requested a review from Copilot June 13, 2025 13:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces logic to prevent unnecessary synchronization when the node is only slightly behind, by pausing briefly and re-checking the local head before initiating a sync.

  • Adds an else if branch in nextSyncOp to detect small total-difficulty lag (≤ common.Big2)
  • Sleeps for 3 seconds, then re-checks the local head to skip sync if it's caught up

@buddh0 buddh0 dismissed stale reviews from zzzckck and galaio via 5a43750 June 14, 2025 03:34
@buddh0 buddh0 merged commit 00e8247 into bnb-chain:develop Jun 16, 2025
7 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.

3 participants

Comments