Message Lifecycle
Simplified message lifecycle
The simplified lifecycle of an xCall message, only including what is relevant to most dApp developers, is as follows:
- EOA initiates a cross-chain call by invoking the
sendCallMessagemethod on the source chain's xCall contract. - Once the call is relayed to the destination chain, a
CallMessageevent is triggered on the destination chain's xCall contract. - EOA then respond to this event by invoking the
executeCallmethod in the xCall Smart Contract on the destination chain. - The execution of this method triggers the target dApp's smart contract method.
- If the call executes successfully, a
CallExecutedEventis emitted. - If an error occurs during execution, and rollback data was included in the original call, an error handling process is initiated, sending a
ResponseMessageEvent back to the source chain for state rollback operations. For more information, see Troubleshooting.
In this process, the dApp developer handles initiating the cross-chain call, responding to events, and errors.
sendCallMessage is a Payable method and requires a fee. For more information, see Handling Fees.
Full message lifecycle
For the full message lifecycle, please see the xCall specification (opens in a new tab).