tangle-network/dkg-substrate

[BUG] Investigate solutions to infinite misbehaviour reporting

Opened this issue · 2 comments

Overview

We don't want to get stuck in an infinite misbehaviour loop. Therefore, we need to think of workarounds here and begin to discuss them. The hope being that we will identify and implement new ideas to prevent these loops.

We need a way of capping how many misbehavior reports any given authority can submit and process.

Let's suppose there is a constant limit of Z misbehavior reports per authority per session.

Each node will locally keep track of how many misbehavior reports they've submitted per session. Of course, this can be abused, so, we will also need an on-chain hashmap HashMap<AuthorityId, usize> keeping track of how many misbehavior reports have been submitted for the current session (note: this will mean that once session rotation occurs on-chain, we will need to also clear this hashmap).

On-chain, if the number of misbehavior reports has been reached, then, we don't process the report. Since the local node also keeps track of how many misbehavior reports they've sent, then, we can assume that if a node tries to submit more than allowed, our on-chain logic can file a misbehaving report against the sender themself for trying to send over the limit (or possibly, even removing them from the set of best authorities). In short, this means we will have logic for preventing misuse of the misbehavior system.

Currently, misbehaviour reports never touch the chain until we have t+1 signed reports. Then we consider this a full report which we submit to the chain. Therefore, it is still entirely possible that a node will just spam another with reports off-chain.