codex-storage / codex-contracts-eth

Ethereum smart contracts for Codex
Other
6 stars 9 forks source link

Require proof for `freeSlot` #143

Open emizzle opened 2 months ago

emizzle commented 2 months ago

Given that there is leniency in allowed proofs missed before being slashed, slashCriterion, there should be a final proof submitted from SPs at the end of the contract duration before they are paid out?

Rationale

SPs could delete data for the last x periods of the contract, without any penalty at all, where x is: (slashCriterion-1) * proofProbability. Considering that each period could be 24 hours, there is a potential for SPs to be able to delete their contractually obliged data for quite a few days without penalty.

There are also a few incentive structures in place that rely on the idea that SPs will only get paid out after the contract successfully finishes, so adding a single additional proof requirement at the end would only reinforce the idea that data must be stored until the end to get paid out.

Implementation

Add an optional parameter, proof, to freeSlot. On successfully completed requests, SPs must provide a valid proof when calling freeSlot before payout is allowed.