-
Notifications
You must be signed in to change notification settings - Fork 148
Cross-chain messaging tutorial #682
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 WalkthroughWalkthroughA new tutorial titled "Messaging" has been introduced to the developer documentation. The tutorial metadata was updated to include this entry, and a comprehensive guide was added, detailing the implementation of cross-chain messaging between contracts on EVM-compatible testnets using ZetaChain’s infrastructure. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SourceContract
participant Gateway
participant ZetaChain UniversalRouter
participant DestinationContract
User->>SourceContract: Initiate depositAndCall()
SourceContract->>Gateway: depositAndCall(payload)
Gateway->>ZetaChain UniversalRouter: Forward message
ZetaChain UniversalRouter->>DestinationContract: onMessageReceive()
DestinationContract->>User: (Optional) Emit event/confirmation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ Finishing Touches🧪 Generate unit tests
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:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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)
src/pages/developers/tutorials/messaging.mdx (2)
40-46: Fix typos in tooling instructions
TypeSCcipt→TypeScript, andforge soldeer updatelooks like a typo (soldeer) that will break the command.-Install TypeSCcipt and Foundry dependencies: +Install TypeScript and Foundry dependencies: - forge soldeer update + forge updateThese corrections prevent reader confusion and copy-paste errors during setup.
88-90: Remove stray back-tick in “Messaging”
Messa\ging` renders incorrectly.-The Messa`ging base contract provides +The Messaging base contract provides
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/pages/developers/tutorials/_meta.json(1 hunks)src/pages/developers/tutorials/messaging.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/messaging.mdx
[grammar] ~40-~40: Ensure spelling is correct
Context: ...in new --project messaging Install TypeSCcipt and Foundry dependencies: cd messa...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 Gitleaks (8.27.2)
src/pages/developers/tutorials/messaging.mdx
361-361: 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. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
src/pages/developers/tutorials/_meta.json (1)
22-26: Entry added correctly; verify front-end ordering requirementsThe new
"messaging"key follows the existing style (lower-case key, title-casedtitle, numericreadTime, concisedescription).
If the tutorials UI relies on a fixed sort order (e.g., array order to drive the sidebar), double-check that inserting this block betweenswapandsolanadoesn’t break any expected sequencing or numbering logic.
Otherwise, nothing blocking here.src/pages/developers/tutorials/messaging.mdx (1)
358-365: False-positive secret detection – keep, but annotateStatic analysis flagged these hexadecimal strings as a “Generic API Key.” They are plainly contract addresses / tx hashes included for illustration, not secrets.
Consider adding a short comment above the JSON snippet to clarify that all values are public test-net data to silence future false positives.No code change required.
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 (5)
src/pages/developers/tutorials/messaging.mdx (5)
40-46: Fix typos and verify the Foundry command
TypeSCcipt➜TypeScriptforge soldeer updatelooks unrecognised; Foundry’s standard commands areforge install,forge update, orforge build. Please double-check.-Install TypeSCcipt and Foundry dependencies: +Install TypeScript and Foundry dependencies: … -cd messaging -yarn -forge soldeer update +cd messaging +yarn +forge update # or forge install <repo> …
88-90: Remove stray back-tick in “Messaging”-The Messa`ging base contract provides built-in access to Gateway and Router, and +The Messaging base contract provides built-in access to Gateway and Router, and
54-58: Guard readers from leaking their private keyStoring a raw private key in a shell variable is convenient but risky—shell history, process listings, or logs can expose it. Recommend guiding users to load it from a
.envfile (git-ignored) or a secrets manager instead.
95-116: Normalise heading levels for handler sections
onMessageReceiveis an H4 (####) whileonMessageRevertandonRevertare H3 (###). Align them for consistent navigation and generated ToC ordering.
34-52: Add language specifiers to fenced blocksPrefix the code fences with
bashorshell(andsoliditywhere applicable) to enable syntax highlighting in MDX/Markdown renderers.```bash npx zetachain new --project messagingimport "@zetachain/standard-contracts/…</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 318086983debd46210e345382cd2e93c817bce22 and 44816819db1dfdce014c495332111799124c3120. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/pages/developers/tutorials/messaging.mdx` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 LanguageTool</summary> <details> <summary>src/pages/developers/tutorials/messaging.mdx</summary> [grammar] ~40-~40: Ensure spelling is correct Context: ...in new --project messaging ``` Install TypeSCcipt and Foundry dependencies: ``` cd messa... (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) </details> </details> <details> <summary>🪛 Gitleaks (8.27.2)</summary> <details> <summary>src/pages/developers/tutorials/messaging.mdx</summary> 361-361: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) </details> </details> </details> <details> <summary>⏰ 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). (1)</summary> * GitHub Check: build </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Summary by CodeRabbit