From 89ff451c775e9e476dcb29ab8dcb0e1ca619b254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Tue, 28 May 2024 12:54:36 +0300 Subject: [PATCH] fix: make sure building of pending blocks don't have any lasting sideaffects (#779) --- miner/scroll_worker.go | 20 ++++++++++++-------- params/version.go | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 9b7a1b63a6..bb8da0658c 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -556,6 +556,14 @@ func (w *worker) startNewPipeline(timestamp int64) { } func (w *worker) handlePipelineResult(res *pipeline.Result) error { + if !w.isRunning() { + if res != nil && res.FinalBlock != nil { + w.updateSnapshot(res.FinalBlock) + } + w.currentPipeline = nil + return nil + } + if res != nil && res.OverflowingTx != nil { if res.FinalBlock == nil { // first txn overflowed the circuit, skip @@ -602,14 +610,6 @@ func (w *worker) handlePipelineResult(res *pipeline.Result) error { } } - if !w.isRunning() { - if res != nil && res.FinalBlock != nil { - w.updateSnapshot(res.FinalBlock) - } - w.currentPipeline = nil - return nil - } - var commitError error if res != nil && res.FinalBlock != nil { if commitError = w.commit(res); commitError == nil { @@ -747,6 +747,10 @@ func (w *worker) postSideBlock(event core.ChainSideEvent) { } func (w *worker) onTxFailingInPipeline(txIndex int, tx *types.Transaction, err error) bool { + if !w.isRunning() { + return false + } + writeTrace := func() { var trace *types.BlockTrace var errWithTrace *pipeline.ErrorWithTrace diff --git a/params/version.go b/params/version.go index 9f991beae3..4146d57d01 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 = 24 // Patch version component of the current release + VersionPatch = 25 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )