@i Yeah, I might be a bit desperate, but I think doing that and then patching pleromer to mark repeats received by relay as transient activities might improve performance a bit. For reference: pleroma=# select data->>'type', count(data->>'type') as count from activities group by data->>'type' order by count desc; ?column? | count ------------+---------- Create | 17634612 Announce | 15515144 Like | 3522886 EmojiReact | 1121150 Update | 211598 Undo | 82408 Listen | 32560 Follow | 6570 Accept | 5663 Remove | 2043 Delete | 2037 Block | 1040 Add | 950 Reject | 765 Flag | 130 Move | 55 (16 rows)
@i >i've though about doing the same but never bothered I think it can be tackled down with an MRF as well, just make it do fetch_object_by_id and then reject the Announce activity from relay.
@mint :reject feels like asking for redelivery amplification trouble, there really should just be a silent drop option :drop where it lies that the activity was accepted without error
but yes, mrf works best when the rest of the codebase is a mess
@i ** (ArgumentError) invalid right argument for operator "in", it expects a compile-time proper list or compile-time range on the right side when used in guard expressions, got: FollowingRelationship.following_ap_ids(Relay.get_actor())Retarded a bit with that, so replaced it with a regular if and force-pushed. Anyway, I think MRF rejected requests still return "ok", the refetch bug only applies to, well, refetches.
@mint maybe it's just natural overlap on the non pleroma relays i've noticed, since i can see some stuff getting fetched more than a dozen times, still seems to be working fine, i'll refine it a bit later in the morning, but your version as is seems good enough for most
@i Maybe. When I was still using standalone relays, some instances were smart enough to drop their posts right into my inbox, bypassing the relay itself. fetch_object_by_id should first try to get the object from DB/cache before trying to fetch it, so I don't think it's at blame. Using RemoteFetcherWorker might be smarter, though.
@i handle_incoming in transmogrifier handles Like/EmojiReact/Announce activities, which then get passed to ObjectValidator.fetch_actor_and_object, Object.normalize and finally the same Fetcher.fetch_object_from_id. Unless I missed something, the MRF simply bypasses some of those calls.
@mint reached the same conclusion reading over the code, i'll still do the RemoteFetcherWorker bit just so there's a retry to ddos flaky instances even further
@i Apparently the referenced objects get fetched before the Like/Announce/whatever gets filtered by MRF, just saw that behavior when adjusting the nonce filter. So, separate fetch_object_from_id is unneccessary, unless you also do this (which I did as it's needed for proper functioning). https://gitgud.io/ryonagency/pleroma/-/commit/a78c8aeb0bee0287c368a7b145de79a23cb6e351