File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818### Fixed
1919
2020- Avoid evicting yet to be processed heights [ #3204 ] ( https://github.com/evstack/ev-node/pull/3204 )
21+ - Bound Badger index cache memory to prevent growth with chain length [ 3209] ( https://github.com/evstack/ev-node/pull/3209 )
2122- Refetch latest da height instead of da height +1 when P2P is offline [ #3201 ] ( https://github.com/evstack/ev-node/pull/3201 )
2223- Fix race on startup sync. [ #3162 ] ( https://github.com/evstack/ev-node/pull/3162 )
2324- Strict raft state. [ #3167 ] ( https://github.com/evstack/ev-node/pull/3167 )
Original file line number Diff line number Diff line change @@ -6,11 +6,20 @@ import (
66 badger4 "github.com/ipfs/go-ds-badger4"
77)
88
9+ const (
10+ // DefaultBadgerIndexCacheSize bounds Badger's table index and bloom filter
11+ // cache to avoid growth with chain length.
12+ DefaultBadgerIndexCacheSize int64 = 256 << 20 // 256 MiB
13+ )
14+
915// BadgerOptions returns ev-node tuned Badger options for the node workload.
1016// These defaults favor write throughput for append-heavy usage.
1117func BadgerOptions () * badger4.Options {
1218 opts := badger4 .DefaultOptions
1319
20+ // Bound Badger-owned caches explicitly instead of inheriting a large block
21+ // cache and an unbounded index cache from the upstream defaults.
22+ opts .Options = opts .WithIndexCacheSize (DefaultBadgerIndexCacheSize )
1423 // Disable conflict detection to reduce write overhead; ev-node does not rely
1524 // on Badger's multi-writer conflict checks for correctness.
1625 opts .Options = opts .WithDetectConflicts (false )
You can’t perform that action at this time.
0 commit comments