Open dshulyak opened 1 year ago
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?
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.
note that it is more important to get https://github.com/spacemeshos/go-spacemesh/issues/4587 correctly first