Skip to content

polygon/sync: announce blocks/hashes for blocks received via hash announcements#39

Closed
manav2401 wants to merge 1 commit intomainfrom
manav/polygon-sync-fix
Closed

polygon/sync: announce blocks/hashes for blocks received via hash announcements#39
manav2401 wants to merge 1 commit intomainfrom
manav/polygon-sync-fix

Conversation

@manav2401
Copy link
Member

@manav2401 manav2401 commented Oct 14, 2025

A sync issue was recently discovered on a devnet where a bor node was unable to sync with only erigon nodes as it's peers. On further debugging, it turns out that erigon in some cases doesn't announce new blocks or block hashes.

When processing a block, the source of that block is also passed along. If the source is EventSourceP2PNewBlock i.e. block received directly via p2p, that block was further announced (normal block announcement to sqrt(peers) and hash announcement to all peers later). But if erigon receives an announcement of a new block hash (instead of full block), it marks the source as EventSourceP2PNewBlockHashes, fetches the block and processes it. Blocks from this source aren't propagated further which seems incorrect.

This PR fixes that and also sends the block further to peers. This changes was tested on the devnet and it fixed the syncing issue for bor (with only erigon peers).

@ssandeep
Copy link

Should we also open a PR to upstream Erigon repo?

@manav2401
Copy link
Member Author

Should we also open a PR to upstream Erigon repo?

We can but this only applies to polygon's sync logic so not sure how relevant it would be.

@manav2401
Copy link
Member Author

Closing in favour of #44

@manav2401 manav2401 closed this Oct 16, 2025
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

Comments