-
Notifications
You must be signed in to change notification settings - Fork 260
Audit of interop message passing tuturial #1581
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docs-optimism ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThis set of changes focuses on restructuring and clarifying the message-passing tutorial and related code. The tutorial content was reorganized for better usability, consolidating introductory sections into a collapsible "About this tutorial" block and introducing tabbed views to differentiate between Supersim and Devnet environments. Environment variable names were standardized for consistency across all files, affecting contract addresses and private keys. Setup instructions were enhanced, and commands were updated to reflect local execution and the new variable naming scheme. The Solidity contract's import paths were updated to use scoped package imports. In the TypeScript application files, environment variable references were changed to match the new naming convention, and some wallet client extension methods were commented out for clarity. Additionally, the word "Devs" was removed from the word list. No changes were made to the logic or exported interfaces of the code snippets. Sequence Diagram(s)sequenceDiagram
participant User
participant Tutorial
participant Supersim/Devnet
participant Onchain Contract
participant Offchain Relayer
User->>Tutorial: Reads setup instructions (Supersim/Devnet tabs)
User->>Supersim/Devnet: Configures environment (RPC URLs, env vars)
User->>Onchain Contract: Deploys contracts using updated env vars
User->>Onchain Contract: Sends cross-chain message
Note over Onchain Contract: Sleep for 4 seconds (transaction inclusion)
Offchain Relayer->>Onchain Contract: Relays message (manual for Supersim, auto for Devnet)
Onchain Contract->>User: Confirms message receipt
Possibly related PRs
Suggested reviewers
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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 (2)
pages/interop/tutorials/message-passing.mdx (2)
148-148
: Fix duplicate word "the".There's a duplicate "the" in the text: "go to the the directory".
- Set these parameters for Supersim. - - ```sh - PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + Set these parameters for Supersim. + + ```sh + PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80🧰 Tools
🪛 Gitleaks (8.21.2)
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
412-413
: Improved comma usage.There's a comma before "because" that isn't necessary since the clause is essential to the meaning of the sentence.
-If you are using the devnets, skip this section. -You will not be able to see the effects anyway, because you cannot disable autoforwarding on them. +If you are using the devnets, skip this section. +You will not be able to see the effects anyway because you cannot disable autoforwarding on them.🧰 Tools
🪛 LanguageTool
[formatting] ~413-~413: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...ll not be able to see the effects anyway, because you cannot disable autoforwarding on th...(COMMA_BEFORE_BECAUSE)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
pages/interop/tutorials/message-passing.mdx
(14 hunks)public/tutorials/GreetingSender.sol
(2 hunks)public/tutorials/app.mts
(2 hunks)public/tutorials/app_v2.mts
(2 hunks)words.txt
(0 hunks)
💤 Files with no reviewable changes (1)
- words.txt
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.mdx`: "ALWAYS review Markdown content THOROUGHLY with the following criteria: - First, check the frontmatter section at the top of the file: 1. For regular pages, ensure AL...
**/*.mdx
: "ALWAYS review Markdown content THOROUGHLY with the following criteria:
- First, check the frontmatter section at the top of the file:
- For regular pages, ensure ALL these fields are present and not empty:
--- title: [non-empty] lang: [non-empty] description: [non-empty] topic: [non-empty] personas: [non-empty array] categories: [non-empty array] content_type: [valid type] ---
- For landing pages (index.mdx or files with ), only these fields are required:
--- title: [non-empty] lang: [non-empty] description: [non-empty] topic: [non-empty] ---
- If any required fields are missing or empty, comment:
'This file appears to be missing required metadata. Please check keywords.config.yaml for valid options and add the required fields manually. You can validate your changes by running:pnpm validate-metadata ```'
- 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:
- Use sentence case, capitalizing only the first word.
- 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.
- 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/interop/tutorials/message-passing.mdx
🪛 LanguageTool
pages/interop/tutorials/message-passing.mdx
[uncategorized] ~111-~111: “to the” seems less likely than “to”.
Context: ...Supersim, go to the the directory where Supersim is install...
(AI_HYDRA_LEO_CP_TO_THE_TO)
[formatting] ~413-~413: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...ll not be able to see the effects anyway, because you cannot disable autoforwarding on th...
(COMMA_BEFORE_BECAUSE)
🪛 Gitleaks (8.21.2)
pages/interop/tutorials/message-passing.mdx
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ 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 (27)
public/tutorials/GreetingSender.sol (1)
4-5
: Import paths updated to use package references.The import paths have been updated from relative paths to scoped package imports, which is a good practice as it makes dependencies more explicit and easier to maintain.
public/tutorials/app.mts (3)
16-16
: Environment variable name standardized.Updated from
PRIV_KEY
toPRIVATE_KEY
, making variable naming more consistent with common conventions.
31-31
: Environment variable name standardized.Updated from
GREETER_B_ADDR
toGREETER_B_ADDRESS
, improving clarity and consistency.
37-37
: Environment variable name standardized.Updated from
GREETER_A_ADDR
toGREETER_A_ADDRESS
, improving clarity and consistency.public/tutorials/app_v2.mts (6)
9-9
: Import statement formatting improved.Minor formatting improvement with the addition of whitespace.
15-15
: Environment variable name standardized.Updated from
PRIV_KEY
toPRIVATE_KEY
, matching the changes in app.mts for consistency.
23-23
: Wallet extension method commented out.The
.extend(walletActionsL2())
method has been commented out. This appears intentional as part of simplifying the tutorial code.
30-30
: Wallet extension method commented out.The
.extend(publicActionsL2())
method has been commented out. This appears intentional as part of simplifying the tutorial code.
34-34
: Environment variable name standardized.Updated from
GREETER_B_ADDR
toGREETER_B_ADDRESS
, matching the changes in app.mts for consistency.
40-40
: Environment variable name standardized.Updated from
GREETER_A_ADDR
toGREETER_A_ADDRESS
, matching the changes in app.mts for consistency.pages/interop/tutorials/message-passing.mdx (17)
25-25
: Import statement updated for tabbed interface.Added the
Tabs
component import from 'nextra/components' to support the new tabbed interface for different environments.
38-69
: Added collapsible "About this tutorial" section.Great improvement to the documentation structure. The collapsible section provides a clean way to organize prerequisite knowledge, learning objectives, and development environment requirements without cluttering the main tutorial flow.
111-118
: Improved clarity regarding Supersim optionality.Explicitly mentions that Supersim is optional and provides guidance for Devnet users to skip this step.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~111-~111: “to the” seems less likely than “to”.
Context: ...Supersim, go to the the directory where Supersim is install...(AI_HYDRA_LEO_CP_TO_THE_TO)
119-139
: Added tabbed interface for different environments.The tabbed interface clearly separates instructions for Supersim and Devnets environments, making it easier for users to follow the appropriate steps for their chosen environment.
143-166
: Environment setup instructions improved with tabbed interface.Environment variable setup instructions are now clearly separated for Supersim and Devnets, with environment-specific values.
🧰 Tools
🪛 Gitleaks (8.21.2)
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
195-196
: Environment variable name standardized.Updated from
GREETER_B_ADDR
toGREETER_B_ADDRESS
to maintain consistency with the changes in the TypeScript files.
201-230
: Added detailed explanation for deployment command.The added explanation provides valuable context on how the deployment command works, especially useful for beginners unfamiliar with Unix command-line tools.
284-285
: Environment variable name standardized.Updated from
GREETER_A_ADDR
toGREETER_A_ADDRESS
to maintain consistency with the changes in the TypeScript files.
293-297
: Updated commands to use standardized environment variables.Commands updated to use the new environment variable names, maintaining consistency throughout the tutorial.
295-295
: Sleep duration increased.Increased sleep duration from 2 to 4 seconds to account for transaction inclusion delays on both chains, which improves reliability.
299-299
: Updated explanation for sleep command.Clarified that sleep duration needs to account for transaction inclusion in both chains, which helps explain the longer wait time.
380-381
: Environment variable name standardized.Updated the commands to use the new environment variable names, maintaining consistency throughout the tutorial.
389-393
: Updated commands and increased sleep duration.Commands updated to use standardized environment variables and sleep duration increased to 4 seconds for better reliability.
461-461
: Environment variable export command updated.Updated to export the standardized environment variable names.
470-471
: Updated console.log to use standardized environment variables.Console log statements updated to use the new environment variable names.
483-483
: Clarified onchain code linking.Added clearer explanation about linking the compiled versions of the onchain code to the offchain repository.
518-519
: Updated commands and added environment variable export.Commands updated to use standardized environment variables and added export to make variables available in the offchain code.
There was a problem hiding this 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 (5)
pages/interop/tutorials/message-passing.mdx (5)
38-69
: Review of new “About this tutorial” collapsible section
The<details>
block neatly consolidates prerequisites, learning objectives, environment requirements, and tools. Tool names, OS requirements, and list formatting (including the Oxford comma) are consistent.Consider updating the
<summary>
text to Title Case (e.g., “About This Tutorial”) to better match UI control conventions.
77-81
: Link text should use Title Case
Per link style guidelines, convert “message passing explainer” to Title Case:- see the [message passing explainer](/interop/message-passing). + see the [Message Passing Explainer](/interop/message-passing).
111-111
: Typo: duplicate word “the”
There is a repeated “the” in this instruction. Please remove one occurrence:- go to the the directory where Supersim is installed... + go to the directory where Supersim is installed...🧰 Tools
🪛 LanguageTool
[duplication] ~111-~111: Possible typo: you repeated a word.
Context: ...persim](/interop/tools/supersim), go to the the directory where Supersim is installed a...(ENGLISH_WORD_REPEAT_RULE)
147-153
: Reminder: clarifying test private key usage
The tutorial exposesPRIVATE_KEY=0xac0974...
, which is the well-known Foundry test key. Please add a note that this key is for local development only and must never be used with real assets.🧰 Tools
🪛 Gitleaks (8.21.2)
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
412-414
: Comma before “because” in essential clause
Remove the comma before “because” as the clause is essential to the meaning:- You will not be able to see the effects anyway, because you cannot disable autoforwarding on them. + You will not be able to see the effects anyway because you cannot disable autoforwarding on them.🧰 Tools
🪛 LanguageTool
[formatting] ~413-~413: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...ll not be able to see the effects anyway, because you cannot disable autoforwarding on th...(COMMA_BEFORE_BECAUSE)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pages/interop/tutorials/message-passing.mdx
(14 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.mdx`: "ALWAYS review Markdown content THOROUGHLY with the following criteria: - First, check the frontmatter section at the top of the file: 1. For regular pages, ensure AL...
**/*.mdx
: "ALWAYS review Markdown content THOROUGHLY with the following criteria:
- First, check the frontmatter section at the top of the file:
- For regular pages, ensure ALL these fields are present and not empty:
--- title: [non-empty] lang: [non-empty] description: [non-empty] topic: [non-empty] personas: [non-empty array] categories: [non-empty array] content_type: [valid type] ---
- For landing pages (index.mdx or files with ), only these fields are required:
--- title: [non-empty] lang: [non-empty] description: [non-empty] topic: [non-empty] ---
- If any required fields are missing or empty, comment:
'This file appears to be missing required metadata. Please check keywords.config.yaml for valid options and add the required fields manually. You can validate your changes by running:pnpm validate-metadata ```'
- 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:
- Use sentence case, capitalizing only the first word.
- 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.
- 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/interop/tutorials/message-passing.mdx
🪛 LanguageTool
pages/interop/tutorials/message-passing.mdx
[duplication] ~111-~111: Possible typo: you repeated a word.
Context: ...persim](/interop/tools/supersim), go to the the directory where Supersim is installed a...
(ENGLISH_WORD_REPEAT_RULE)
[formatting] ~413-~413: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...ll not be able to see the effects anyway, because you cannot disable autoforwarding on th...
(COMMA_BEFORE_BECAUSE)
🪛 Gitleaks (8.21.2)
pages/interop/tutorials/message-passing.mdx
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ 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 (7)
pages/interop/tutorials/message-passing.mdx (7)
1-23
: Frontmatter completeness and metadata validation
All required frontmatter fields for a tutorial are present and non-empty (title, lang, description, topic, personas, categories, content_type).
25-25
: Import statement addition is correct
ImportingTabs
fromnextra/components
aligns with the new tabbed interface usage later in the tutorial.
88-92
: Installation list consistency
The installation list under the first<Steps>
block uses parallel structure and sentence case correctly. No changes needed.
95-98
: Local Supersim binary invocation
Correctly uses./supersim --version
to reflect the local execution instructions.
112-118
: Clarity of devnets skip instruction
The line “If you are using the devnets, just skip this step.” is clear and concise.
119-139
: Tabbed network configuration
The<Tabs>
component cleanly segregates Supersim and Devnet instructions. Tab titles (“Supersim”, “Devnets”) are in Title Case and match the import.
156-164
: Devnet environment variable section
The Devnet tab correctly updates variable names (PRIVATE_KEY
,USER_ADDRESS
, etc.) and instructs users to derive their address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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
♻️ Duplicate comments (1)
pages/interop/tutorials/message-passing.mdx (1)
71-75
: 🛠️ Refactor suggestionUse sentence case for H3 headings
This heading should follow the sentence-case rule for H3 per the style guide. Change:- ### What You'll Build + ### What you'll build
🧹 Nitpick comments (1)
pages/interop/tutorials/message-passing.mdx (1)
412-414
: Refine skip instruction for devnets
Consider rephrasing to the imperative form and removing pronouns for consistency. For example:Skip this section when using devnets, as autoforwarding cannot be disabled on those networks.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pages/interop/tutorials/message-passing.mdx
(14 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.mdx`: "ALWAYS review Markdown content THOROUGHLY with the following criteria: - First, check the frontmatter section at the top of the file: 1. For regular pages, ensure AL...
**/*.mdx
: "ALWAYS review Markdown content THOROUGHLY with the following criteria:
- First, check the frontmatter section at the top of the file:
- For regular pages, ensure ALL these fields are present and not empty:
--- title: [non-empty] lang: [non-empty] description: [non-empty] topic: [non-empty] personas: [non-empty array] categories: [non-empty array] content_type: [valid type] ---
- For landing pages (index.mdx or files with ), only these fields are required:
--- title: [non-empty] lang: [non-empty] description: [non-empty] topic: [non-empty] ---
- If any required fields are missing or empty, comment:
'This file appears to be missing required metadata. Please check keywords.config.yaml for valid options and add the required fields manually. You can validate your changes by running:pnpm validate-metadata ```'
- 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:
- Use sentence case, capitalizing only the first word.
- 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.
- 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/interop/tutorials/message-passing.mdx
🪛 Gitleaks (8.21.2)
pages/interop/tutorials/message-passing.mdx
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ 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 (11)
pages/interop/tutorials/message-passing.mdx (11)
25-25
: Import Tabs for multi-environment instructions
Good catch adding theTabs
component import to support switching between Supersim and Devnets.
38-69
: Add collapsible 'About this tutorial' section
The new<details>
block cleanly consolidates prerequisites, learning goals, environment setup, and tools. Headings and list items follow sentence case and use proper nouns correctly. This improves scannability and aligns with other tutorials’ structure.
90-92
: Installation bullets are clear and accurate
The bullet points for Foundry and Supersim requirements are concise and follow sentence case. Nice work clarifying the optional Supersim dependency.
97-97
: Prefix Supersim command with local invocation
Updating to./supersim --version
ensures users run the local binary explicitly. This resolves common path issues.
111-118
: Clarify Supersim vs Devnet startup
The instructions now correctly differentiate starting Supersim with autorelay and skipping that step on devnets. The prose is clear and actionable.
119-139
: Implement tabbed views for network configurations
Using<Tabs>
to separate Supersim and Devnets tables improves readability. Tab names are in title case, tables are well formatted, and links point to the correct endpoints.
143-153
: Standardize environment variable snippets
The Supersim and Devnet export examples now use consistent variable names (PRIVATE_KEY
,USER_ADDRESS
,URL_CHAIN_A/B
,INTEROP_BRIDGE
). This matches the tutorial’s updated naming convention and avoids confusion.Also applies to: 156-165
🧰 Tools
🪛 Gitleaks (8.21.2)
148-148: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
195-198
: Update deployment environment variable name
Renaming toGREETER_B_ADDRESS
aligns with the new naming scheme and replaces any legacyGREETER_B_ADDR
references.
293-296
: Increase sleep duration for reliability
Updatingsleep
from 2 to 4 seconds accounts for cross-chain inclusion delays on both chains. The explanation below correctly describes the reason.
461-461
: Export updated offchain environment variables
IncludingGREETER_A_ADDRESS
,GREETER_B_ADDRESS
, andPRIVATE_KEY
ensures the Node process has access to all required values.
483-488
: Add symlink instructions for onchain ABIs
Linking the compiled JSON artifacts into the offchain repo is clear and accurate. Theln -s
commands reflect the expected project structure.
Description
Various minor updates to conform to the standard in other tutorials, such as having a collapsible "about this tutorial" and running on the devnets as well as Supersim.
Tests
N/A
Additional context
N/A
Metadata
N/A