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

Add op-deployer flow to OP Stack genesis creation #1302

Merged

Conversation

richardgreg
Copy link
Contributor

Description

  1. New op-deployer flow added

    • Instructions on how to generate genesis.json and rollup.json using op-deployer (op-deployer inspect genesis / op-deployer inspect rollup).
  2. Legacy foundry-based flow moved to the bottom

Metadata

Include a link to any github issues that this may close in the following form:

@richardgreg richardgreg requested a review from a team as a code owner January 29, 2025 18:53
Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for docs-optimism ready!

Name Link
🔨 Latest commit cc6471e
🔍 Latest deploy log https://app.netlify.com/sites/docs-optimism/deploys/679b5b70c9d8590008f87f74
😎 Deploy Preview https://deploy-preview-1302--docs-optimism.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

coderabbitai bot commented Jan 29, 2025

Warning

Rate limit exceeded

@krofax has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 51 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 d0731c5 and cc6471e.

📒 Files selected for processing (1)
  • pages/builders/chain-operators/deploy/genesis.mdx (1 hunks)
📝 Walkthrough

Walkthrough

The documentation for creating genesis files in the OP Stack has been comprehensively updated to recommend using the op-deployer tool. The changes introduce a new, streamlined process for creating genesis and rollup configuration files, replacing the previous legacy method. The updated guidance outlines a three-step workflow: deploying L1 contracts, generating L2 genesis and rollup configuration files, and initializing off-chain components. The document now emphasizes the op-deployer as the preferred method for genesis file creation, with the legacy foundry-script-based approach retained for historical context but no longer recommended for production use.

Assessment against linked issues

Objective Addressed Explanation
Rewrite to use op-deployer for genesis file generation [#993]
Update flow from L1 contract deployment to off-chain components [#993]
Add appropriate metadata and tags [#993] Metadata and tags not explicitly shown in the summary

Possibly related issues

Possibly related PRs

Suggested reviewers

  • sbvegan

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>, please review it.
    • 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 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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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. (Beta)
  • @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.

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

🧹 Nitpick comments (4)
pages/builders/chain-operators/deploy/genesis.mdx (4)

12-12: Use consistent emphasis styling

The line mixes markdown bold syntax (**) with HTML strong tags (<strong>). Use markdown syntax consistently for better maintainability.

-This page has been **updated** to use <strong>op-deployer</strong> for genesis file creation. The foundry-script-based method (described below as "legacy") is no longer recommended for production.
+This page has been **updated** to use **op-deployer** for genesis file creation. The foundry-script-based method (described below as "legacy") is no longer recommended for production.

28-29: Enhance command example clarity

Add explanatory comments for the placeholder values to improve user understanding.

-   op-deployer init --l1-chain-id <YOUR_L1_CHAIN_ID> --l2-chain-ids <YOUR_L2_CHAIN_ID> --workdir .deployer
+   # Initialize deployer with your chain IDs
+   # Example: --l1-chain-id 5 for Goerli, --l2-chain-ids 42069 for your L2
+   op-deployer init \
+     --l1-chain-id <YOUR_L1_CHAIN_ID> \
+     --l2-chain-ids <YOUR_L2_CHAIN_ID> \
+     --workdir .deployer

62-64: Fix list numbering in Step 3

The numbered list uses repeated "1." instead of sequential numbers.

-1. Initialize op-geth using genesis.json.
-1. Configure op-node with rollup.json.
-1. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/builders/chain-operators/architecture).
+1. Initialize op-geth using genesis.json.
+2. Configure op-node with rollup.json.
+3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/builders/chain-operators/architecture).

36-39: Add parameter descriptions for deploy command

Enhance the command example with descriptions of the required parameters.

-op-deployer apply --workdir .deployer \
-  --l1-rpc-url <RPC_URL_FOR_L1> \
-  --private-key <DEPLOYER_PRIVATE_KEY_HEX>
+# Deploy L1 contracts
+op-deployer apply --workdir .deployer \
+  --l1-rpc-url <RPC_URL_FOR_L1>     # Your L1 node endpoint (e.g., Goerli RPC URL)
+  --private-key <DEPLOYER_PRIVATE_KEY_HEX>  # Private key with sufficient ETH for deployment
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7fb64 and 47b847d.

📒 Files selected for processing (1)
  • pages/builders/chain-operators/deploy/genesis.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
pages/builders/chain-operators/deploy/genesis.mdx (1)

Pattern **/*.mdx: "ALWAYS review Markdown content THOROUGHLY with the following criteria:

  • Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
  • Avoid gender-specific language and use the imperative form.
  • Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
  • Ensure proper nouns are capitalized in sentences.
  • Apply the Oxford comma.
  • Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
  • Use correct spelling and grammar at all times (IMPORTANT).
  • For H1, H2, and H3 headers:
    1. Use sentence case, capitalizing only the first word.
    2. Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
    3. Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
  • Flag any headers that seem to inconsistently apply these rules for manual review.
  • When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
    "
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - docs-optimism
  • GitHub Check: Header rules - docs-optimism
  • GitHub Check: Pages changed - docs-optimism
🔇 Additional comments (2)
pages/builders/chain-operators/deploy/genesis.mdx (2)

15-20: Well-structured overview section

The overview provides clear, concise steps with proper linking and consistent formatting.


66-66: Clear legacy section demarcation

The legacy method is properly marked and positioned at the end of the document, making it clear that it's not the recommended approach.

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

🧹 Nitpick comments (4)
pages/builders/chain-operators/deploy/genesis.mdx (4)

11-24: Enhance clarity in the introduction section.

Consider these improvements for better clarity and consistency:

  • Line 12: Add "the" before op-deployer for better flow
  • Line 16: Consider rephrasing to "The op-deployer tool streamlines the creation of..."
  • Line 21: Remove redundant "using" as it's already mentioned in the link text
-The recommended way to generate genesis and rollup configuration files is using `op-deployer`.
+The recommended way to generate genesis and rollup configuration files is to use the `op-deployer`.

-The `op-deployer` tool simplifies the creation of genesis and rollup configuration files
+The `op-deployer` tool streamlines the creation of genesis and rollup configuration files

-1. **Deploy the L1 contracts** using [op-deployer](/builders/chain-operators/tools/op-deployer).
+1. **Deploy the L1 contracts** with [op-deployer](/builders/chain-operators/tools/op-deployer).

27-39: Improve formatting consistency in prerequisites.

The prerequisites section needs consistent formatting:

  • Line 31: The second instruction should be on a new line
  • Line 36: Excessive indentation in the note about chain IDs
-After installation, extract the `op-deployer` into your `PATH` and `cd op-deployer`.
+After installation:
+1. Extract the `op-deployer` into your `PATH`
+2. Run `cd op-deployer`

-    Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).
+Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).

51-54: Standardize bullet point formatting and capitalize technical terms.

Improve consistency in formatting and capitalization:

  • Use consistent capitalization for technical terms
  • Standardize bullet point formatting
-* Reads your intent file in `.deployer/.`
-* Deploys the OP Stack contracts to the specified L1.
-* Updates a local `state.json` file with the results of the deployment.
+* Reads your intent file in `.deployer/`
+* Deploys the OP Stack contracts to the specified L1
+* Updates a local `state.json` file with the results of the deployment

-* genesis.json is the file you will provide to your execution client (e.g. op-geth).
-* rollup.json is the file you will provide to your consensus client (e.g. op-node).
+* `genesis.json` is the file you will provide to your execution client (e.g., `op-geth`)
+* `rollup.json` is the file you will provide to your consensus client (e.g., `op-node`)

Also applies to: 63-64


70-72: Standardize initialization steps formatting.

Improve consistency in technical term formatting:

-1. Initialize op-geth using genesis.json.
-2. Configure op-node with rollup.json.
+1. Initialize `op-geth` using `genesis.json`
+2. Configure `op-node` with `rollup.json`
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47b847d and d0731c5.

📒 Files selected for processing (1)
  • pages/builders/chain-operators/deploy/genesis.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
pages/builders/chain-operators/deploy/genesis.mdx (1)

Pattern **/*.mdx: "ALWAYS review Markdown content THOROUGHLY with the following criteria:

  • Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
  • Avoid gender-specific language and use the imperative form.
  • Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
  • Ensure proper nouns are capitalized in sentences.
  • Apply the Oxford comma.
  • Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
  • Use correct spelling and grammar at all times (IMPORTANT).
  • For H1, H2, and H3 headers:
    1. Use sentence case, capitalizing only the first word.
    2. Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
    3. Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
  • Flag any headers that seem to inconsistently apply these rules for manual review.
  • When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
    "
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - docs-optimism
  • GitHub Check: Header rules - docs-optimism
  • GitHub Check: Pages changed - docs-optimism
🔇 Additional comments (1)
pages/builders/chain-operators/deploy/genesis.mdx (1)

84-94: Legacy section is well-structured and clearly marked.

The legacy method is appropriately separated and marked with a clear warning callout.

pages/builders/chain-operators/deploy/genesis.mdx Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@krofax krofax merged commit 5f16660 into ethereum-optimism:main Jan 30, 2025
4 checks passed
@krofax
Copy link
Collaborator

krofax commented Jan 30, 2025

@richardgreg Thanks for pulling this.
I made a small update and merged it.
It compliments this PR

@richardgreg
Copy link
Contributor Author

Thanks, @krofax

@coderabbitai coderabbitai bot mentioned this pull request Feb 5, 2025
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.

[2024 Q4 Audit] builders/chain-operators/deploy/genesis.mdx
2 participants