[SharovBot] fix: read historical receipts for frozen-block Finalize to compute correct EIP-7685 requests hash#20847
Closed
erigon-copilot[bot] wants to merge 1 commit into
Closed
Conversation
…o compute correct EIP-7685 requests hash When block execution resumes from a snapshot boundary (startTxIndex > 0), all user transactions are already frozen in domain snapshot files. The blockReceipts slice for this run is empty (0 transactions executed). However, EIP-7685 request validation in Finalize requires logs from ALL transactions in the block — specifically EIP-6110 deposit events — to compute the correct requestsHash. Fix: when startTxIndex > 0 and the block header has a non-nil RequestsHash (Prague+), read historical receipts from the receipt-cache domain via ReadReceiptsCacheV2 and use those as the full receipts set for Finalize. This fixes the sync-from-scratch regression at mainnet block 24966723: expected: 0xf572b27b91d729a55933cfcc56f8ec84716ddb181d5b0de5223522fff6bdf23d got: 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (SHA-256 of empty) The empty hash was produced because blockReceipts was empty when the block was fully frozen in snapshots, causing ParseDepositLogs to find no logs and all request types to contribute nothing to the hash. Fixes: https://github.com/erigontech/erigon/actions (release/3.4 minimal-node-sync-from-scratch-test and sync-with-externalcl lighthouse failures) Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
Collaborator
|
closing in favor of #20849 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[SharovBot]
Problem
The
minimal-node-sync-from-scratch-testandsync-with-externalcl (lighthouse)CI jobs on release/3.4 fail with:Block
24966723on mainnet has 754 transactions, one of which is a deposit to the EIP-6110 beacon deposit contract (0x00000000219ab540356cbb839cbe05303d7705fa). This deposit contributes to the block'srequestsHash.Root Cause
When the sync resumes from a snapshot boundary and all 754 transactions are already in the frozen domain files (
startTxIndex = 754), the serial executor'sblockReceiptsslice is empty — no transactions were executed in this run. However,engine.FinalizereceivesblockReceiptsto parse deposit logs viaParseDepositLogs. With an empty slice, no deposit logs are found, all three request types (deposits, withdrawals, consolidations) contribute nothing to the SHA-256 chain, and the computed hash isSHA256("") = 0xe3b0c44298...instead of the correct value.Fix
In
executeBlock, whenstartTxIndex > 0and the block header has a non-nilRequestsHash(Prague+), read historical receipts from the receipt-cache domain viarawdb.ReadReceiptsCacheV2and use the full historical receipt set for theFinalizecall. This ensuresParseDepositLogssees the complete log set.Testing
go build ./...passes clean