Overview
Configuring a LayerZero application on Stellar involves these steps:- Configure DVN — set verification parameters (required DVNs, optional DVNs, confirmations)
- Configure Executor — set execution parameters (max message size, executor address)
- Set Enforced Options — define minimum execution options per destination
DVN Configuration
DVNs (Decentralized Verifier Networks) verify crosschain messages. Configuration is done via the ULN-302 message library through the endpoint’sset_config function.
ULN Config Structure
The effective config must have at least one DVN — either
required_dvns must be non-empty, or optional_dvn_threshold must be greater than 0.
Configure Send DVN
Set the DVN configuration for outbound messages:2 = CONFIG_TYPE_SEND_ULN.
Configure Receive DVN
Set the DVN configuration for inbound messages:3 = CONFIG_TYPE_RECEIVE_ULN.
OApp ULN Config
When setting per-OApp config, useOAppUlnConfig which includes flags to fall back to defaults:
use_default_* flag to true to inherit the network-wide default for that field, even if you customize other fields.
Executor Configuration
The Executor delivers verified messages to the destination OApp. Configuration is also done viaset_config:
1 = CONFIG_TYPE_EXECUTOR.
The
config field in SetConfigParam is XDR-encoded bytes. Soroban contract types (OAppUlnConfig, OAppExecutorConfig) must be serialized to XDR before passing to set_config. Use the Stellar SDK’s toXDR() method or the stellar-xdr Rust crate to encode these structs.Setting Enforced Options
Enforced options define the minimum execution parameters for outbound messages. They are combined with any caller-provided options:options field is Option<Bytes> — pass null to remove enforced options for a given eid/msg_type combination.
Gas Options Example
When setting enforced options or passingextra_options in a send, you must specify the gas for lzReceive on the destination chain. The following examples use the standard LayerZero Type 3 encoding:
The options format is:
0x0003 (Type 3 header) + 01 (executor worker ID) + 0011 (length = 17 bytes) + 01 (lzReceive option type) + gas as uint128.
Reading Configuration
Query the current configuration for your OApp:Next Steps
- Technical Overview: Understand how DVN verification and executor delivery work end-to-end.
- Troubleshooting: Common configuration errors and solutions.