Skip to content

Commit

Permalink
core/rawdb: add sanity-limit to header accessor (ethereum#29534)
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman authored and xiaochangbai committed Apr 18, 2024
1 parent 57f2f05 commit ff878ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ func ReadHeaderRange(db ethdb.Reader, number uint64, count uint64) []rlp.RawValu
if count == 0 {
return rlpHeaders
}
// read remaining from ancients
data, err := db.AncientRange(ChainFreezerHeaderTable, i+1-count, count, 0)
// read remaining from ancients, cap at 2M
data, err := db.AncientRange(ChainFreezerHeaderTable, i+1-count, count, 2*1024*1024)
if err != nil {
log.Error("Failed to read headers from freezer", "err", err)
return rlpHeaders
Expand Down

0 comments on commit ff878ac

Please sign in to comment.