Skip to content

Conversation

jonastheis
Copy link
Contributor

@jonastheis jonastheis commented Oct 2, 2025

Purpose or design rationale of this PR

Adds more dynamic blob submission.

backlogCount >= backlog_max: submit min_batches for fast inclusion at slightly higher price.
backlogCount < backlog_max: submit max_batches for better cost amortization.

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:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Bug Fixes

    • Improved batch submission logic to be backlog-aware, reducing overload during high traffic and enhancing stability and throughput consistency.
  • Chores

    • Bumped version to v4.5.48.

@jonastheis jonastheis added the bump-version Bump the version tag for deployment label Oct 2, 2025
Copy link

coderabbitai bot commented Oct 2, 2025

Walkthrough

Updates version tag to v4.5.48. Modifies Layer2Relayer to compute backlog-aware batch submission limits by fetching failed/pending backlog count, recording a metric, and passing backlogCount to a revised getEffectiveBatchLimits method.

Changes

Cohort / File(s) Summary
Version bump
common/version/version.go
Increment tag from "v4.5.47" to "v4.5.48"; Version string updates accordingly.
Relayer backlog-aware limits
rollup/internal/controller/relayer/l2_relayer.go
ProcessPendingBatches now retrieves backlogCount via batchOrm.GetFailedAndPendingBatchesCount, records metric, and calls getEffectiveBatchLimits(backlogCount). getEffectiveBatchLimits signature changed to accept backlogCount and returns min/max batches based on backlog size and ValidiumMode.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant R as Layer2Relayer
  participant O as BatchOrm
  participant M as Metrics
  participant S as Submitter

  rect rgba(230,245,255,0.4)
  note over R: ProcessPendingBatches
  R->>O: GetFailedAndPendingBatchesCount()
  O-->>R: backlogCount
  R->>M: Record backlogCount metric
  R->>R: getEffectiveBatchLimits(backlogCount)
  R-->>R: (minBatches, maxBatches)
  end

  alt ValidiumMode
    note right of R: Limits forced to (1,1)
  else Backlog >= BacklogMax
    note right of R: Limits -> (MinBatches, MinBatches)
  else Backlog < BacklogMax
    note right of R: Limits -> (MaxBatches, MaxBatches)
  end

  R->>S: Select & submit batches within limits
  S-->>R: Result (success/failure)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • colinlyguo
  • georgehao
  • Thegaram

Poem

I twitch my whiskers at backlog’s gate,
Count the queues, set limits straight.
One hop forward, batches align—
Min or max, by backlog’s sign.
Tagged anew, v4.5.48—
A carrot crisp, the release tastes great! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly identifies the primary change as a new feature in the L2 relayer that adjusts batch submission based on backlog size, and it follows the conventional commits format with a concise scope and description. It accurately reflects the main functionality introduced in the changeset without extraneous details or vagueness. The phrasing is specific and immediately understandable by a teammate reviewing the history.
Description Check ✅ Passed The pull request description adheres to the repository template by including a detailed Purpose section and the required checklist items for PR title type, deployment tag versioning, and breaking change label, all of which are correctly marked. It succinctly explains what the PR does and why, matching the structure and information demands of the template. Thus, the description is complete and aligned with repository standards.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/enhance-batch-submission

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7fdf48 and 3d1cc45.

📒 Files selected for processing (2)
  • common/version/version.go (1 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
rollup/internal/controller/relayer/l2_relayer.go (1)
rollup/internal/config/relayer.go (1)
  • BatchSubmission (40-49)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-version Bump the version tag for deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants