Skip to content

Conversation

Thegaram
Copy link

@Thegaram Thegaram commented Oct 6, 2025

1. Purpose or design rationale of this PR

It was reported that under high load, the signer node runs into ErrFutureBlock consensus failures. The root cause seems to be that once processTxnSlice returns true, we commit regardless of the deadline (block timestamp). The timestamp without relaxed mode is set to parent.Time + Period which might be in the future.

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • fix: A bug fix

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Bug Fixes

    • Improved block production timing: publishing now waits for the block deadline and presence of transactions, reducing future-dated blocks and ensuring more predictable timestamps and stability.
  • Chores

    • Bumped patch version to .6.

Copy link

coderabbitai bot commented Oct 6, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Main loop in miner/scroll_worker.go now always processes the transaction slice and no longer uses the shouldCommit return value to trigger early commits; blocks are committed only when the block deadline is reached and the current block contains at least one transaction. Patch version bumped from 5 to 6.

Changes

Cohort / File(s) Summary of Changes
Mining commit gating
miner/scroll_worker.go
Always call transaction-slice processing; ignore shouldCommit result for early commits; commit only when deadline is reached and the current block has ≥1 transaction; added comment about waiting for deadline to avoid future-dated blocks.
Version bump
params/version.go
Incremented VersionPatch from 5 to 6, updating computed version string.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant W as ScrollWorker
  participant T as TxPool
  participant C as Chain

  rect rgba(220,235,255,0.30)
  note over W: Main loop iteration (new)
  W->>T: Fetch pending transactions (ev.Txs)
  W->>W: processTxnSlice(ev.Txs)  -- always run
  W->>W: Check block deadline and tx count
  alt deadline reached AND tx_count > 0
    W->>C: Commit block (use current time ≤ deadline)
    C-->>W: Commit result
  else otherwise
    W->>W: Wait / continue accumulating txs
  end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jonastheis

Poem

A rabbit counts the pending tx,
“Process them all, but wait for ticks.”
Patch hops up from five to six,
No early stamp, no future tricks.
Commit at bell, then cuddle bricks. 🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the main change by indicating that the worker’s commit logic now respects the deadline, it is concise, specific, and follows the conventional commit format expected by the repository.
Description Check ✅ Passed The pull request description provides all required sections from the repository template, including a clear design rationale, correct conventional commit type, version bump confirmation, and breaking change label, with each section properly filled out.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-sequencer-deadline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the signer node commits blocks without waiting for the deadline, leading to ErrFutureBlock consensus failures under high load. The fix ensures that blocks are only committed when both the processing condition is met AND the deadline has been reached.

  • Modified the commit condition to require both shouldCommit and deadlineReached to be true
  • Added clarifying comments explaining the logic
  • Updated the patch version from 5 to 6

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
miner/scroll_worker.go Updated commit condition to respect deadline and added explanatory comments
params/version.go Incremented patch version from 5 to 6

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e40c0e4 and e9f3e4e.

📒 Files selected for processing (1)
  • miner/scroll_worker.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
miner/scroll_worker.go (1)

417-422: Verify impact of removing early commits on block production latency.

The fix prevents ErrFutureBlock by only committing after the deadline, but also defers all full-block commits (the various shouldCommit cases in processTxnSlice) until that deadline. Confirm this won’t harm throughput under load by reviewing those early-commit triggers (e.g. overflow, fork, L1 message logic) and monitoring block production latency metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants