Skip to content

Commit 5346b8f

Browse files
s1nafjl
andauthored
eth/downloader: fix missing receipt (#31952)
This fixes a regression introduced by #29158 where receipts of empty blocks were stored into the database as an empty byte array, instead of an RLP empty list. Fixes #31938 --------- Co-authored-by: Felix Lange <[email protected]>
1 parent 35c5b4f commit 5346b8f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

eth/downloader/queue.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,13 @@ func newFetchResult(header *types.Header, snapSync bool) *fetchResult {
8383
} else if header.WithdrawalsHash != nil {
8484
item.Withdrawals = make(types.Withdrawals, 0)
8585
}
86-
if snapSync && !header.EmptyReceipts() {
87-
item.pending.Store(item.pending.Load() | (1 << receiptType))
86+
if snapSync {
87+
if header.EmptyReceipts() {
88+
// Ensure the receipts list is valid even if it isn't actively fetched.
89+
item.Receipts = rlp.EmptyList
90+
} else {
91+
item.pending.Store(item.pending.Load() | (1 << receiptType))
92+
}
8893
}
8994
return item
9095
}

0 commit comments

Comments
 (0)