linera-protocol
linera-protocol copied to clipboard
When trying validators in random order, take weights into account.
If a validator has five times less weight its misbehavior should do five times less harm. So whenever we try to obtain something sequentially from the different validators, in order, we should not just shuffle the vector: the validators should be picked with a probability proportional to their weights. That way, a validator with very little stake can only cause very few delays.
This also means that a validator with five times the stake can cause five times the censorship, doesn't it?
In those places where we do that (search shuffle in local_node.rs) we only download things that we immediately verify. So the first validator in line can't censor anything there, they can just refuse to answer and thereby cause a delay until we ask the next one.
Not sure if this is still needed. Instead, maybe Client::download_certificates needs a similar treatment as https://github.com/linera-io/linera-protocol/pull/3232? Probably needs discussion, at least.