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: reuse timestamp for blocks failing CCC #1031

Merged
merged 1 commit into from
Sep 10, 2024
Merged
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
7 changes: 7 additions & 0 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,13 @@ func (w *worker) newWork(now time.Time, parentHash common.Hash, reorgReason erro
Time: uint64(now.Unix()),
}

if reorgReason != nil {
// if we are replacing a failing block, reuse the timestamp to make sure
// the information we get from AsyncChecker is reliable. Changing timestamp
// might alter execution flow of reorged transactions.
colinlyguo marked this conversation as resolved.
Show resolved Hide resolved
header.Time = w.chain.GetHeaderByNumber(header.Number.Uint64()).Time
}

parentState, err := w.chain.StateAt(parent.Root())
if err != nil {
return fmt.Errorf("failed to fetch parent state: %w", err)
Expand Down
Loading