paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Agile challenge-response for catching offline validators #338

Open rphmeier opened 6 years ago

rphmeier commented 6 years ago

Whenever the blake2-256 hash of the public random seed falls below some threshold T, a "roll call session" should be initiated at the start of the block. If a roll call session is currently live, does nothing. Roll call sessions last N blocks, during which each validator must provide a signature on the random seed at the start of the roll-call session.

If a validator does not provide a signature in this time, he is considered offline and is slashed.


NOTE: introduces a (fairly long) synchrony bound on the consensus. should be fine if we set it to 10 minutes or something.

Verifiable delay functions (https://eprint.iacr.org/2018/601.pdf) might have an application here for ensuring the time delay is strictly for censorship resistance and preventing "latecomers" from being able to respond without spending lots of power on compute resources.

gavofyork commented 4 years ago

This is essentially covered by ImOnline module, but it would be nice if validators that did not (yet) author a block got occasional randomised calls, like here, to provide proof that they're listening.

burdges commented 4 years ago

I presume "public random seed" means the BABE VRF output, not the epoch randomness.

Is there any reason this should start for everyone simultaneously? You could make each BABE block cause a single role call for the validator with index number

u32::from_le_bytes(babe_vrf_inout.make_bytes(b"roll_call")) % num_validators
rphmeier commented 4 years ago

@burdges tracking of live "roll-call" sessions seems a bit tougher to do then, but probably we could do it like that.