core/rawdb: fix HasBAL Pre-EIP-8189 canonical blocks have empty BAL entries in the freezer,

so can't rely on isCanon.
This commit is contained in:
jonny rhea 2026-03-20 14:20:36 -05:00
parent fbba18fc99
commit 8f4668cebb

View file

@ -608,13 +608,7 @@ func DeleteReceipts(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
// HasBAL verifies the existence of a block access list for a block.
func HasBAL(db ethdb.Reader, hash common.Hash, number uint64) bool {
if isCanon(db, number, hash) {
return true
}
if has, err := db.Has(balKey(number, hash)); !has || err != nil {
return false
}
return true
return len(ReadBALRLP(db, hash, number)) > 0
}
// ReadBALRLP retrieves the RLP-encoded block access list for a block.