Skip to content
LogoLogo

Hints

Symbiotic core contracts simplify integration for networks and products with different stake utilization goals. One key simplification is flexibility to operate in a time flow independent of Symbiotic contract mechanics. This is achieved by enabling retrieval of any stake calculation data at any point.

From a technical perspective, this is implemented using a mechanism called "Checkpoints". Checkpoints are implemented as an ordered-by-timestamp array of values, representing anything from operator opt-in statuses to vault active stakes.

This allows efficient gathering of historical data by performing a binary search over timestamps and returning the last value before the needed time point. However, with 1000 deposits and withdrawals, the algorithm may take up to 10 operations to retrieve the active stake at a given timestamp. This results in gradually increasing gas costs for operations requiring historical data retrievals (e.g., slashing).

default-checkpoints

Fortunately, there's a solution: "hints". These are values calculated off-chain that provide a pointer to the exact checkpoint you need. The result is verified by comparing the initial needed time point, the one determined by the provided value, and the next one. This makes historical retrieval cheap and produces constant gas costs.

checkpoints-with-hints

How to Construct Hints