Crate dc_distance
source ·Expand description
§Distance Oracle Inherent Data Provider
This crate provides functionality for creating an inherent data provider specifically designed for the “Distance Oracle”. The inherent data provider is responsible for fetching and delivering computation results required for the runtime to process distance evaluations.
§Relationship with Distance Oracle
The distance-oracle is responsible for computing distance evaluations, storing the results to be read in the next period, and saving them to files. These files are then read by this inherent data provider to provide the required data to the runtime.
§Overview
- Retrieves period index and evaluation results from the storage and file system.
- Determines whether the computation results for the current period have already been published.
- Reads and parses evaluation result files when available, providing the necessary data to the runtime.
Enums§
Constants§
- The file version that should match the distance oracle one. This ensures that the smith avoids accidentally submitting invalid data in case there are changes in logic between the runtime and the oracle, thereby preventing potential penalties.
Functions§
- Create a new
sp_distance::InherentDataProvider
at the given block.