From e6cc960f2f75fbee287e811fe849c47bfc67e820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Wed, 29 May 2024 23:46:03 +0300 Subject: [PATCH] fix: properly release pipeline stages (#783) --- miner/scroll_worker.go | 4 +++- params/version.go | 2 +- rollup/pipeline/pipeline.go | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 3982396e23..49fb4b7251 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -401,7 +401,7 @@ func (w *worker) collectPendingL1Messages(startIndex uint64) []types.L1MessageTx func (w *worker) startNewPipeline(timestamp int64) { if w.currentPipeline != nil { - w.currentPipeline.Kill() + w.currentPipeline.Release() w.currentPipeline = nil } @@ -586,6 +586,7 @@ func (w *worker) handlePipelineResult(res *pipeline.Result) error { if res != nil && res.FinalBlock != nil { w.updateSnapshot(res.FinalBlock) } + w.currentPipeline.Release() w.currentPipeline = nil return nil } @@ -750,6 +751,7 @@ func (w *worker) commit(res *pipeline.Result) error { // Broadcast the block and announce chain insertion event w.mux.Post(core.NewMinedBlockEvent{Block: block}) + w.currentPipeline.Release() w.currentPipeline = nil return nil } diff --git a/params/version.go b/params/version.go index 3b8faf29d9..f6bd9c3bdc 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release - VersionPatch = 27 // Patch version component of the current release + VersionPatch = 28 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) diff --git a/rollup/pipeline/pipeline.go b/rollup/pipeline/pipeline.go index 0cfad6ad57..d66a04e338 100644 --- a/rollup/pipeline/pipeline.go +++ b/rollup/pipeline/pipeline.go @@ -165,9 +165,11 @@ func (p *Pipeline) TryPushTxn(tx *types.Transaction) (*Result, error) { } } -func (p *Pipeline) Kill() { +// Release releases all resources related to the pipeline +func (p *Pipeline) Release() { if p.txnQueue != nil { close(p.txnQueue) + p.txnQueue = nil } select {