updateCollateral

updateCollateral(collateral,retrievalIds[],metadataHash,validators[],timestamps[],signatures[]):minimumTimestampupdateCollateral(collateral,retrievalIds[],metadataHash, validators[],timestamps[],signatures[]): minimumTimestamp

  • Callable by minterminter approved by TTG

  • Closes all pending retrievalIds[]retrievalIds[] requests

  • Updates CVminterCV_{minter}

  • Accrues penaltyminterpenalty_{minter} for missed update collateral intervals and/or excessOwedMminterexcessOwedM_{minter} if present before CVminterCV_{minter} is updated

  • Called at least once per updateCollateralIntervalupdateCollateralInterval by Minter or missedCollateralUpdatePenaltymissedCollateralUpdatePenalty is imposed on the entire activeOwedMminteractiveOwedM_{minter} since the collateral of minter is 0 if failing to call updateCollateralupdateCollateral once per updateCollateralIntervalupdateCollateralInterval

    • Gets updateCollateralupdateCollateral message digest for each validator signaturesignature

    • Verifies that each signature is valid, unique, and is not in the future, and is coming from TTG-approved validatorvalidator

    • Verifies that at least updateCollateralThresholdupdateCollateralThreshold of valid unique signatures of TTG-approved validatorsvalidators were provided and Finds the minimumTimestampminimumTimestamp of given validatorsvalidators ' timestamps[]timestamps[] .

    • Calculates current activeOwedMminteractiveOwedM_{minter}, and Imposes missedCollateralUpdatePenaltymintermissedCollateralUpdatePenalty_{minter} for every missed and not yet penalized update collateral interval. Updates penalizedUntilTimestampminterpenalizedUntilTimestamp_{minter} if a penalty was imposed. missedCollateralUpdatePenaltyminter=activeOwedMmintermissedIntervalsNumpenaltyRatemissedCollateralUpdatePenalty_{minter} =activeOwedM_{minter} * missedIntervalsNum * penaltyRate where penalizeFromminter=max(lastCollateralUpdateminter,lastPenalizedUntilminter)penalizeFrom_{minter}=max(lastCollateralUpdate_{minter} , lastPenalizedUntil_{minter})missedIntervalsNum=(nowpenalizeFromminter)/updateCollateralIntervalmissedIntervalsNum =(now-penalizeFrom_{minter}) / updateCollateralIntervalpenalizedUntilTimestampminter=penalizeFromminter+missedIntervalsNumupdateCollateralIntervalpenalizedUntilTimestamp_{minter} = penalizeFrom_{minter} + missedIntervalsNum * updateCollateralInterval

    • Calculates current excessActiveOwedminterexcessActiveOwed_{minter} Imposes undercollateralizationPenaltyminterundercollateralizationPenalty_{minter} if excessActiveOwedMminter>0excessActiveOwedM_{minter} > 0 and penalizeFromminter<minimumTimestamppenalizeFrom_{minter} < minimumTimestamp where excessActiveOwedMminter=activeOwedMmintermaxAllowedActiveOwedMminterexcessActiveOwedM_{minter}=activeOwedM_{minter}-maxAllowedActiveOwedM_{minter}penalizeFromminter=max(lastCollateralUpdateminter,lastPenalizedUntilminter)penalizeFrom_{minter}=max(lastCollateralUpdate_{minter} , lastPenalizedUntil_{minter})

      timeSpan=minimumTimestamppenalizeFrommintertimeSpan=minimumTimestamp-penalizeFrom_{minter}undercollateralizationPenaltyBase=excessActiveOwedMmintertimeSpan/updateCollateralIntervalundercollateralizationPenaltyBase=excessActiveOwedM_{minter}*timeSpan / updateCollateralInterval

      undercollateralizationPenaltyminter=undercollateralizationPenaltyBasepenaltyRateundercollateralizationPenalty_{minter}=undercollateralizationPenaltyBase*penaltyRate

      activeOwedMminter+=undercollateralizationPenaltyminteractiveOwedM_{minter} +=undercollateralizationPenalty_{minter}totalActiveOwedM+=undercollateralizationPenaltymintertotalActiveOwedM+=undercollateralizationPenalty_{minter} After penalization new activeOwedMminter,t1=activeOwedMminter,t0+undercollateralizationPenaltyminteractiveOwedM_{minter, t1} =activeOwedM_{minter, t0}+ undercollateralizationPenalty_{minter}

    • Resolves pending retrievals. Deducts the amount of retrieval from totalPendingCollateralRetrievalsmintertotalPendingCollateralRetrievals_{minter} for every retrieval. Deletes retrievalIdretrievalId from pendingCollateralRetrievalsminterpendingCollateralRetrievals_{minter} totalPendingCollateralRetrievalsminter=iretrievalminter,retrievalId[i]totalPendingCollateralRetrievals_{minter} -= ∑_{i}retrieval_{minter, retrievalId[i]}

    • Verifies that minimumTimestampminimumTimestamp is greater than earliestAllowedTimestampminterearliestAllowedTimestamp_{minter}lastUpdateTimestampminter=max(lastCollateralUpdateminter,latestProposedRetrievalTimestampminter)lastUpdateTimestamp_{minter}=max(lastCollateralUpdate_{minter} , latestProposedRetrievalTimestamp_{minter})minUpdateCollateralInterval=min(updateCollateralInterval,now)minUpdateCollateralInterval=min(updateCollateralInterval, now)earliestAllowedTimestampminter=max(lastUpdateTimestampminter,nowminUpdateCollateralInterval)earliestAllowedTimestamp_{minter}=max(lastUpdateTimestamp_{minter}, now-minUpdateCollateralInterval)

    • Updates CVminterCV_{minter}: CVminter=collateralCV_{minter}=collateral

    • Updates lastCollateralUpdateminter=minimumTimestamplastCollateralUpdate_{minter} =minimumTimestamp

    • Calls updateIndexupdateIndex

    • Returns minimumTimestampminimumTimestamp.

Last updated

Copyright 2024 M^0 Foundation