fix: ignore RC check if force committing (#1029)

* fix: ignore RC check if force committing

* rename force to reorging

* use prev goimports version
This commit is contained in:
Ömer Faruk Irmak 2024-09-09 19:31:22 +03:00 committed by GitHub
parent 590e104111
commit e426d4bffa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -70,7 +70,7 @@ jobs:
with: with:
go-version: 1.18.x go-version: 1.18.x
- name: Install goimports - 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 - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- run: goimports -local github.com/scroll-tech/go-ethereum/ -w . - run: goimports -local github.com/scroll-tech/go-ethereum/ -w .

View file

@ -774,14 +774,14 @@ func (e retryableCommitError) Unwrap() error {
// commit runs any post-transaction state modifications, assembles the final block // commit runs any post-transaction state modifications, assembles the final block
// and commits new work if consensus engine is running. // 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) sealDelay := time.Duration(0)
defer func(t0 time.Time) { defer func(t0 time.Time) {
l2CommitTimer.Update(time.Since(t0) - sealDelay) l2CommitTimer.Update(time.Since(t0) - sealDelay)
}(time.Now()) }(time.Now())
w.updateSnapshot() w.updateSnapshot()
if !w.isRunning() && !force { if !w.isRunning() && !reorging {
return common.Hash{}, nil return common.Hash{}, nil
} }
@ -858,7 +858,7 @@ func (w *worker) commit(force bool) (common.Hash, error) {
currentHeight := w.current.header.Number.Uint64() currentHeight := w.current.header.Number.Uint64()
maxReorgDepth := uint64(w.config.CCCMaxWorkers + 1) maxReorgDepth := uint64(w.config.CCCMaxWorkers + 1)
if currentHeight > maxReorgDepth { if !reorging && currentHeight > maxReorgDepth {
ancestorHeight := currentHeight - maxReorgDepth ancestorHeight := currentHeight - maxReorgDepth
ancestorHash := w.chain.GetHeaderByNumber(ancestorHeight).Hash() ancestorHash := w.chain.GetHeaderByNumber(ancestorHeight).Hash()
if rawdb.ReadBlockRowConsumption(w.chain.Database(), ancestorHash) == nil { if rawdb.ReadBlockRowConsumption(w.chain.Database(), ancestorHash) == nil {