mjolnir icon indicating copy to clipboard operation
mjolnir copied to clipboard

Apply bans before ACLs

Open grahamc opened this issue 3 years ago • 5 comments

In my instance it takes 2x longer to apply ACLs than new bans (16s vs. 8s). However, I very infrequently apply ACLs. The goal of this change is to reduce the time to apply moderation action.

grahamc avatar Dec 07 '21 01:12 grahamc

Hey @grahamc , thanks for taking a look at this.

It is interesting that it takes longer to apply server ACL than member bans. From what I can see, the pain points are probably either asking for the m.room.server_acl state event or sending the update afterwards, but it's not certain.

I'm worried that there is a risk by changing the order since larger and more severe raids will take place over federation rather than at the individual member level, and delaying action in that case would seem to have greater consequences than in the current order (ACL before member bans).

What's you opinion about that?

I'm interested to know if anyone else has an opinion about this too?

Gnuxie avatar Dec 09 '21 17:12 Gnuxie

I don't have strong feelings about this PR. I also haven't had severe raids. It does seem to me that the most user-forward option would be applying whatever the user just did first. ie: not calling a generic "Sync the ban stuff" function, but saying "apply this ban now!" or "apply this ACL now!"

grahamc avatar Dec 10 '21 01:12 grahamc

We could actually make both happen concurrently, to some extent, thanks to the magic of async. Wouldn't that be even better?

@Gnuxie What do you think?

Alternatively, we could make this a setting.

Yoric avatar Feb 07 '22 11:02 Yoric

I think doing them concurrently (but still room by room) will be a good idea if applied with a suggestion by Travis to apply bans to the most recently active rooms first. If there is an urgent situation, then the most active room is probably going to be the one under attack and will be seen to first, so this works out quite nicely.

Gnuxie avatar Apr 04 '22 16:04 Gnuxie

Hey @grahamc , what do you think of the changes we made in https://github.com/matrix-org/mjolnir/pull/274 did they help with this and should we close?

Gnuxie avatar Sep 13 '22 15:09 Gnuxie

Looks great!

grahamc avatar Feb 07 '23 14:02 grahamc