Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore RC check if force committing #1029

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/l2geth_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
6 changes: 3 additions & 3 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
Loading