Skip to content

Conversation

@ranchalp
Copy link
Contributor

@ranchalp ranchalp commented May 23, 2025

Purpose or design rationale of this PR

Fix bug sequencer submission strategy and log commit price

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

  • New Features

    • Added a new metric to track the commit price for batch submissions, improving monitoring capabilities.
  • Bug Fixes

    • Improved validation for batch submission strategies to ensure correct configuration and error handling.
    • Enhanced accuracy of metrics reporting for batch submission fees.

@ranchalp ranchalp requested review from colinlyguo and jonastheis May 23, 2025 08:03
@coderabbitai
Copy link

coderabbitai bot commented May 23, 2025

Warning

Rate limit exceeded

@ranchalp has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 48ce121 and d1a1893.

📒 Files selected for processing (4)
  • rollup/internal/controller/relayer/l1_relayer.go (2 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (8 hunks)
  • rollup/internal/controller/sender/sender.go (3 hunks)
  • rollup/internal/controller/sender/sender_test.go (8 hunks)
## Walkthrough

This update expands the batch submission strategy timeouts in the Layer 2 relayer, introducing additional offset timeout keys and enforcing explicit validation when selecting a strategy. It also adds a new Prometheus metric to track the commit price. The `SendTransaction` method signature was changed to return an additional `blobBaseFee` value, and all call sites were updated accordingly. Minor logging and metrics improvements were made in the relayer's processing logic.

## Changes

| File(s)                                                                                  | Change Summary                                                                                                 |
|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| rollup/internal/controller/relayer/l2_relayer.go                                        | Expanded `bestParams` map with additional timeout keys offset by +20 minutes; explicit batch strategy lookup with error handling; updated `SendTransaction` calls to capture new return value; added metric setting for commit price; minor logging and error handling adjustments. |
| rollup/internal/controller/relayer/l2_relayer_metrics.go                                | Added a new Prometheus gauge metric `rollupL2RelayerCommitPrice` to the metrics struct and initialized it.      |
| rollup/internal/controller/sender/sender.go                                             | Updated `SendTransaction` method signature to return an additional `blobBaseFee` value; updated error returns to `nil` error where appropriate. |
| rollup/internal/controller/sender/sender_test.go                                        | Updated all `SendTransaction` calls in tests to capture the new third return value, ignoring it with `_`.       |
| rollup/internal/controller/relayer/l1_relayer.go                                        | Renamed transaction hash variable from `hash` to `txHash` and updated `SendTransaction` calls to capture three return values. |
| common/version/version.go                                                                | Updated version tag from "v4.5.16" to "v4.5.17".                                                              |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Config
    participant L2Relayer
    participant Sender
    participant Metrics

    Config->>L2Relayer: Provide batch submission timeout
    L2Relayer->>L2Relayer: Lookup batch strategy in bestParams
    alt Timeout invalid
        L2Relayer->>Config: Return error
    else Timeout valid
        L2Relayer->>Sender: SendTransaction(...) returns (txHash, err, blobBaseFee)
        alt Transaction success
            L2Relayer->>Metrics: Set rollupL2RelayerCommitPrice(blobBaseFee)
        end
    end

Possibly related PRs

  • scroll-tech/scroll#1564: Refactors and improves the SendTransaction method and its usage in the sender package, directly related to the signature change and usage updates.
  • scroll-tech/scroll#1659: Extends batch submission timeout keys and adds validation and metrics around the batch submission strategy, building on the same logic modified here.
  • scroll-tech/scroll#1531: Modifies transaction sending and gas price handling in the sender package, related but focusing on gas price adjustment logic.

Suggested reviewers

  • colinlyguo
  • jonastheis
  • Thegaram

Poem

🐇 Hopping through code with a metric in hand,
Timeouts doubled, strategies planned.
Transactions sent with a fee now known,
Commit prices tracked, in logs they're shown.
A rabbit’s work, precise and bright,
Coding through day and into night! ✨


<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIgAxeAAPSAFsIntA4IwGSntsAWYkRHh8LERcKhoieUx6L3wMplZ1Hgp4XNDY9Fpaf0REaXRU9MgAM2S/Ei9qGIII2BJMoLJcvgdC4tLyytmajRhFxlhMUmR4HK9sJQUKfzELjNwjjaKB7ftd6tqMejRex6QBpEIiAsb4PjPJbNIq4NodEgHOBLWzjfA+fAAd2QUIUGCkGHEZTQvhh6mQ4IozGo4UQ3FE8AmDBJXnk1IoAGsYmhkGg4hMkt1cLJ6Uijmg8LAIXiJlScSc4bilNwGrI2ISImgMlIKCUyoCTjISGRINhuLRZn8GEwKLRHqzwhc7czxBgMnzyJjIDq9VhcFrIIbUsasP8lLQxSi7LR8EMMPg4RdKopsLl0Bh5AJ/GgOYCGCc3dJIzxsBRuPhBigcfgUMxePgpAslv4vPAVPBW8L0/RBIMKBJ2535Pgxk3ltk1vlNu8ym18LkBql5ALAbj4EpCYz4DE0u7fpAyAWGIDgaC3ZAlP6O4gNEZ9MZwFAyD3RxKCMQyMoaPQYewuLx+GEURxCkGR5CYJQqFUdQtB0e8TCgdxzl5UM8EIUhyCqGJf0JLgqC9BwnBcJcFEglQ1E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RDZDdTU1S1W1duJiJ1c+L1UAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=scroll-tech/scroll&utm_content=1664):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

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 ae34020 and 4771437.

📒 Files selected for processing (2)
  • rollup/internal/controller/relayer/l2_relayer.go (4 hunks)
  • rollup/internal/controller/relayer/l2_relayer_metrics.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 (34-43)
🪛 golangci-lint (1.64.8)
rollup/internal/controller/relayer/l2_relayer.go

1130-1130: cannot use target (variable of type *big.Int) as float64 value in argument to r.metrics.rollupL2RelayerCommitPrice.Set

(typecheck)

🪛 GitHub Actions: Rollup
rollup/internal/controller/relayer/l2_relayer.go

[error] 1130-1130: Type mismatch error: cannot use target (variable of type *big.Int) as float64 value in argument to r.metrics.rollupL2RelayerCommitPrice.Set

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: tests
🔇 Additional comments (3)
rollup/internal/controller/relayer/l2_relayer_metrics.go (1)

34-34: LGTM! Clean metric addition.

The new rollupL2RelayerCommitPrice metric is properly declared and initialized following the established patterns in the codebase. The naming and help text clearly indicate its purpose for tracking the L2 relayer's submission strategy commit price.

Also applies to: 129-132

rollup/internal/controller/relayer/l2_relayer.go (2)

107-116: Good expansion of batch submission strategies.

The addition of offset timeout keys (adding 20 minutes to account for batch creation time) provides more granular strategy options. The comment clearly explains the rationale, and the parameter values maintain consistency with the original strategies.


155-158: Excellent improvement to strategy validation.

Adding explicit validation when selecting a batch submission strategy prevents potential runtime panics from invalid map access. This defensive programming approach will help catch configuration errors early.

Also applies to: 177-177

@ranchalp ranchalp requested a review from colinlyguo May 23, 2025 08:15
@ranchalp ranchalp added the bump-version Bump the version tag for deployment label May 23, 2025
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 8b5c670 and 48ce121.

📒 Files selected for processing (4)
  • rollup/internal/controller/relayer/l1_relayer.go (2 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (8 hunks)
  • rollup/internal/controller/sender/sender.go (3 hunks)
  • rollup/internal/controller/sender/sender_test.go (8 hunks)
✅ Files skipped from review due to trivial changes (1)
  • rollup/internal/controller/relayer/l1_relayer.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • rollup/internal/controller/relayer/l2_relayer.go
🧰 Additional context used
🪛 golangci-lint (1.64.8)
rollup/internal/controller/sender/sender.go

193-193: not enough return values
have (nil, error)
want ("github.com/scroll-tech/go-ethereum/common".Hash, error, uint64)

(typecheck)


196-196: not enough return values
have (nil, error)
want ("github.com/scroll-tech/go-ethereum/common".Hash, error, uint64)

(typecheck)


203-203: not enough return values
have (nil, error)
want ("github.com/scroll-tech/go-ethereum/common".Hash, error, uint64)

(typecheck)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: tests
🔇 Additional comments (3)
rollup/internal/controller/sender/sender.go (2)

174-174: LGTM: Method signature updated to return blobBaseFee.

The addition of the third return value uint64 (blobBaseFee) aligns with the PR objective to add logging for commit price metrics.


252-252: LGTM: Successful return correctly implements new signature.

The successful return statement properly returns all three values: transaction hash, nil error, and blobBaseFee.

rollup/internal/controller/sender/sender_test.go (1)

190-190: LGTM: Test calls properly updated for new method signature.

All calls to SendTransaction correctly capture the additional blobBaseFee return value using _ to ignore it, which is appropriate for test scenarios that don't need to validate the metric value.

Also applies to: 548-548, 551-551, 592-592, 634-634, 694-694, 764-764, 838-838, 896-896, 899-899

@ranchalp ranchalp requested review from colinlyguo and jonastheis May 23, 2025 08:57
@ranchalp ranchalp merged commit 47b1a03 into develop May 23, 2025
6 checks passed
@ranchalp ranchalp deleted the sequencer-submission-strategy-bugfix branch May 23, 2025 09:02
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 51.72414% with 14 lines in your changes missing coverage. Please review.

Project coverage is 40.90%. Comparing base (ae34020) to head (d1a1893).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
rollup/internal/controller/sender/sender.go 27.27% 8 Missing ⚠️
rollup/internal/controller/relayer/l1_relayer.go 0.00% 3 Missing ⚠️
rollup/internal/controller/relayer/l2_relayer.go 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1664      +/-   ##
===========================================
+ Coverage    40.86%   40.90%   +0.04%     
===========================================
  Files          225      225              
  Lines        18061    18072      +11     
===========================================
+ Hits          7380     7392      +12     
+ Misses        9965     9964       -1     
  Partials       716      716              
Flag Coverage Δ
rollup 49.91% <51.72%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

5 participants