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

Standard cross-chain gateways and Axelar adapters #9

Merged
merged 52 commits into from
Nov 1, 2024

Conversation

ernestognw
Copy link
Member

@ernestognw ernestognw commented Jul 30, 2024

Description

From our discussions with the Axelar team, we created an initial MVP that we can start discussing here.
The MVP currently has 2 operational modes: in 1 or 2 steps. We still need to iterate to make sure the properties we discussed are met:

Properties

  • Safety
    • Validity:
      • A message may only be executed if it was first scheduled for execution
      • Messages may be executed in a different order than they were scheduled
      • It is possible to send messages with identical content multiple times, each a different message
    • Identification:
      • A message must be uniquely identifiable
    • Non-replayability:
      • A message may only be executed on the intended target
      • A message may not be (successfully) executed more than once
  • Liveness
    • A message is eventually delivered
      • Tolerates variable gas price at destination
      • Inherits the weakest liveness property of transactions at the source or destination
      • Any number of additional actions may be required in order for the scheduled message to be executed
    • Executability:
      • A Message should be executed only on the intended target
  • Observability
    • Scheduling / Execution tracking
      • A standard event should be emitted on the origin chain when a message is scheduled
      • A standard event should be emitted on the target chain when a message is executed
    • Sender notification (not in scope, not desired)
      • The sender may be notified that the message was successfully executed

Message structure

  • bytes/string destChain: CAIP-2 identifier, encoding TBD
  • bytes/string destAddress: CAIP-10 address (without chain id), encoding TBD
  • bytes payload: "calldata"
  • bytes params: protocol- & chain-specific metadata that affect message semantics (there could be none)
    • minGasLimit in optimism (but not other gas-payment-related parameters)
    • value or tokens attached to the message

@ernestognw ernestognw requested a review from a team as a code owner July 30, 2024 15:16
@ernestognw ernestognw marked this pull request as draft July 30, 2024 15:17
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

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

The main takeaway for me is that we should not be focusing on the generic implementation at the moment, we should instead focus on creating an Axelar adapter gateway, and the same for other protocols, as a way to validate the interfaces are generic enough so that we can standardize them.

contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/IGateway.sol Outdated Show resolved Hide resolved
contracts/crosschain/GenericGatewayCommon.sol Outdated Show resolved Hide resolved
contracts/crosschain/Gateway.sol Outdated Show resolved Hide resolved
contracts/utils/CAIP-2.sol Outdated Show resolved Hide resolved
@Amxx Amxx force-pushed the cross-chain/prototype-v1 branch from 11c8b44 to 336a56b Compare October 1, 2024 15:01
@Amxx Amxx modified the milestones: devcon 2024, 5.2 Oct 28, 2024
@ernestognw ernestognw marked this pull request as ready for review October 29, 2024 15:12
@ernestognw ernestognw changed the base branch from master to crosschain-audit-oct-2024 October 29, 2024 15:26
@ernestognw ernestognw requested review from frangio and Amxx October 30, 2024 05:10
@ernestognw
Copy link
Member Author

Merging to get the commit hash for the upcoming audit

@ernestognw ernestognw merged commit 12dd1d5 into crosschain-audit-oct-2024 Nov 1, 2024
5 of 6 checks passed
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.

3 participants