go-spacemesh
go-spacemesh copied to clipboard
tortoise: revert counted ballots and atxs after learning that identity is malicious
this behavior was learned in https://github.com/spacemeshos/go-spacemesh/pull/4571
assume equal partition that lasts for long period of time, atleast one epoch. during this time equivocator submits distinct atxs and ballots on both side of the partition, so each side of the partition crosses same global threshold in terms of weight, but for different blocks. after recovery from a partition both sides will learn about equivocation. without discarding previously counted objects both sides will be on the different side of local threshold, that break self-healing property
the solution is to keep track of objects from a particular identity. when OnMalfeasance handler is called go over such objects that are in the window and discard them from counted weight.
- local threshold should be recomputed if malicious identity has an atx in last epoch
- "good" weight for verifying tortoise should be reduced if ballots match our opinion
- if full mode was running - reduce counted weight on every block
note that it is more important to get https://github.com/spacemeshos/go-spacemesh/issues/4587 correctly first
this is actually not very clear how to do it efficiently, the brute force will scan all objects. but that would be very slow and will require keeping identities on every object. maybe it makes more sense to recount from disk. but what would be the criteria?