taiko-mono
taiko-mono copied to clipboard
refactor(protocol): improve lib proving logics - 2 (to be tested)
Address a concern from OZ:
Liveness bond return can be triggered in other conditions than first proof by assigned prover
Location Edit: I rewrote the below a bit to be clearer. Example
The liveness bond can be returned when it should not be if tid != 1 or if the transition has already been proven once and the assigned prover contests and proves at the same time (which is unlikely).
For example, let’s imagine a block with SGX as min proof, and the assigned prover P
missed the proving window for the first transition. He should thus theoretically give up his liveness bond. The correct transition A
was proven using SGX by someone else at minute 61 after blk.proposedAt (1 min after end of proving window for SGX). P
could then prove a transition from a different (random) parent hash using a higher level proof (which has a bigger proving window) just to get his liveness bond back (see 2nd picture below). In this instance for example, he could prove a transition B
from another parent hash using a zk proof at minute 62 after block proposal (which would be in the proving window). He would get his liveness bond back, but in reality he should not as he missed the SGX proving window for tid == 1.
Essentially the check to return the liveness bond and to filter non-assigned provers should be the same but they are currently different. Cleanest fix would be to store the previous if()’s content as a new variable and pass it to _overrideWithHigherProof
, though I know you’re short on variables with limited stack depth…
refactor(protocol): improve lib proving logics - 2 (to be tested)
Generated at commit: 75538e61584f40f25c541841212ab8e36ae48664
🚨 Report Summary
Severity Level | Results | |
---|---|---|
Contracts | Critical High Medium Low Note Total | 2 2 0 5 41 50 |
Dependencies | Critical High Medium Low Note Total | 0 0 0 0 0 0 |
For more details view the full report in OpenZeppelin Code Inspector