cartesi / rollups-contracts

Smart Contracts for Cartesi Rollups
https://cartesi.github.io/rollups-contracts/
Apache License 2.0
17 stars 37 forks source link

Add sanity check for claims #293

Open guidanoli opened 2 days ago

guidanoli commented 2 days ago

📚 Context

With the full Output Unification, all outputs will live under the same tree. Claims will then function as checkpoints, for the array of outputs will only grow, but old proofs will still be usable. On-chain, however, no introspection is made on the claim itself, certifying that the previous claims proves only a prefix of the outputs proven by the next claim.

✔️ Solution

We can add a sanity check on the claim submission entry point, ensuring that each output proven by the previous claim can still be proven by the new claim. This proof has $O(log\ n)$ size, with $n$ being the number of outputs, and uses $O(log\ N)$ gas to verify, with $N$ being the maximum number of outputs.

📈 Subtasks

guidanoli commented 2 days ago

This feature is planned for after the v2 release.