Message Execution
The following functions are applicable in the destination chain.
Introduction
Once a message has been delivered to the Message Controller on the destination chain, you can check its status by calling the following function, passing the message id:
function receivedMessages(bytes32 messageId) public view returns(ReceivedMessage);The following Struct is returned:
| Name | Type | Description |
|---|---|---|
relayedMsg | address[] | The list of target addresses. |
calldatas | bytes[] | The list of calldata to be executed. |
threshold | uint256 | The threshold required for the message to be executed. |
receivedSoFar | uint256 | The number of times the message has been received. |
originChainId | uint256 | The ID of the origin chain. |
executableAt | uint256 | The timestamp at which the message can be executed. |
expiresAt | uint256 | The timestamp at which the message expires and cannot be executed afterwards (30 days after first receipt) |
executed | bool | A boolean indicating whether the message has been executed. |
cancelled | bool | A boolean indicating whether the message has been cancelled. |
isReceivedMessageExecutable
You can check whether a received message is ready for execution by calling the following function on the destination chain, passing the messageId:
function isReceivedMessageExecutable(bytes32 messageId) public view returns (bool);Returns true if the message is executable, false otherwise.
Veto
If both a Vetoer and a timelock delay have been set, the Vetoer can cancel a message that:
- Is still within the
timelockDelayperiod - Has not yet been executed
- Has not expired (30 days have not passed since the message was registered)
The Vetoer can cancel a pending message by calling:
function cancel(bytes32 messageId) public;Execute
Lucid will automatically execute a message once it becomes executable. However, anyone can manually trigger execution by calling the following function with the message ID:
function execute(bytes32 messageId) public;
