Skip to content

avoid local block hash calculation for compatibility with future forks#142

Merged
pk910 merged 2 commits intomasterfrom
pk910/fix-block-hashing
Oct 17, 2025
Merged

avoid local block hash calculation for compatibility with future forks#142
pk910 merged 2 commits intomasterfrom
pk910/fix-block-hashing

Conversation

@pk910
Copy link
Copy Markdown
Member

@pk910 pk910 commented Oct 17, 2025

Avoid getting stuck with invalid block hashes when activating future forks (eg. gloas):

time="2025-10-17T12:16:45Z" level=error msg="error processing block 32" client=3-geth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:45Z" level=error msg="error processing block 32" client=1-reth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:45Z" level=error msg="error processing block 32" client=2-besu-lodestar error="could not load block receipts: Block not found"
time="2025-10-17T12:16:45Z" level=error msg="failed to process block 32"
time="2025-10-17T12:16:48Z" level=error msg="error processing block 32" client=3-geth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:48Z" level=error msg="error processing block 32" client=1-reth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:48Z" level=error msg="error processing block 32" client=2-besu-lodestar error="could not load block receipts: Block not found"
time="2025-10-17T12:16:48Z" level=error msg="failed to process block 32"
time="2025-10-17T12:16:51Z" level=error msg="error processing block 32" client=1-reth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:51Z" level=error msg="error processing block 32" client=3-geth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:51Z" level=error msg="error processing block 32" client=2-besu-lodestar error="could not load block receipts: Block not found"
time="2025-10-17T12:16:51Z" level=error msg="failed to process block 32"
time="2025-10-17T12:16:51Z" level=warning msg="Detected chain reorganization at block 33. Parent hash mismatch: expected 0x76f60c7fc645b7ed7a30303d39a131427136e69f4afc8862c30f1fc64d26f256, got 0xb11bb2573bc192865998e06d355b3017ba7653282fa1f618a4a2c3f97b30cfbf"
time="2025-10-17T12:16:51Z" level=error msg="error processing block 33" client=1-reth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:51Z" level=warning msg="Detected chain reorganization at block 33. Parent hash mismatch: expected 0x76f60c7fc645b7ed7a30303d39a131427136e69f4afc8862c30f1fc64d26f256, got 0xb11bb2573bc192865998e06d355b3017ba7653282fa1f618a4a2c3f97b30cfbf"
time="2025-10-17T12:16:51Z" level=error msg="error processing block 33" client=3-geth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:51Z" level=warning msg="Detected chain reorganization at block 33. Parent hash mismatch: expected 0x76f60c7fc645b7ed7a30303d39a131427136e69f4afc8862c30f1fc64d26f256, got 0xb11bb2573bc192865998e06d355b3017ba7653282fa1f618a4a2c3f97b30cfbf"
time="2025-10-17T12:16:51Z" level=error msg="error processing block 33" client=2-besu-lodestar error="could not load block receipts: Block not found"
time="2025-10-17T12:16:51Z" level=error msg="failed to process block 33"
time="2025-10-17T12:16:54Z" level=error msg="error processing block 32" client=1-reth-lodestar error="could not load block receipts: not found"
time="2025-10-17T12:16:54Z" level=error msg="error processing block 32" client=2-besu-lodestar error="could not load block receipts: Block not found"
time="2025-10-17T12:16:54Z" level=error msg="failed to process block 32"

Root cause for this issue is the Block.Hash() method implemented by go-ethereum, which assumes a fully known block header to generate a local hash on. This is unfortunately not the case for future forks which may introduce new fields to the block header that are not known to spamoor or the used go-ethereum version.
This PR avoids using the Hash() method, using the precalculated hash that is part of the RPC response.

@pk910 pk910 merged commit ae1a34f into master Oct 17, 2025
1 check passed
@pk910 pk910 deleted the pk910/fix-block-hashing branch October 17, 2025 12:27
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.

1 participant