Reaching Consensus on Asset Prices
Last updated
Last updated
The process for reaching consensus on asset prices is as follows: First, the validators retrieve prices from off-chain data sources (such as Chainlink in Oracle Module V1) and submit this price data to the Exocore blockchain. The Oracle module then aggregates the price data from multiple validators, weighting each submission according to the validator's voting power to determine the final consensus price for each asset.
The process of obtaining and submitting price quotations involves several steps:
Price Fetching: Validators retrieve price data for specific asset pairs from sources such as Chainlink or exchanges.
Transaction Creation: After collecting the price data, the validator packages this information into a price-feed transaction, which is then submitted to the Exocore blockchain.
Transaction Validation: The transaction undergoes validation through an anteHandler
to ensure that:
The validator is active.
The asset pair corresponds to an open price quotation window.
The nonce value is valid, preventing duplicate submissions.
Price Consensus: Once the transaction is accepted, the Oracle module processes the quotes from validators. If sufficient consensus is achieved, the Oracle module promptly updates the price for the asset pair.
Sufficient Consensus: This occurs when the accumulated voting power for a specific price exceeds the predefined threshold of 2/3, indicating that a majority of validators agree on the price update. In Oracle Module V1, since Chainlink is the source and each price from Chainlink possesses a deterministic ID, there is no need to wait for additional voting power to be accumulated before the price is updated.
Fallback Mechanism: If consensus is not reached within a round's quotation window, the price from the previous round is carried forward. In this case, the price update occurs at the end of the last block in the quotation window.
Each round represents a specific price update cycle. Each round is assigned a unique round ID, which increments by 1 with every new round, ensuring that round IDs are continuous and sequential. This enables proper tracking of price updates and their associated data.
Each round contains a fixed number of blocks which is called the round interval. The interval of the round (i.e., the number of blocks) is predetermined, ensuring that price updates occur at regular, consistent intervals.
For example:
Round 1 could have round_id = 1
and span 30 blocks.
Round 2 would have round_id = 2
and cover the next 30 blocks, and so on.
This system ensures that price updates are synchronized with a predictable block schedule, and that every round has a clear, incremental identifier and duration.
The default value of interval
in testnet is 30 blocks.
A specific period during which prices can be submitted in each Round. For example, if round_1 starts at block 100 and has a quoting window of 3 blocks, the quoting window would include blocks {100, 101, 102}. During this window, validators can submit price quotes, and the system will reach consensus on the price for that round.
MaxNonce: This value equals to the size of quoting window which limits the number of price-feed transactions a validator can submit within a single quoting window. The default value of maxNonce is 3 in testnet.
For any given asset pair, multiple price quotes will be received from validators in each round. In principle, every active validator is required to submit a quote (by sending a price-feed
transaction) in each round. In V1 of the Oracle module, the price source is restricted to Chainlink, as its price updates come with a definitive Chainlink round ID (not Exocore’s round ID). Under this premise, the condition for 'reaching consensus' in V1 of the Oracle module is 'strict equality.' Specifically, when validators representing more than 2/3 of the total voting power submit exactly identical prices, that price becomes the consensus price for the current round on Exocore
Strict equality: For two price quotes to be considered "exactly identical," both the price and the corresponding Chainlink roundID must be equal. This means that when both the price and the Chainlink roundID in two quotes match exactly, they are considered to be strictly equal.