Skip to content

Conversation

colinlyguo
Copy link
Contributor

@colinlyguo colinlyguo commented Jul 7, 2025

Purpose or design rationale of this PR

Support Validium in rollup-relayer.

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:

  • feat: A new feature

Deployment tag versioning

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

  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change

Summary by CodeRabbit

  • New Features

    • Added support for a new "Validium" mode, enabling relayer operation with Validium smart contracts.
    • Introduced configuration option to enable or disable Validium mode.
    • Enhanced batch processing, payload construction, and metrics calculation to support Validium mode.
    • Integrated new ABI for interacting with the Validium contract on ScrollChain.
  • Chores

    • Updated version to v4.5.29.

Copy link

coderabbitai bot commented Jul 7, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

The changes introduce a "validium mode" to the rollup system, affecting batch proposal, relayer logic, configuration, and ABI handling. This includes new ABI definitions for Validium, configuration flags, mode-aware logic in relayer and batch proposer components, and updated utility functions for batch encoding and metadata extraction in validium mode.

Changes

File(s) Change Summary
common/version/version.go Updated version string from "v4.5.27" to "v4.5.29".
rollup/abi/validium_abi.go Added Validium ABI and metadata, with initialization logic for Validium smart contract interaction.
rollup/cmd/rollup_relayer/app/app.go Passed ValidiumMode flag from config to BatchProposer constructor.
rollup/conf/config.json Added "validium_mode" boolean field to relayer config, defaulting to false.
rollup/internal/config/relayer.go Added ValidiumMode boolean field to RelayerConfig struct; removed FinalizeBatchWithoutProofTimeoutSec.
rollup/internal/controller/relayer/l2_relayer.go Added validium ABI field; conditional calldata packing and payload construction for commit/finalize batch; added validium-specific methods; updated genesis batch handling; adjusted batch limits in validium mode.
rollup/internal/controller/watcher/batch_proposer.go Added validiumMode field; updated constructor and batch metrics calculations to use validium mode flag.
rollup/internal/orm/batch.go Passed ValidiumMode flag to GetBatchMetadata in batch insertion logic.
rollup/internal/utils/utils.go Updated CalculateBatchMetrics and GetBatchMetadata signatures to accept validiumMode; added validium batch header encoding and hashing logic.
rollup/internal/controller/watcher/batch_proposer_test.go, bundle_proposer_test.go, proposer_tool.go, tests/rollup_test.go Updated BatchProposer constructor calls to include validiumMode boolean argument in tests and tools.

Sequence Diagram(s)

sequenceDiagram
    participant Config
    participant App
    participant BatchProposer
    participant Relayer
    participant Utils
    participant ValidiumABI

    Config->>App: Provide ValidiumMode flag
    App->>BatchProposer: Initialize with ValidiumMode
    BatchProposer->>Utils: CalculateBatchMetrics(..., validiumMode)
    Relayer->>Utils: GetBatchMetadata(..., validiumMode)
    Relayer->>Relayer: If ValidiumMode, use validium ABI for calldata packing
    Relayer->>ValidiumABI: Pack calldata for commitBatch/finalizeBundle (validium mode)
Loading

Possibly related PRs

  • fix(build): image building #1603: The main PR updates the version tag from "v4.5.27" to "v4.5.29" in common/version/version.go, while the retrieved PR updates the version tag from "v4.4.88" to "v4.4.89` in the same file; both changes are related as they modify the same version tag variable in the same file but represent different version increments.

  • feat(rollup-relayer): support Validium #1693: Both PRs implement Validium support, including identical changes to validium_abi.go, l2_relayer.go, batch_proposer.go, and utility functions with the validiumMode flag, indicating a direct relation.

Suggested labels

bump-version

Suggested reviewers

  • jonastheis
  • georgehao
  • Thegaram
  • zimpha

Poem

A toggle for Validium, now in our code,
With ABIs ready and relayers in mode.
Batch headers encoded with hashes anew,
The relayer and proposer both know what to do!
A hop and a skip, our chain’s future is bright—
Version bumped up, and all systems light!
🐇✨
"""


📜 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 72aa00e and 9e4e9b4.

📒 Files selected for processing (2)
  • common/version/version.go (1 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (12 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • 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 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 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3050ccb and 9297244.

📒 Files selected for processing (9)
  • common/version/version.go (1 hunks)
  • rollup/abi/validium_abi.go (1 hunks)
  • rollup/cmd/rollup_relayer/app/app.go (1 hunks)
  • rollup/conf/config.json (2 hunks)
  • rollup/internal/config/relayer.go (1 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (9 hunks)
  • rollup/internal/controller/watcher/batch_proposer.go (7 hunks)
  • rollup/internal/orm/batch.go (1 hunks)
  • rollup/internal/utils/utils.go (4 hunks)
🧰 Additional context used
🧠 Learnings (6)
rollup/conf/config.json (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1645
File: rollup/proposer-tool-config.json:34-40
Timestamp: 2025-04-15T08:52:44.176Z
Learning: In configuration files like `rollup/proposer-tool-config.json`, placeholders such as `<mainnet read db config>` are intentionally left as-is to be replaced by users with their own configuration values when deploying the tool.
rollup/cmd/rollup_relayer/app/app.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/controller/watcher/batch_proposer.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/orm/batch.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/utils/utils.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/controller/relayer/l2_relayer.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
🧬 Code Graph Analysis (3)
rollup/cmd/rollup_relayer/app/app.go (2)
rollup/internal/config/l2.go (1)
  • L2Config (10-29)
rollup/internal/config/relayer.go (1)
  • RelayerConfig (55-82)
rollup/internal/orm/batch.go (1)
rollup/internal/utils/utils.go (1)
  • GetBatchMetadata (148-207)
rollup/internal/utils/utils.go (2)
rollup/internal/orm/batch.go (2)
  • Batch (22-72)
  • Batch (80-82)
coordinator/internal/types/auth.go (1)
  • Hash (134-141)
⏰ 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). (3)
  • GitHub Check: tests
  • GitHub Check: check
  • GitHub Check: tests
🔇 Additional comments (7)
common/version/version.go (1)

8-8: LGTM: Version bump is correctly implemented.

The version increment from v4.5.27 to v4.5.28 properly reflects the addition of new Validium mode functionality.

rollup/conf/config.json (1)

39-39: LGTM: Well-structured configuration addition.

The validium_mode field is appropriately placed within the relayer configuration and uses a safe default value of false for backward compatibility.

rollup/internal/config/relayer.go (1)

56-57: LGTM: Proper struct field implementation.

The ValidiumMode field is correctly added with appropriate JSON tagging and a clear descriptive comment. The placement at the beginning of the struct is logical for a fundamental operational mode setting.

rollup/cmd/rollup_relayer/app/app.go (1)

111-111: Confirmed: SetValidiumMode Exists on BatchProposer

The SetValidiumMode(validiumMode bool) method is defined in
rollup/internal/controller/watcher/batch_proposer.go:134.
The integration in rollup/cmd/rollup_relayer/app/app.go:111 is correct and can be approved.

rollup/internal/orm/batch.go (1)

288-288: LGTM: Correct function signature alignment.

The addition of metrics.ValidiumMode parameter correctly aligns with the updated GetBatchMetadata function signature that now accepts a validiumMode boolean parameter.

rollup/internal/controller/watcher/batch_proposer.go (1)

35-35: LGTM! Validium mode integration is clean and consistent.

The addition of the validiumMode field with proper initialization and the consistent propagation to all CalculateBatchMetrics calls is well implemented.

Also applies to: 67-68, 133-137, 181-181, 297-297, 322-322, 332-332

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

1017-1019: Confirm EndBlockHash usage as validium commitment

We weren’t able to locate any in-repo documentation or examples that define how the commitment should be derived for validium mode. The code currently does:

lastChunk := lastBatch.Chunks[len(lastBatch.Chunks)-1]
commitment := common.HexToHash(lastChunk.EndBlockHash)

Please verify against the official validium protocol specification that using the last chunk’s EndBlockHash here is the correct source for the commitment.

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2025

Codecov Report

Attention: Patch coverage is 20.35928% with 133 lines in your changes missing coverage. Please review.

Project coverage is 39.90%. Comparing base (b7a172a) to head (9e4e9b4).
Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
rollup/internal/controller/relayer/l2_relayer.go 24.75% 67 Missing and 9 partials ⚠️
rollup/internal/utils/utils.go 0.00% 54 Missing ⚠️
rollup/cmd/rollup_relayer/app/app.go 0.00% 1 Missing ⚠️
...llup/internal/controller/watcher/batch_proposer.go 85.71% 1 Missing ⚠️
...ollup/internal/controller/watcher/proposer_tool.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1693      +/-   ##
===========================================
+ Coverage    39.86%   39.90%   +0.03%     
===========================================
  Files          236      233       -3     
  Lines        18808    18373     -435     
===========================================
- Hits          7498     7331     -167     
+ Misses       10575    10333     -242     
+ Partials       735      709      -26     
Flag Coverage Δ
rollup 45.47% <20.35%> (-0.86%) ⬇️

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.

Thegaram
Thegaram previously approved these changes Jul 7, 2025
Co-authored-by: Péter Garamvölgyi <[email protected]>
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: 0

🧹 Nitpick comments (1)
rollup/internal/controller/relayer/l2_relayer.go (1)

984-1027: Consider the validium commitment strategy and batch processing differences.

The function correctly implements validium-specific logic:

  • Uses last block hash as commitment (acknowledged as temporary in TODO)
  • Calculates metrics without processing individual L2 blocks (appropriate for validium)
  • Validates batch consistency and codec versions

However, consider if the temporary commitment strategy meets security requirements for your use case.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd00cb4 and f4d6e67.

📒 Files selected for processing (9)
  • rollup/abi/validium_abi.go (1 hunks)
  • rollup/cmd/rollup_relayer/app/app.go (1 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (9 hunks)
  • rollup/internal/controller/watcher/batch_proposer.go (7 hunks)
  • rollup/internal/controller/watcher/batch_proposer_test.go (4 hunks)
  • rollup/internal/controller/watcher/bundle_proposer_test.go (1 hunks)
  • rollup/internal/controller/watcher/proposer_tool.go (1 hunks)
  • rollup/internal/utils/utils.go (4 hunks)
  • rollup/tests/rollup_test.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • rollup/cmd/rollup_relayer/app/app.go
  • rollup/internal/controller/watcher/batch_proposer.go
  • rollup/internal/utils/utils.go
  • rollup/abi/validium_abi.go
🧰 Additional context used
🧠 Learnings (5)
rollup/internal/controller/watcher/proposer_tool.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/tests/rollup_test.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/controller/watcher/bundle_proposer_test.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/controller/watcher/batch_proposer_test.go (1)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
rollup/internal/controller/relayer/l2_relayer.go (2)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1693
File: rollup/abi/validium_abi.go:13-15
Timestamp: 2025-07-07T12:02:52.191Z
Learning: In the Scroll codebase, ABI initialization in files like bridge_abi.go and validium_abi.go follows a consistent pattern of ignoring errors from GetAbi() in init functions to maintain code style consistency across the project.
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
⏰ 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). (3)
  • GitHub Check: tests
  • GitHub Check: check
  • GitHub Check: tests
🔇 Additional comments (10)
rollup/internal/controller/watcher/proposer_tool.go (1)

128-128: LGTM: Constructor update is consistent with validium mode support.

The addition of the false /* rollup mode */ parameter aligns with the BatchProposer constructor signature update to support both rollup and validium modes.

rollup/internal/controller/watcher/bundle_proposer_test.go (1)

106-106: LGTM: Test constructor update is correct.

The test correctly specifies rollup mode with the false /* rollup mode */ parameter, which is appropriate for general batch proposer testing.

rollup/tests/rollup_test.go (1)

131-131: LGTM: Test constructor update maintains existing behavior.

The explicit false /* rollup mode */ parameter ensures the test continues to use rollup mode as expected.

rollup/internal/controller/watcher/batch_proposer_test.go (1)

103-103: LGTM: Consistent test constructor updates across all test functions.

All test functions correctly add the false /* rollup mode */ parameter to maintain existing rollup mode behavior in tests.

Also applies to: 181-181, 249-249, 338-338

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

82-82: LGTM: ValidiumABI field addition and initialization.

The validiumABI field is properly added and initialized from the bridgeAbi package, following the same pattern as the existing l1RollupABI.

Also applies to: 176-176


279-296: LGTM: Genesis batch commitment logic branches correctly for validium mode.

The conditional logic properly handles both rollup and validium modes:

  • Validium mode: Only passes batchHeader to importGenesisBatch
  • Rollup mode: Passes both batchHeader and stateRoot
  • Logging appropriately identifies the mode being used

Also applies to: 303-303, 328-328


484-496: LGTM: Batch processing correctly branches based on validium mode.

The ProcessPendingBatches function properly calls different payload construction methods based on the validium mode flag, with appropriate error handling for each path.


716-726: LGTM: Bundle finalization correctly branches based on validium mode.

The finalizeBundle function appropriately calls different payload construction methods for validium vs rollup modes with proper error handling.


1045-1045: LGTM: Added logging for rollup mode finalization.

The logging addition provides useful visibility into the rollup mode finalization process, mirroring the logging added for validium mode.


1061-1078: Validium finalizeBundle always requires aggProof

I compared both implementations and confirmed:

  • In rollup mode (constructFinalizeBundlePayloadCodecV7), a nil aggProof falls back to finalizeBundlePostEuclidV2NoProof.
  • In validium mode (constructFinalizeBundlePayloadValidium), a nil aggProof returns an error (lines 1064–1066).
  • There are no test-bypass flags or special branches for validium mode.

This behavior is intentional: validium finalization cannot proceed without a proof. If you need proof-less finalization in test environments, add a nil-proof branch similar to the rollup version.

@colinlyguo colinlyguo force-pushed the validium-devnet-wip branch from a398f64 to 7dfb8b5 Compare July 7, 2025 21:01
zimpha
zimpha previously approved these changes Jul 8, 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: 0

🧹 Nitpick comments (1)
rollup/internal/controller/relayer/l2_relayer.go (1)

1000-1027: LGTM: Correct validium batch payload construction with follow-up needed.

The method correctly constructs the validium batch payload with proper metrics calculation and ABI packing. However, the TODO comment on lines 1013-1013 indicates the commitment calculation is temporary and may need future enhancement.

Would you like me to help track this TODO item by opening a new issue to address the commitment calculation enhancement?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90282fc and 72aa00e.

📒 Files selected for processing (2)
  • rollup/cmd/rollup_relayer/app/app.go (1 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (12 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • rollup/cmd/rollup_relayer/app/app.go
🧰 Additional context used
🧠 Learnings (1)
rollup/internal/controller/relayer/l2_relayer.go (2)
Learnt from: colinlyguo
PR: scroll-tech/scroll#1693
File: rollup/abi/validium_abi.go:13-15
Timestamp: 2025-07-07T12:02:52.214Z
Learning: In the Scroll codebase, ABI initialization in files like bridge_abi.go and validium_abi.go follows a consistent pattern of ignoring errors from GetAbi() in init functions to maintain code style consistency across the project.
Learnt from: colinlyguo
PR: scroll-tech/scroll#1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
⏰ 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). (3)
  • GitHub Check: check
  • GitHub Check: tests
  • GitHub Check: tests
🔇 Additional comments (9)
rollup/internal/controller/relayer/l2_relayer.go (9)

82-82: LGTM: Clean addition of validium ABI field.

The new validiumABI field follows the same pattern as the existing l1RollupABI field and properly supports the validium mode functionality.


176-176: LGTM: Proper ABI initialization.

The initialization follows the established pattern and correctly assigns the ValidiumABI from the bridge ABI package.


244-248: LGTM: Proper batch creation updates for validium support.

The addition of the Blocks field and the inclusion of ValidiumMode in BatchMetrics correctly propagates the validium mode information through the batch creation process.


280-297: LGTM: Well-structured mode-aware genesis batch commitment.

The branching logic correctly handles the different requirements for validium and rollup modes, with appropriate error handling and logging for both cases.


557-562: LGTM: Correct batch limit enforcement for validium mode.

The method properly enforces single batch submission for validium mode while preserving existing behavior for rollup mode, addressing the architectural requirements.


341-342: LGTM: Proper batch processing logic for validium mode.

The integration of getEffectiveBatchLimits and the mode-aware payload construction correctly implements the validium requirements while maintaining existing rollup functionality.

Also applies to: 488-504


732-742: LGTM: Consistent finalize bundle payload construction.

The mode-aware branching for finalize bundle payload construction follows the established pattern and correctly handles both validium and rollup modes.


1061-1079: LGTM: Robust validium finalize bundle implementation.

The method correctly handles the nil proof case and properly constructs the validium finalize bundle payload. The previous nil pointer issue has been addressed.


304-304: LGTM: Enhanced logging for better observability.

The logging updates provide valuable debugging information and help distinguish between validium and rollup mode operations, improving system observability.

Also applies to: 329-329, 1045-1046, 1062-1062

Thegaram
Thegaram previously approved these changes Jul 9, 2025
georgehao
georgehao previously approved these changes Jul 9, 2025
@colinlyguo colinlyguo dismissed stale reviews from georgehao and Thegaram via de67222 July 9, 2025 07:02
@georgehao georgehao merged commit 4233ad9 into develop Jul 9, 2025
5 checks passed
@georgehao georgehao deleted the validium-devnet-wip branch July 9, 2025 07:02
@coderabbitai coderabbitai bot mentioned this pull request Aug 11, 2025
3 tasks
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.

5 participants