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

CCTX tracking doc #530

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

CCTX tracking doc #530

wants to merge 3 commits into from

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Jan 10, 2025

This doc helps developers understand how CCTXs can be tracked.

Summary by CodeRabbit

  • Documentation
    • Added a new section on Cross-Chain Transactions (CCTXs) in the developer documentation
    • Explained types of cross-chain transactions (incoming and outgoing)
    • Provided detailed guidance on tracking and understanding cross-chain transaction mechanics
    • Included examples of cross-chain transaction scenarios and API interactions

Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview Jan 14, 2025 6:21pm

Copy link
Contributor

coderabbitai bot commented Jan 10, 2025

📝 Walkthrough

Walkthrough

The pull request introduces documentation for Cross-Chain Transactions (CCTXs) in the ZetaChain developer documentation. A new metadata entry has been added to the JSON configuration, and a comprehensive Markdown file has been created to explain the intricacies of cross-chain transaction mechanics, including their types, tracking methods, and potential scenarios such as transaction flows between different blockchain networks.

Changes

File Change Summary
src/pages/developers/evm/_meta.json Added new "cctx" section with title and description for Cross-Chain Transactions
src/pages/developers/evm/cctx.mdx Created new documentation file detailing cross-chain transaction types, processes, examples, and transaction tracking mechanisms

Sequence Diagram

sequenceDiagram
    participant User
    participant SourceChain
    participant ZetaChain
    participant DestinationChain

    User->>SourceChain: Initiate Cross-Chain Transaction
    SourceChain->>ZetaChain: Inbound Transaction
    ZetaChain->>DestinationChain: Outbound Transaction
    DestinationChain-->>ZetaChain: Transaction Confirmation
    ZetaChain-->>User: CCTX Tracking Information
Loading

This sequence diagram illustrates the high-level flow of a cross-chain transaction, demonstrating how a transaction moves from the source chain through ZetaChain to the destination chain, with tracking capabilities throughout the process.


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.

CodeRabbit Configuration 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.

@fadeev fadeev marked this pull request as ready for review January 15, 2025 12:33
@fadeev fadeev requested a review from a team as a code owner January 15, 2025 12:33
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 (5)
src/pages/developers/evm/_meta.json (1)

18-21: Enhance the description for better clarity.

The description currently repeats the title. Consider expanding it to better describe the purpose, such as "Learn how to track and monitor cross-chain transactions".

  "cctx": {
    "title": "Cross-Chain Transactions",
-    "description": "Cross-Chain Transactions"
+    "description": "Learn how to track and monitor cross-chain transactions"
  },
src/pages/developers/evm/cctx.mdx (4)

1-24: Address grammatical issues in the introduction.

The content is technically accurate, but there are a few grammatical issues to address:

- the first CCTX hash can be used as a inbound hash
+ the first CCTX hash can be used as an inbound hash
🧰 Tools
🪛 LanguageTool

[misspelling] ~23-~23: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ng), the first CCTX hash can be used as a inbound hash to get the second CCTX has...

(EN_A_VS_AN)


59-92: Improve technical accuracy and readability in the examples.

Several improvements needed in the examples section:

  1. Add missing articles before "call":
- Consider an example of making call from
+ Consider an example of making a call from
  1. Use correct technical terms:
- to cover the withdraw gas fee
+ to cover the withdrawal gas fee
  1. Add missing commas after introductory phrases:
- In this example a user
+ In this example, a user
🧰 Tools
🪛 LanguageTool

[uncategorized] ~59-~59: Possible missing article found.
Context: ...Incoming Consider an example of making call from Ethereum Sepolia to a universal ap...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~62-~62: It appears that a comma is missing.
Context: ...sal app contract on ZetaChain. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~78-~78: Possible missing article found.
Context: ... an inbound hash, the API responds with HTTP 404 response, because this CCTX does no...

(AI_HYDRA_LEO_MISSING_AN)


[formatting] ~78-~78: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ... the API responds with HTTP 404 response, because this CCTX does not trigger another CCTX...

(COMMA_BEFORE_BECAUSE)


[uncategorized] ~83-~83: Possible missing article found.
Context: ... & Abort Consider an example of making call from Ethereum Sepolia to a universal ap...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~86-~86: It appears that a comma is missing.
Context: ...ct on ZetaChain, which aborts. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[grammar] ~89-~89: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...plied tokens is not enough to cover the withdraw gas fee to Polygon Amoy, so the transac...

(PREPOSITION_VERB)


[uncategorized] ~89-~89: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...n Amoy, so the transaction reverts. The amount of tokens is also not sufficient to cov...

(AMOUNTOF_TO_NUMBEROF)


123-128: Enhance the multiple outgoing transactions section.

The section about multiple outgoing transactions would benefit from more details:

Consider adding:

  1. A brief explanation of common use cases for multiple outgoing transactions
  2. Any limitations on the number of concurrent outgoing transactions
  3. Best practices for handling multiple outgoing transactions
🧰 Tools
🪛 LanguageTool

[typographical] ~125-~125: It appears that a comma is missing.
Context: ...n trigger more than one CCTXs. In this example a single function call on ZetaChain mak...

(DURING_THAT_TIME_COMMA)


1-128: Consider adding visual aids to enhance understanding.

The documentation would benefit from:

  1. A sequence diagram showing the flow of incoming and outgoing transactions
  2. A flowchart depicting the decision process for transaction outcomes (success/abort/revert)

Would you like me to help create these diagrams using Mermaid syntax?

🧰 Tools
🪛 LanguageTool

[misspelling] ~23-~23: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ng), the first CCTX hash can be used as a inbound hash to get the second CCTX has...

(EN_A_VS_AN)


[typographical] ~31-~31: It appears that a comma is missing.
Context: ...rom ZetaChain to Polygon Amoy. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~59-~59: Possible missing article found.
Context: ...Incoming Consider an example of making call from Ethereum Sepolia to a universal ap...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~62-~62: It appears that a comma is missing.
Context: ...sal app contract on ZetaChain. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~78-~78: Possible missing article found.
Context: ... an inbound hash, the API responds with HTTP 404 response, because this CCTX does no...

(AI_HYDRA_LEO_MISSING_AN)


[formatting] ~78-~78: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ... the API responds with HTTP 404 response, because this CCTX does not trigger another CCTX...

(COMMA_BEFORE_BECAUSE)


[uncategorized] ~83-~83: Possible missing article found.
Context: ... & Abort Consider an example of making call from Ethereum Sepolia to a universal ap...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~86-~86: It appears that a comma is missing.
Context: ...ct on ZetaChain, which aborts. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[grammar] ~89-~89: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...plied tokens is not enough to cover the withdraw gas fee to Polygon Amoy, so the transac...

(PREPOSITION_VERB)


[uncategorized] ~89-~89: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...n Amoy, so the transaction reverts. The amount of tokens is also not sufficient to cov...

(AMOUNTOF_TO_NUMBEROF)


[uncategorized] ~103-~103: Possible missing article found.
Context: ...Incoming & Revert An example of making call from Base Sepolia to a universal app co...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~106-~106: It appears that a comma is missing.
Context: ...t on ZetaChain, which reverts. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[grammar] ~109-~109: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...plied tokens is not enough to cover the withdraw gas fee to Polygon Amoy, so the transac...

(PREPOSITION_VERB)


[typographical] ~125-~125: It appears that a comma is missing.
Context: ...n trigger more than one CCTXs. In this example a single function call on ZetaChain mak...

(DURING_THAT_TIME_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1cb550 and dc5e536.

📒 Files selected for processing (2)
  • src/pages/developers/evm/_meta.json (1 hunks)
  • src/pages/developers/evm/cctx.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/evm/cctx.mdx

[misspelling] ~23-~23: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ng), the first CCTX hash can be used as a inbound hash to get the second CCTX has...

(EN_A_VS_AN)


[typographical] ~31-~31: It appears that a comma is missing.
Context: ...rom ZetaChain to Polygon Amoy. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~59-~59: Possible missing article found.
Context: ...Incoming Consider an example of making call from Ethereum Sepolia to a universal ap...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~62-~62: It appears that a comma is missing.
Context: ...sal app contract on ZetaChain. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~78-~78: Possible missing article found.
Context: ... an inbound hash, the API responds with HTTP 404 response, because this CCTX does no...

(AI_HYDRA_LEO_MISSING_AN)


[formatting] ~78-~78: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ... the API responds with HTTP 404 response, because this CCTX does not trigger another CCTX...

(COMMA_BEFORE_BECAUSE)


[uncategorized] ~83-~83: Possible missing article found.
Context: ... & Abort Consider an example of making call from Ethereum Sepolia to a universal ap...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~86-~86: It appears that a comma is missing.
Context: ...ct on ZetaChain, which aborts. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[grammar] ~89-~89: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...plied tokens is not enough to cover the withdraw gas fee to Polygon Amoy, so the transac...

(PREPOSITION_VERB)


[uncategorized] ~89-~89: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...n Amoy, so the transaction reverts. The amount of tokens is also not sufficient to cov...

(AMOUNTOF_TO_NUMBEROF)


[uncategorized] ~103-~103: Possible missing article found.
Context: ...Incoming & Revert An example of making call from Base Sepolia to a universal app co...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~106-~106: It appears that a comma is missing.
Context: ...t on ZetaChain, which reverts. In this example a user calls EVM Gateway's `depositAndC...

(DURING_THAT_TIME_COMMA)


[grammar] ~109-~109: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...plied tokens is not enough to cover the withdraw gas fee to Polygon Amoy, so the transac...

(PREPOSITION_VERB)


[typographical] ~125-~125: It appears that a comma is missing.
Context: ...n trigger more than one CCTXs. In this example a single function call on ZetaChain mak...

(DURING_THAT_TIME_COMMA)


## Incoming & Outgoing

Consider an example of making call from Ethereum Sepolia to a universal app
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Consider an example of making call from Ethereum Sepolia to a universal app
Consider an example of making a call from Ethereum Sepolia to a universal app

tokens for target ZRC-20 tokens, but the amount of supplied tokens is not enough
to cover the withdraw gas fee to Polygon Amoy, so the transaction reverts. The
amount of tokens is also not sufficient to cover a revert transaction to
Ethereum Sepolia, so the transaction abort.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Ethereum Sepolia, so the transaction abort.
Ethereum Sepolia, so the transaction aborts.

Copy link
Collaborator

@GMaiolo GMaiolo left a comment

Choose a reason for hiding this comment

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

Great to have this in the docs

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.

2 participants