Executor options & gas
Every quote and send includes LayerZero type-3 options. A plain transfer buys destination lzReceive gas. A composed transfer buys lzReceive gas for the bridge credit and separate index-0 lzCompose gas for the application.
Plain transfer
0x0003 options type 3
01 executor worker
0021 option length 33
01 lzReceive option
<gas> uint128 receive gas
<value> uint128 receive msg.valueOmnisea does not forward lzReceive value, so Router validation requires this field to be zero. Use the separate compose-value field only when a payable composer needs native value.
export function lzReceiveOptions(gas: bigint, value = 0n) {
return `0x000301002101${u128(gas)}${u128(value)}` as const;
}Transfer with composition
Append an executor lzCompose option for index 0:
export function lzReceiveAndComposeOptions(receiveGas: bigint, composeGas: bigint, composeValue = 0n) {
return `0x000301002101${u128(receiveGas)}${u128(0n)}`
+ `010023030000${u128(composeGas)}${u128(composeValue)}`;
}
function u128(value: bigint) {
return value.toString(16).padStart(32, "0");
}Adding the compose budget to lzReceive gas is not equivalent. Router validation requires an index-0 compose option whenever ComposeParams.composer is nonzero, and rejects a compose option on a plain transfer.
Gas floors
| Situation | Required Router getter |
|---|---|
| Existing representation or return to original chain | minTransferGas() |
| Restore message | minTransferGas() |
| First deployment on a destination | minCreationGas() |
| Optional composer | ComposeParams.gasLimit, as separate lzCompose gas |
These are minimums, not route-specific recommendations. Undershooting can leave a message for retry or restore; large overshoots increase the LayerZero quote.
The live Base Morpho borrowing interface currently buys 1,500,000 units of index-0 lzCompose gas. The composer reserves gas for a failed borrow and destination refund, so its application budget must not be folded into lzReceive or reduced to the Router's normal transfer floor.
Match quote and send
Use byte-identical options and the same isFirstTransfer and ComposeParams in the quote and send. Any change can change the LayerZero fee and cause the exact-fee check to revert.