Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

eth/fetcher: don't skip block/header when parent is not found #633

Closed
wants to merge 1 commit into from

Conversation

minh-bq
Copy link
Collaborator

@minh-bq minh-bq commented Nov 20, 2024

Currently, we simply skip importing block/header when parent block/header is not found. However, since multiple blocks can be imported in parallel, the not found parent might be due to the fact that the parent import does not finish yet. This leads to a suitation that the correct block in canonical chain is skipped and the node gets stuck until the peer timeout. We observe this behavior when there are reorgs and block import is time consuming.

This commit fixes it by creating a new queue for those missing parent blocks and re-import them after the parent is imported.

@minh-bq
Copy link
Collaborator Author

minh-bq commented Nov 20, 2024

In go-ethereum, since the block announcement is in the consensus engine after the merge, the block fetcher logic is removed already (ethereum/go-ethereum#29169).

@minh-bq minh-bq marked this pull request as draft November 20, 2024 07:40
@minh-bq minh-bq force-pushed the fix/block-fetcher branch 2 times, most recently from 18066a3 to 070729b Compare November 21, 2024 06:34
Currently, we simply skip importing block/header when parent block/header is not
found. However, since multiple blocks can be imported in parallel, the not
found parent might be due to the fact that the parent import does not finish
yet. This leads to a suitation that the correct block in canonical chain is
skipped and the node gets stuck until the peer timeout. We observe this behavior
when there are reorgs and block import is time consuming.

This commit fixes it by creating a new queue for those missing parent blocks and
re-import them after the parent is imported.
@minh-bq minh-bq marked this pull request as ready for review November 21, 2024 09:04
@minh-bq minh-bq closed this by deleting the head repository Feb 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant