From c1d1b1298fa23b6abb70eae5f1f0083d70057939 Mon Sep 17 00:00:00 2001 From: andyzhang2023 <147463846+andyzhang2023@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:20:54 +0800 Subject: [PATCH 1/2] bugfix: txpool reheap oom (#211) Co-authored-by: andyzhang2023 Co-authored-by: Owen <103096885+owen-reorg@users.noreply.github.com> --- core/txpool/legacypool/legacypool.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 7953eda76e..202f495dc6 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -391,7 +391,7 @@ func (pool *LegacyPool) Init(gasTip uint64, head *types.Header, reserve txpool.A } func (pool *LegacyPool) loopOfSync() { - ticker := time.NewTicker(200 * time.Millisecond) + ticker := time.NewTicker(400 * time.Millisecond) for { select { case <-pool.reorgShutdownCh: @@ -1892,6 +1892,7 @@ func (pool *LegacyPool) demoteUnexecutables(demoteAddrs []common.Address) { } demoteTxMeter.Mark(int64(len(demoteAddrs))) + var removed = 0 // Iterate over all accounts and demote any non-executable transactions gasLimit := txpool.EffectiveGasLimit(pool.chainconfig, pool.currentHead.Load().GasLimit, pool.config.EffectiveGasCeil) for _, addr := range demoteAddrs { @@ -1955,7 +1956,9 @@ func (pool *LegacyPool) demoteUnexecutables(demoteAddrs []common.Address) { } } pool.pendingCache.del(dropPendingCache, pool.signer) + removed += len(dropPendingCache) } + pool.priced.Removed(removed) } // addressByHeartbeat is an account address tagged with its last activity timestamp. From daa702b7119a98d5928f86330365ce259fdfe475 Mon Sep 17 00:00:00 2001 From: Owen <103096885+owen-reorg@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:06:21 +0800 Subject: [PATCH 2/2] doc: add changelogs to v0.5.3 (#228) --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41edcda0a5..5b5a6d13f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## v0.5.3 + +This is a minor release for opBNB Mainnet and Testnet. + +It fixes a txpool memory leak bug that could cause out-of-memory issues. + +It is recommended to upgrade to this version for both Mainnet and Testnet. + +### What's Changed +* fix: txpool reheap out-of-memory issues by @andyzhang2023 in https://github.com/bnb-chain/op-geth/pull/211 + +### Docker Images +ghcr.io/bnb-chain/op-geth:v0.5.3 + +**Full Changelog**: https://github.com/bnb-chain/op-geth/compare/v0.5.2...v0.5.3 + ## v0.5.2 This is a minor release for opBNB Mainnet and Testnet.