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

op-batcher: Support generic DA posting #10489

Conversation

epociask
Copy link
Contributor

@epociask epociask commented May 10, 2024

Description

op-batcher

  • Support DA_SERVICE flag that specifies whether to use precomputed commitments or an alt DA service provider

op-node

  • Remove invariant which enforces that DA commitments must be Keccak256 type

op-plasma

  • Extend daClient to support writing without a precomputed commitment
  • Extend daServer to support both interaction types based on prevalence of commitment query param in URL path
  • Updated daServer with more verbose logging to ease debugging / devnet introspection

devnet

  • Extend docker-compose.yml to use DA_SERVICE flag as per op-node and op-batcher env vars
  • Extend __init__.py to set DA_SERVICE flag in compose environment

Extend

Tests

  • Switched devnet script to use DA_SERVICE=true in compose environment, tests were ran as per commit (6a1ac766a1ac76) and passed for the alternative DA service interaction. See test run here
  • Extend da_client.go tests to assert put/get interactions using generic commitment type

Additional context

Metadata

@epociask epociask changed the title op-batcher: Support generic DA commitment type op-batcher: Support generic DA posting May 13, 2024
@epociask epociask marked this pull request as ready for review May 14, 2024 00:29
@epociask epociask requested review from a team, protolambda and ajsutton as code owners May 14, 2024 00:29
Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

Walkthrough

The changes involve significant updates to the handling of Data Availability (DA) services across multiple components. Key updates include the addition of a new flag for DA service type in the CLI, modifications to the DAClient to handle precomputed commitments, and the removal of commitment type restrictions in PlasmaDataSource. These changes aim to support the new DA server specification and enhance error logging and configuration options.

Changes

Files/Paths Change Summary
bedrock-devnet/devnet/__init__.py Added condition to set PLASMA_DA_SERVICE to 'false' when DEVNET_PLASMA is False.
op-node/rollup/derive/plasma_data_source.go Removed restriction on keccak256 commitments in PlasmaDataSource.
op-node/rollup/derive/plasma_data_source_test.go Changed commitment type variable from Keccak256Commitment to CommitmentData.
op-plasma/cli.go Added daServiceFlag for DA service type and GenericDA field in CLIConfig.
op-plasma/daclient.go Added precompute field in DAClient, updated NewDAClient function, and enhanced SetInput method.
op-plasma/daclient_test.go Renamed TestDAClient to TestDAClientPrecomputed and added TestDAClientService function.
op-plasma/daserver.go Enhanced error logging in HandleGet and HandlePut methods.
ops-bedrock/docker-compose.yml Added --plasma.da-service configuration and corresponding environment variable.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Modify the batcher to use the new put method for DA server (10312)
Add a flag to control the DA server behavior (10312)
Enhance error logging for DA server operations (10312)

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between c5bd125 and 8727f57.
Files selected for processing (2)
  • bedrock-devnet/devnet/init.py (1 hunks)
  • op-plasma/cli.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • op-plasma/cli.go
Additional Context Used
Ruff (6)
bedrock-devnet/devnet/__init__.py (6)

7-7: calendar imported but unused; consider removing, adding to __all__, or using a redundant alias


12-12: gzip imported but unused; consider removing, adding to __all__, or using a redundant alias


18-18: devnet.log_setup imported but unused; consider removing, adding to __all__, or using a redundant alias


221-221: Avoid equality comparisons to False; use if not os.path.exists(l2_allocs_path): for false checks


221-221: Avoid equality comparisons to True; use if DEVNET_FPAC: for truth checks


312-312: Local variable e is assigned to but never used

Additional comments not posted (2)
bedrock-devnet/devnet/__init__.py (2)

276-276: Setting PLASMA_DA_SERVICE to 'false' when DEVNET_PLASMA is true looks good and aligns with the PR objectives.


279-279: Setting PLASMA_DA_SERVICE to 'false' when DEVNET_PLASMA is false ensures consistency and correctness.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
Contributor

@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

op-plasma/cli.go Outdated Show resolved Hide resolved
Copy link
Contributor

@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

Out of diff range and nitpick comments (5)
bedrock-devnet/devnet/__init__.py (5)

Line range hint 7-7: Remove unused import calendar.

-import calendar

Line range hint 12-12: Remove unused import gzip.

-import gzip

Line range hint 18-18: Remove unused import devnet.log_setup.

-import devnet.log_setup

Line range hint 221-221: Avoid equality comparisons to False; use if not os.path.exists(l2_allocs_path): for false checks.

-        if os.path.exists(l2_allocs_path) == False or DEVNET_FPAC == True:
+        if not os.path.exists(l2_allocs_path) or DEVNET_FPAC:

Line range hint 312-312: Local variable e is assigned to but never used. Consider removing it or using it in the logging statement.

-        except Exception as e:
+        except Exception:

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

TY for implementing this

@ajsutton ajsutton enabled auto-merge May 16, 2024 03:31
@ajsutton ajsutton added this pull request to the merge queue May 16, 2024
Merged via the queue into ethereum-optimism:develop with commit db82b31 May 16, 2024
69 checks passed
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.

op-batcher: Use the new DA server spec
4 participants