Skip to content

core: add debug log and repair the missing hash and receipts#35190

Open
rjl493456442 wants to merge 5 commits into
ethereum:masterfrom
rjl493456442:missinghash-log
Open

core: add debug log and repair the missing hash and receipts#35190
rjl493456442 wants to merge 5 commits into
ethereum:masterfrom
rjl493456442:missinghash-log

Conversation

@rjl493456442

@rjl493456442 rjl493456442 commented Jun 18, 2026

Copy link
Copy Markdown
Member

This PR improves the block download used by snap sync. Specifically, blocks and their associated data (receipts and canonical hash mappings) are now written directly to the database without checking existence.

The current implementation could fail in cases where the block header and body were already present (has.Block returns true), but the corresponding canonical hash mapping was missing. One possible scenario is when a newPayload event is processed without a subsequent forkChoiceUpdate.

It is still unclear why Geth may re-enter snap sync after Engine API events have been processed after the sync. Anyway, bypassing the existence is a reasonable change.

What's more, in the downloader, the presence of canonical hash is also considered for deciding the range of blocks to be downloaded. Specifically,

  • in the full sync, the block with header and body available but canonical hash missing will be re-inserted;
  • in the snap sync, the block with header, body and receipt available but canonical hash missing will be re-inserted;

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.

2 participants