From 54f72c796fb4f8cdf3e050d73af27eb400a6f2bc Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 19 Feb 2026 18:43:44 +0800 Subject: [PATCH] core/rawdb: revert "check pruning tail in HasBody and HasReceipts" (#33865) Reverts ethereum/go-ethereum#33747. This change suffers an unexpected issue during the sync with `history.chain=postmerge`. --- core/rawdb/accessors_chain.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 14308dd698..6ae64fb2fd 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -424,13 +424,7 @@ func WriteBodyRLP(db ethdb.KeyValueWriter, hash common.Hash, number uint64, rlp // HasBody verifies the existence of a block body corresponding to the hash. func HasBody(db ethdb.Reader, hash common.Hash, number uint64) bool { if isCanon(db, number, hash) { - // Block is in ancient store, but bodies can be pruned. - // Check if the block number is above the pruning tail. - tail, _ := db.Tail() - if number >= tail { - return true - } - return false + return true } if has, err := db.Has(blockBodyKey(number, hash)); !has || err != nil { return false @@ -472,13 +466,7 @@ func DeleteBody(db ethdb.KeyValueWriter, hash common.Hash, number uint64) { // to a block. func HasReceipts(db ethdb.Reader, hash common.Hash, number uint64) bool { if isCanon(db, number, hash) { - // Block is in ancient store, but receipts can be pruned. - // Check if the block number is above the pruning tail. - tail, _ := db.Tail() - if number >= tail { - return true - } - return false + return true } if has, err := db.Has(blockReceiptsKey(number, hash)); !has || err != nil { return false