@dcc@blockbot@charlie_root@welcomebot@p@zero The problem with that implementation I see is that it's still open for spam if the attacker times their blocks in a way that the next block is sent right after the initial cache entry has expired. It is rate-limited, sure, but you would still wake up to the gorillion notifications. Could probably be solved by increasing the amount of time the entry is stored, the suggested 5 seconds is just too little.
@dcc@blockbot@charlie_root@p@welcomebot@zero Alright, here's what I came up with. https://git.kiwifarms.net/mint/pleroma/src/branch/ryona-dev/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex Three-in-one policy for block, unfollow and report notifications, using Cachex for rate limiting. If the same kind of activity is sent to the same recepient, or if the sender sends more activities than defined in threshold, then no notification is sent. Scopes, messages, tagging, grey/blacklists, all configurable for those bad actors than want it. Lots of duplicate code which can be tidied up, but I was more concerned about whether it would work than how it looks.
@mint@dcc@blockbot@charlie_root@welcomebot@zero Yeah, that requires a lot more effort, though: the CSV upload doesn't wait five seconds, it sends the blocks out as quickly as Pleroma/Mastodon can fabricate block activities. That is accurate, though, it's still got problems; I tossed out some other ideas. Tweaking the threshold would be fine. If it's a DM, though, the extent of the problem is much more limited.