Skip to content

Commit 3c99304

Browse files
authored
Merge branch 'main' into marko/sec_deps
2 parents cc9dbc1 + 81c1c25 commit 3c99304

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changes
1313

1414
- Optimization of mutex usage in cache for reaper [#3286](https://github.com/evstack/ev-node/pull/3286)
15+
- Reduce tx cache retention to avoid OOM under (really) heavy tx load [#3299](https://github.com/evstack/ev-node/pull/3299)
1516

1617
## v1.1.1
1718

block/internal/cache/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const (
2626
DataDAIncludedPrefix = "cache/data-da-included/"
2727

2828
// DefaultTxCacheRetention is the default time to keep transaction hashes in cache.
29-
DefaultTxCacheRetention = 24 * time.Hour
29+
// Keeping a too high value can lead to OOM during heavy transaction load.
30+
DefaultTxCacheRetention = 30 * time.Minute
3031
)
3132

3233
// CacheManager provides thread-safe cache operations for tracking seen blocks

block/internal/reaping/reaper.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ import (
2121
const (
2222
// MaxBackoffInterval is the maximum backoff interval for retries
2323
MaxBackoffInterval = 30 * time.Second
24-
CleanupInterval = 1 * time.Hour
24+
25+
// CleanupInterval is how often the reaper sweeps expired hashes
26+
// out of the seen-tx cache.
27+
CleanupInterval = max(cache.DefaultTxCacheRetention/10, 15*time.Second)
2528
)
2629

2730
// Reaper is responsible for periodically retrieving transactions from the executor,

0 commit comments

Comments
 (0)