Skip to content

Commit 84b12df

Browse files
authored
core/rawdb: add sanity-limit to header accessor (#29534)
1 parent 3705acd commit 84b12df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/rawdb/accessors_chain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ func ReadHeaderRange(db ethdb.Reader, number uint64, count uint64) []rlp.RawValu
316316
if count == 0 {
317317
return rlpHeaders
318318
}
319-
// read remaining from ancients
320-
data, err := db.AncientRange(ChainFreezerHeaderTable, i+1-count, count, 0)
319+
// read remaining from ancients, cap at 2M
320+
data, err := db.AncientRange(ChainFreezerHeaderTable, i+1-count, count, 2*1024*1024)
321321
if err != nil {
322322
log.Error("Failed to read headers from freezer", "err", err)
323323
return rlpHeaders

0 commit comments

Comments
 (0)