diff --git a/.github/workflows/l2geth_ci.yml b/.github/workflows/l2geth_ci.yml index 8778c2cc2531..7dfa4a084f73 100644 --- a/.github/workflows/l2geth_ci.yml +++ b/.github/workflows/l2geth_ci.yml @@ -70,7 +70,7 @@ jobs: with: go-version: 1.18.x - name: Install goimports - run: go install golang.org/x/tools/cmd/goimports@latest + run: go install golang.org/x/tools/cmd/goimports@v0.24.0 - name: Checkout code uses: actions/checkout@v2 - run: goimports -local github.com/scroll-tech/go-ethereum/ -w . diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 37bbb2e2aaa1..02935466dd5c 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -774,14 +774,14 @@ func (e retryableCommitError) Unwrap() error { // commit runs any post-transaction state modifications, assembles the final block // and commits new work if consensus engine is running. -func (w *worker) commit(force bool) (common.Hash, error) { +func (w *worker) commit(reorging bool) (common.Hash, error) { sealDelay := time.Duration(0) defer func(t0 time.Time) { l2CommitTimer.Update(time.Since(t0) - sealDelay) }(time.Now()) w.updateSnapshot() - if !w.isRunning() && !force { + if !w.isRunning() && !reorging { return common.Hash{}, nil } @@ -858,7 +858,7 @@ func (w *worker) commit(force bool) (common.Hash, error) { currentHeight := w.current.header.Number.Uint64() maxReorgDepth := uint64(w.config.CCCMaxWorkers + 1) - if currentHeight > maxReorgDepth { + if !reorging && currentHeight > maxReorgDepth { ancestorHeight := currentHeight - maxReorgDepth ancestorHash := w.chain.GetHeaderByNumber(ancestorHeight).Hash() if rawdb.ReadBlockRowConsumption(w.chain.Database(), ancestorHash) == nil {