Data delivery
Last updated
Last updated
DIA Lumina achieves full interoperability, delivering oracle data to any blockchain with minimal friction through the Spectra protocol, a message passing layer powering both the push and pull oracle models.
An interchain message passing protocol. Spectra is formed by a network of nodes, running a custom instance of Hyperlane, an open interoperability framework. It facilitates secure and rapid transmission of oracle data to any blockchain, without the need for chain-specific integrations.
The Spectra validators observe messages on the mailboxes of the destination and origin chains. The messages are then checked through the ISM (Interchain Security Module) and delivered to these components:
RequestOracle (Pull oracle)
PushOracleReceiver (Push oracle)
The gas for processing messages are funded by imposing a fee for calling request()
on RequestOracle, or handle()
on the PushOracleReceiver contracts. The fees are transferred to the ProtocolFeeHook – an instance of Hyperlane's Post-Dispatch hooks - that are then withdrawn manually to the Spectra gas wallet.
Let's explore how Spectra contributes to the flow of messages in the Push and Pull oracle models and how that translates to the data you receive on the destination chain.
User initiates a request to the RequestOracle contract and pays a fee.
RequestOracle processes the request on the origin chain (e.g. Ethereum), creates a message containing the request details (destination chain id, OracleRequestRecipient address, exchange pair, ...etc), then dispatches it through the Mailbox.
The validators observes the mailbox and picks up the request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain (DIA lasernet).
OracleRequestRecipient receives and validates the message through the ISM, and passes it forward to OracleTrigger that fetches the values from the Aggregator or meta-contract. It then creates a message with the latest price, and dispatches it back to Lasernet's mailbox.
Message is picked up by Spectra protocol and sent back to the RequestOracle which then checks for data freshness and adds the value to the updates
mapping.
Go feeder service initiates a price update based on certain parameters (such as deviation, heartbeat, & refresh frequency) on the origin chain (DIA's lasernet).
OracleTrigger processes the update request, reads the latest price from the meta-contract, creates a message, & dispatches it through the Mailbox.
The validators observes the mailbox and picks up the update request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain.
PushOracleReceiver receives the update, validates the message through the ISM, checks for the data freshness, the adds the value to the updates
mapping.
Cost of updating data on the destination chain is calculated as follows: