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

doc: add cross-chain-communication-model.md #83

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

adu-web3
Copy link
Collaborator

@adu-web3 adu-web3 commented Aug 30, 2024

Description

croos-chain-communication-model.md describes how messages are forwarded and executed between sender contract and receiver contract

Summary by CodeRabbit

  • New Features
    • Introduced a comprehensive document outlining the Cross-Chain Communication Model, detailing message management and execution integrity between client chains and the Exocore chain.
    • Established guidelines for nonce-based message processing to ensure correct sequencing and prevent message loss.
    • Defined operational protocols for request-response interactions to maintain the robustness of cross-chain communications.

Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Walkthrough

The document introduces the Cross-Chain Communication Model, detailing the interaction between multiple client chains and a singular Exocore chain. It describes the architecture of the communication framework, focusing on the ExocoreGateway contract and its relationship with ClientChainGateways. Key features include a nonce-based mechanism for message ordering, blocking message execution, and operational guidelines for request-response interactions.

Changes

Files Change Summary
docs/cross-chain-communication-model.md Introduced a new document outlining the Cross-Chain Communication Model, detailing architecture, nonce-based message execution, and operational guidelines.

Sequence Diagram(s)

sequenceDiagram
    participant ClientChainGateway
    participant ExocoreGateway
    participant ReceiverContract

    ClientChainGateway->>ExocoreGateway: Send Message (Nonce)
    ExocoreGateway->>ReceiverContract: Forward Message
    ReceiverContract->>ReceiverContract: Process Message
    ReceiverContract-->>ExocoreGateway: Acknowledge Success
    ExocoreGateway-->>ClientChainGateway: Acknowledge Success
Loading

Poem

🐇 In the realm of chains where messages flow,
A gateway stands tall, with a bright, steady glow.
Nonces in order, they dance and they play,
Ensuring each message finds its own way.
With integrity strong, and a hop in our heart,
Cross-chain communication, a wondrous art! 🌟


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 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 or @coderabbitai title 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.

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

Outside diff range, codebase verification and nitpick comments (2)
docs/cross-chain-communication-model.md (2)

1-2: Add an introduction.

Consider adding a brief introduction to provide context for the document. This will help readers understand the purpose and scope of the document.


20-23: Add a comma before "and".

The explanation of the blocking mechanism for message execution is clear and comprehensive. Consider adding a comma before "and" in the following sentence for better readability:

- the message is not stored and the nonce is not incremented
+ the message is not stored, and the nonce is not incremented
Tools
LanguageTool

[uncategorized] ~22-~22: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...e the message, the message is not stored and the nonce is not incremented, preventin...

(COMMA_COMPOUND_SENTENCE_2)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0a2fa70 and 8b2cf34.

Files selected for processing (1)
  • docs/cross-chain-communication-model.md (1 hunks)
Additional context used
Learnings (1)
Common learnings
Learnt from: adu-web3
PR: ExocoreNetwork/exocore-contracts#39
File: src/core/ExocoreGateway.sol:105-105
Timestamp: 2024-07-01T09:18:36.140Z
Learning: In the Exocore contracts, the design decision to avoid receiving responses from the client chain due to cost considerations means that operations assume success on the client chain.
LanguageTool
docs/cross-chain-communication-model.md

[uncategorized] ~22-~22: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...e the message, the message is not stored and the nonce is not incremented, preventin...

(COMMA_COMPOUND_SENTENCE_2)

Additional comments not posted (3)
docs/cross-chain-communication-model.md (3)

3-6: LGTM!

The explanation of the 1:N relationship is clear and concise.


7-18: LGTM!

The explanation of the nonce mechanism for ordered message execution is clear and comprehensive.


24-35: LGTM!

The explanation of the request-response mechanism and guidelines is clear and comprehensive.

Copy link
Collaborator

@bwhour bwhour left a comment

Choose a reason for hiding this comment

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

LGTM

@MaxMustermann2 MaxMustermann2 changed the title doc: add croos-chain-communication-model.md doc: add cross-chain-communication-model.md Sep 2, 2024
@adu-web3 adu-web3 added this pull request to the merge queue Sep 2, 2024
Merged via the queue into ExocoreNetwork:main with commit d8b7d2c Sep 2, 2024
7 checks passed
MaxMustermann2 added a commit to MaxMustermann2/exocore-contracts that referenced this pull request Sep 2, 2024
- As outlined in ExocoreNetwork#83, a cross-chain message that can't/won't be retried
  must not fail. Hence, all calls to `markBootstrapped` on `Bootstrap`
  should not fail. Fixes ExocoreNetwork#89
- Separately, sending multiple LZ messages in one transaction is
  convoluted and hence disabled. As a consequence, marking bootstrap on
  all chains is no longer supported; instead, the caller must provide
  the LZ chain ID. Along similar lines, the caller must provide the
  native fee for this transaction.
github-merge-queue bot pushed a commit that referenced this pull request Sep 5, 2024
* fix(bootstrap): do not fail mark bootstrap

- As outlined in #83, a cross-chain message that can't/won't be retried
  must not fail. Hence, all calls to `markBootstrapped` on `Bootstrap`
  should not fail. Fixes #89
- Separately, sending multiple LZ messages in one transaction is
  convoluted and hence disabled. As a consequence, marking bootstrap on
  all chains is no longer supported; instead, the caller must provide
  the LZ chain ID. Along similar lines, the caller must provide the
  native fee for this transaction.

* fix: remove reference to markBootstrapOnAllChains

* test: add unit test for mark bootstrap

In the case where Bootstrap call first fails and then succeeds.

* fix: do not fail mark bootstrap to gateway

* fix(test): expect event

* refactor: remove repeated code
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.

4 participants