-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Approval and backing checker timeouts #1628
Description
We decided upon using the deterministic wasmi timer at the research meeting, which enables simpler safer designs.
Idea 1. Safer for validators, but slower
Primarybacking validators runs the block in both wasmtime and wasmi and only announce if it passes both limits.- Approval checkers
and non-primary backing validatorsonly run wasmtime, unless the block exceeds their wasmtime limit, in which case they run wasmi. - We punish the primary backing validator for wasmi runtimes exceeding some t_good, but only declare the block invalid if its wasmi runtime exceeds some larger limit t_bad > t_good.
- We tune the wasmtime limit to be longer than the wasmi limit t_good, so that honest acceptable wasmi reports result in wasmtime running fast enough.
We'll want as few backing validators as possible anyways, so there is no reason to distinguish a primary backing validator here.
Idea 2. Faster, but maybe slightly riskier for validators
- Backing validators run the block in wasmtime (resp. native) and only announce if it passes within time t_wasmtime_backing (resp. t_native_backing).
- Approval checkers only run wasmtime (resp. native), unless the block exceeds come t_wasmtime_approve > t_wasmtime_backing (resp. t_native_approve > t_native_backing), in which case they run wasmi. We have two wasmi timeouts t_good and t_bad, so approval checkers report four cases:
- Valid, ran in t_wasmtime_approve (resp. t_native_approve) in wasmtime (resp. native),
- Valid, ran in t_good in wasmi,
- Valid, but ran between t_good and t_bad in wasmi,
- Invalid, exceeded t_bad in wasmi,
- We deny candidate rewards to backing validators if the majority of approval checkers says iii, but we do not escalate, slash, or chill, and never punish any approval checkers.
- All validators automatically benchmark and then tune their t_wasmtime_backing (resp. t_native_backing) to be faster than t_good, so that they never loose candidate rewards due to iii. All validators similarly tune t_wasmtime_approve (resp. t_native_approve) to be both slower than t_good, so that they never waste CPU due to ii, but faster than t_bad, so that i vs iv disputes should never occur. It merely provokes local retuning when ii or iii occur.
Optional 1a: If some i vs iv dispute occurs then i voters have a short window in which they rerun the block using wasmi and agree or disagree with iv voters. If all i voters agree then we do not escalate the dispute, but the i voters are still slashed 100%. In this case, their aid avoiding the delay may count somewhat in their favor in slash reversion discussions, but guarantees nothing.
Optional 1b: As an unlikely option, if a backing validator X considers a block B slower than t_wasmtime_backing (resp. t_native_backing), but observe another validator Y backing B, then X could run the approval checker scheme, but declares it votes with approval checker timeouts, and hence cannot loose candidate rewards. I fear this grows unnecessarily complex.