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

Fixes: ETH Deposit Tutorial #1250

Merged
merged 4 commits into from
Jan 16, 2025
Merged

Fixes: ETH Deposit Tutorial #1250

merged 4 commits into from
Jan 16, 2025

Conversation

krofax
Copy link
Collaborator

@krofax krofax commented Jan 16, 2025

Overview

This PR addresses technical inaccuracies and code issues in the ETH-Viem deposit tutorial docs.

Changes Made

1. Contract Reference Correction

  • Updated misleading description about L1StandardBridge contract usage
  • Clarified that the deposit process uses OptimismPortalProxy directly
  • Previous text incorrectly suggested ETH deposits went through L1StandardBridge

2. Code Example Fix

  • Fixed incorrect parameter in waitForTransactionReceipt function
  • Changed from:
  const depositReceipt = await publicClientL1.waitForTransactionReceipt({ depositHash });

To

const depositReceipt = await publicClientL1.waitForTransactionReceipt({ hash: depositHash });

This resolves the BigInt conversion error users were encountering

@krofax krofax requested a review from a team as a code owner January 16, 2025 14:43
Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for docs-optimism ready!

Name Link
🔨 Latest commit cc430a6
🔍 Latest deploy log https://app.netlify.com/sites/docs-optimism/deploys/67892a4649ea000008792095
😎 Deploy Preview https://deploy-preview-1250--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 16, 2025

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the documentation and code related to bridging ETH from Layer 1 (L1) to Layer 2 (L2) using Viem. The primary change involves updating the contract reference from L1StandardBridge to OptimismPortalProxy in the tutorial documentation, which clarifies the deposit process. Additionally, in the JavaScript file, the parameter name for the transaction hash has been changed from depositHash to hash in the waitForTransactionReceipt method, ensuring consistency across the deposit and withdrawal functions. Other documents have undergone formatting adjustments, primarily for improved readability, without altering the underlying content or functionality.

Assessment against linked issues

Objective Addressed Explanation
Update contract description from L1StandardBridge
Fix transaction receipt retrieval error

Possibly related PRs

  • Updated Triggering OP Mainnet Transactions Tutorial #936: The changes in the tutorial for triggering transactions on OP Stack from Ethereum involve updates to the deposit process, which is related to the changes made in the main PR regarding the deposit process using different smart contracts.
  • Add ETH and ERC-20 transfer clarification #930: This PR adds clarification about the secure transfer of ETH and ERC-20 tokens across L2s, which aligns with the main PR's focus on modifying the smart contract reference for depositing ETH.
  • Suggested Docs fixes #1251: This PR includes updates to the documentation regarding deposit transactions, which is directly related to the changes made in the main PR regarding the deposit process.

Suggested labels

flag:merge-pending-release

Suggested reviewers

  • sbvegan
  • bradleycamacho

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 (1)
public/tutorials/cross-dom-bridge-eth.js (1)

52-52: Parameter update looks good!

The change from depositHash to { hash: depositHash } correctly aligns with Viem's API expectations for the waitForTransactionReceipt method.

Minor: Remove extra semicolon.

There's an extra semicolon at the end of the line that can be removed for consistency.

-const depositReceipt = await publicClientL1.waitForTransactionReceipt({ hash: depositHash });;
+const depositReceipt = await publicClientL1.waitForTransactionReceipt({ hash: depositHash });
🧰 Tools
🪛 eslint

[error] 52-52: Extra semicolon.

(semi)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0de34bd and 26618ad.

📒 Files selected for processing (2)
  • pages/builders/app-developers/tutorials/cross-dom-bridge-eth.mdx (3 hunks)
  • public/tutorials/cross-dom-bridge-eth.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
pages/builders/app-developers/tutorials/cross-dom-bridge-eth.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.
    "
🪛 eslint
public/tutorials/cross-dom-bridge-eth.js

[error] 52-52: Extra semicolon.

(semi)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - docs-optimism
  • GitHub Check: Header rules - docs-optimism
  • GitHub Check: Pages changed - docs-optimism
  • GitHub Check: pr-workflow
🔇 Additional comments (2)
pages/builders/app-developers/tutorials/cross-dom-bridge-eth.mdx (2)

136-136: Contract reference update is accurate!

The change from L1StandardBridge to OptimismPortalProxy correctly reflects the actual contract used for ETH deposits, improving technical accuracy.


170-170: Code snippet update maintains implementation consistency!

The updated parameter in waitForTransactionReceipt matches the JavaScript implementation, ensuring documentation accuracy.

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/stack/interop/explainer.mdx (2)

23-23: Fix grammatical error in possessive form.

Change "each others'" to "each other's" as it's the correct possessive form.

-Information that comes from other sources is harder to provide in a safe, decentralized, and uncensorable manner (this is called [The Oracle Problem](https://chain.link/education-hub/oracle-problem)).
+Information that comes from other sources is harder to provide in a safe, decentralized, and uncensorable manner (this is called [the Oracle Problem](https://chain.link/education-hub/oracle-problem)).
🧰 Tools
🪛 LanguageTool

[grammar] ~23-~23: Did you mean “other's”?
Context: ...hat lets OP Stack blockchains read each others' state. Interoperability provides the fo...

(EACH_OTHERS)


26-29: Fix bullet point formatting and grammar.

The bullet points need consistent formatting and proper punctuation.

-*   1-block latency asset movement, removing the problem of capital fragmentation leading to better capital efficiency.
-*   Improved experience for both users and developers.
-*   Secure transfer of assets, such as ETH and ERC-20 tokens, across L2s.
-*   Horizontal scalability for applications that need it.
+* One-block latency asset movement, removing the problem of capital fragmentation and leading to better capital efficiency
+* Improved experience for both users and developers
+* Secure transfer of assets, such as ETH and ERC-20 tokens, across L2s
+* Horizontal scalability for applications that need it
pages/stack/interop/security.mdx (2)

28-28: Improve sentence structure.

Reposition "also" for better readability.

-In that case, if the information provided to sequencer is incorrect, of course the blocks posted by the sequencer will be also incorrect.
+In that case, if the information provided to sequencer is incorrect, of course the blocks posted by the sequencer will also be incorrect.
🧰 Tools
🪛 LanguageTool

[style] ~28-~28: To make your writing flow more naturally, try moving ‘also’ before the verb.
Context: ...urse the blocks posted by the sequencer will be also incorrect. In this case, invalid b...

(ALSO_PLACEMENT)


35-35: Fix punctuation and remove redundancy.

Add missing comma and remove redundant "only".

-Normally the blocks that make it to the canonical blockchain are those posted to L1 by the sequencer.
+Normally, the blocks that make it to the canonical blockchain are those posted to L1 by the sequencer.

-A deposit only block only contains the deposit transactions and some internal transactions, not the sequencer transactions.
+A deposit-only block contains the deposit transactions and some internal transactions, not the sequencer transactions.

Also applies to: 45-45

🧰 Tools
🪛 LanguageTool

[typographical] ~35-~35: Consider adding a comma after ‘Normally’ for more clarity.
Context: ...e deposit only blocks? Normally the blocks that make it to the canonica...

(RB_LY_COMMA)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b02221f and cc430a6.

📒 Files selected for processing (5)
  • pages/stack/interop.mdx (1 hunks)
  • pages/stack/interop/explainer.mdx (4 hunks)
  • pages/stack/interop/predeploy.mdx (3 hunks)
  • pages/stack/interop/security.mdx (5 hunks)
  • words.txt (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pages/stack/interop/predeploy.mdx
🧰 Additional context used
📓 Path-based instructions (3)
pages/stack/interop/explainer.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.
    "
pages/stack/interop.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.
    "
pages/stack/interop/security.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.
    "
🪛 LanguageTool
pages/stack/interop/explainer.mdx

[grammar] ~23-~23: Did you mean “other's”?
Context: ...hat lets OP Stack blockchains read each others' state. Interoperability provides the fo...

(EACH_OTHERS)

pages/stack/interop/security.mdx

[style] ~28-~28: To make your writing flow more naturally, try moving ‘also’ before the verb.
Context: ...urse the blocks posted by the sequencer will be also incorrect. In this case, invalid b...

(ALSO_PLACEMENT)


[typographical] ~35-~35: Consider adding a comma after ‘Normally’ for more clarity.
Context: ...e deposit only blocks? Normally the blocks that make it to the canonica...

(RB_LY_COMMA)


[grammar] ~45-~45: Adverb repetition.
Context: ...ored by the sequencer. A deposit only block only contains the deposit transactions and s...

(ADVERB_VERB_ADVERB_REPETITION)

words.txt

[duplication] ~81-~81: Möglicher Tippfehler: ein Wort wird wiederholt
Context: ...AP datacap DATADIR datadir dependencies Devnet devnet devnets devx direnv DISABLETXPOOLGOSSIP...

(GERMAN_WORD_REPEAT_RULE)


[duplication] ~408-~408: Möglicher Tippfehler: ein Wort wird wiederholt
Context: ...etered Unprotect unsubmitted UPNP usafe VERKLE verkle VHOSTS vhosts Viem viem Viem's VMDEBUG ...

(GERMAN_WORD_REPEAT_RULE)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - docs-optimism
  • GitHub Check: Header rules - docs-optimism
  • GitHub Check: Pages changed - docs-optimism
  • GitHub Check: pr-workflow
🔇 Additional comments (1)
pages/stack/interop.mdx (1)

31-33: LGTM! Well-organized card additions.

The new cards for predeploys and security are logically placed and properly formatted.

words.txt Show resolved Hide resolved
@krofax krofax merged commit 3fdf0ec into main Jan 16, 2025
5 of 8 checks passed
@krofax krofax deleted the fix-tut branch January 16, 2025 15:54
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.

[DOCS] Potential errors in "Bridging ETH to OP Mainnet with Viem” - Deposit ETH part
2 participants