Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changes

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

## v1.1.1

Expand Down
3 changes: 2 additions & 1 deletion block/internal/cache/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const (
DataDAIncludedPrefix = "cache/data-da-included/"

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

// CacheManager provides thread-safe cache operations for tracking seen blocks
Expand Down
5 changes: 4 additions & 1 deletion block/internal/reaping/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import (
const (
// MaxBackoffInterval is the maximum backoff interval for retries
MaxBackoffInterval = 30 * time.Second
CleanupInterval = 1 * time.Hour

// CleanupInterval is how often the reaper sweeps expired hashes
// out of the seen-tx cache.
CleanupInterval = max(cache.DefaultTxCacheRetention/10, 15*time.Second)
)

// Reaper is responsible for periodically retrieving transactions from the executor,
Expand Down
Loading