~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Every getActor and getActorGroups request scans every account on the host

Open
Open chadtmiller.com opened this issue 0 comments

What happened

groups_of loads every account (accounts(None, u32::MAX)) and reads a membership record for each, members and plain accounts alike. getActor calls it once, and getActorGroups twice (for the caller and for the actor). Each request therefore does work proportional to the whole host, and getActor needs only to know whether one group exists.

How to see it

Read against docs/fresh at 4636e6d, the code at: authorization.rs:68-78 (groups_of); actors.rs:95, :136-138. Paths are under crates/group-host/src unless they say otherwise. Severity: low.

What you expected

Look up memberships by member DID (an index of membership records by rkey across groups, or a member → groups table kept on membership writes). Make getActor stop at the first group found.

Where

The host, as built from 4636e6d. Found while checking the docs against the code.