What “Execution” Means
In the LayerZero protocol, execution refers to the invocation of the LayerZero Endpoint methods on the destination chain after a message has been verified:-
lzReceive(...): Delivers a verified message to the destination OApp, triggering its logic. -
lzCompose(...): Delivers a composed message (e.g., nested calls) after the initial receive logic has triggered.
Executors: Execution as a Service
While you could manually calllzReceive(...) or lzCompose(... ) and pay gas on the destination chain directly, Executors automate this process:
- Quote in Source Token: Executors accept payment in the source chain’s native token and calculate the cost to deliver the destination chain’s gas token based on the instructions provided and a pricefeed formula.
-
Automatic Delivery: After verification, the Executor invokes the appropriate endpoint method (
lzReceive(...)orlzCompose(...)) with the specified resources and message. - Native Token Supplier: Executors are responsible for sourcing the native gas token on the destination chain, making them a resource for users needing to convert chain-specific resources.
- Fee for Service: Executors charge a fee for relaying and executing messages.
Permissionless Functions
Because the endpoint methods are open, your application remains decentralized and trust-minimized, as any party can run an Executor or call the endpoint directly.Message Options
Use Message Options to pass execution instructions along with your payload. Available options include:-
lzReceiveOption: Specifygasandmsg.valuewhen callinglzReceive(...). -
lzComposeOption: Specifygasandmsg.valuewhen callinglzCompose(...). -
lzNativeDropOption: Drop a specifiedamountof native tokens to areceiveron the destination. -
lzOrderedExecutionOption: Enforce nonce-ordered execution of messages.
Default vs. Custom Executors
Choose the executor strategy that fits your application:- Default Executor: Use the out-of-the-box implementation maintained by LayerZero Labs.
- Custom Executor: Select from third-party Executors or deploy your own variant.
- Build Your Own: Follow Build Executors to implement a bespoke message Executor.
-
No Executor: Opt out of automated execution entirely; users can manually call
lzReceive(...)orlzCompose(...)via LayerZero Scan or a block explorer.
See Executor Configuration for details on wiring up a non-default Executor in your OApp.