Hints
Description
Symbiotic core contracts were designed in such a way as to simplify the integration flow for networks or products with a different goal of utilizing the stake. One key aspect of this simplification is to provide flexibility to operate in a time flow that is not dependent on the Symbiotic contracts' mechanics. This achieved by enabling the receiving of any data related to the stake's calculation at any point.
From a more technical point of view, it is implemented by utilizing a mechanism named "Checkpoints". It is realized as an ordered-by-timestamps array of values, which can represent anything from the operators' opt-in statuses to the vaults' active stakes.
It allows for the efficient gathering of historical data by performing a binary search over the timestamps and returning the last value before the needed time point. However, this means that in the case of 1000 deposits and withdrawals, the algorithm may take up to 10 operations to retrieve a proper active stake at the needed timestamp. Such behavior results in the gradual growth of the gas costs for certain operations requiring historical data retrievals (e.g., slashing).
Fortunately, there is a solution - "hints". These are values calculated off-chain, providing a pointer to the exact "Checkpoint" we need to find. Further, the result is only verified by comparing the initial needed time point, the one determined by the provided value, and the next one. Hence, it makes the historical retrieval cheap enough and produces constant gas costs.
Technical overview
The Hints SDK is under development. Meanwhile, you can check the deployed hints provision contracts on testnets, which simplifies obtaining them.