updateCollateral(collateral,retrievalIds[],metadataHash,validators[],timestamps[],signatures[]):minimumTimestamp
Callable by minter approved by TTG
Closes all pending retrievalIds[] requests
Updates CVminter
Accrues penaltyminter for missed update collateral intervals and/or excessOwedMminter if present before CVminter is updated
Called at least once per updateCollateralInterval by Minter or missedCollateralUpdatePenalty is imposed on the entire activeOwedMminter since the collateral of minter is 0 if failing to call updateCollateral once per updateCollateralInterval
Gets updateCollateral message digest for each validator signature
Verifies that each signature is valid, unique, and is not in the future, and is coming from TTG-approved validator
Verifies that at least updateCollateralThreshold of valid unique signatures of TTG-approved validators were provided and Finds the minimumTimestamp of given validators' timestamps[] .
Calculates current activeOwedMminter, and Imposes missedCollateralUpdatePenaltyminter for every missed and not yet penalized update collateral interval. Updates penalizedUntilTimestampminter if a penalty was imposed.
missedCollateralUpdatePenaltyminter=activeOwedMminter∗missedIntervalsNum∗penaltyRate where penalizeFromminter=max(lastCollateralUpdateminter,lastPenalizedUntilminter)missedIntervalsNum=(now−penalizeFromminter)/updateCollateralIntervalpenalizedUntilTimestampminter=penalizeFromminter+missedIntervalsNum∗updateCollateralInterval
Calculates current excessActiveOwedminter
Imposes undercollateralizationPenaltyminter if excessActiveOwedMminter>0 and penalizeFromminter<minimumTimestamp where excessActiveOwedMminter=activeOwedMminter−maxAllowedActiveOwedMminterpenalizeFromminter=max(lastCollateralUpdateminter,lastPenalizedUntilminter)
timeSpan=minimumTimestamp−penalizeFromminterundercollateralizationPenaltyBase=excessActiveOwedMminter∗timeSpan/updateCollateralInterval
undercollateralizationPenaltyminter=undercollateralizationPenaltyBase∗penaltyRate
activeOwedMminter+=undercollateralizationPenaltymintertotalActiveOwedM+=undercollateralizationPenaltyminter
After penalization new activeOwedMminter,t1=activeOwedMminter,t0+undercollateralizationPenaltyminter
Resolves pending retrievals. Deducts the amount of retrieval from totalPendingCollateralRetrievalsminter for every retrieval. Deletes retrievalId from pendingCollateralRetrievalsminter totalPendingCollateralRetrievalsminter−=∑iretrievalminter,retrievalId[i]
Verifies that minimumTimestamp is greater than earliestAllowedTimestampminterlastUpdateTimestampminter=max(lastCollateralUpdateminter,latestProposedRetrievalTimestampminter)minUpdateCollateralInterval=min(updateCollateralInterval,now)earliestAllowedTimestampminter=max(lastUpdateTimestampminter,now−minUpdateCollateralInterval)
Updates CVminter: CVminter=collateral
Updates lastCollateralUpdateminter=minimumTimestamp
Calls updateIndex
Returns minimumTimestamp.