Skip to content

XCall V2 changes #30

@AntonAndell

Description

@AntonAndell

The library to be used now for xcall development is:
xyz.venture23:xcall-lib:0.1.1' for java
cw-xcall-lib={package="cw-xcall-lib", git="https://github.com/icon-project/xcall-multi.git", branch="main", features = ["library"]} for cosmwam
Solidity lib: to be published?

Differences from IIP52 xCall

Multi protocol xCall is based on the initial spec defined
in IIP52.

  • Two new optional parameters are added in sendCallMessage: _sources and destinations.
    These parameters can be specified to choose the protocols to deliver the xCall message.
    If, for example, a dapp wanted to use BTP, they specify the address of BMC as the source and the address of BMC on a
    destination chain as destinations.

  • Rollback guarantees.
    In IIP52, xCall rollback executions can only be tried once before removed, which can cause loss of data in case of
    failure.
    In xCall multi protocol, it can be retried until successful.

  • Two-way message success verification.
    For all two-way messages, a response has to be relayed back since the fee has already been paid.
    This means that in most cases, a response with the result success is being relayed back.
    In xCall multi protocol, we store this success receipt so that it can be verified by dapps.

  • BTP address has been replaced completely by Network Address.
    A BTP address is a Network Address as defined here with a btp:// prefix.
    A Network Address in IIP52 refers to the Network ID in this document which might cause some confusion.

  • The source of truth for a Network ID is now in xCall and not BMC.

  • _nsn is removed from CallMessageSent event.

  • Error messages are no longer relayed across chains in a response.

  • _msg has been removed from ResponseMessage event. This is due to the removal of relaying the error messages.

  • A message can now only be success or failure (1 or 0).
    In IIP52 a message can have many different error codes but was not used by dapps and the same behavior is not
    necessarily supported by all chains.

  • MaxDataSize is defined on the whole payload rather than only user data
    This change was necessary to limit the size of the _sources and destinations parameters.

What this means for dapps using v1:

  • The use of BTP address needs to be changed to NetworkAddress.
    Example remove btp prefix from btp://${NETWORK_LABEL_DESTINATION}/${CONTRACT_DESTINATION};
    Network Address implmentation will work the same as BTP address and no extra changes should be needed.

  • If event listeners are used some parameters have changed.

Less priority:

  • Multi protocol
  • Success verification.

Example dapps:
Solidity:
https://github.com/icon-project/xcall-multi/blob/main/contracts/evm/contracts/mocks/dapp/DAppProxySample.sol
https://github.com/icon-project/xcall-multi/blob/main/contracts/evm/contracts/mocks/multi-protocol-dapp/MultiProtocolSampleDapp.sol

Java:
https://github.com/icon-project/xcall-multi/blob/main/contracts/javascore/example-dapps/dapp-multi-protocol/src/main/java/xcall/sample/dapp/MultiProtocolSampleDapp.java
https://github.com/icon-project/xcall-multi/blob/main/contracts/javascore/example-dapps/dapp-simple/src/main/java/xcall/sample/dapp/SimpleDapp.java

Cosmwasm:
https://github.com/icon-project/xcall-multi/tree/main/contracts/cosmwasm-vm/cw-mock-dapp-multi
https://github.com/icon-project/xcall-multi/tree/main/contracts/cosmwasm-vm/cw-mock-dapp

@FidelVe Lets keep discussion and questions in this issue during the development

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions