Distribute Open invitations to K users
This MR changes the way that open invitations are distributed based on a constant OPENINV_K
, which is currently set to 10.
Before: an open invitation bucket was chosen randomly from the list of open invitation buckets.
Now: an open invitation bucket is chosen randomly from the list of open invitation buckets for the first user, then the same bucket is given to the next 9 users. After that, the cycle starts again.
Since the trust migration tables are created when a new open invtation bucket is inserted into the bridge table, open invitation buckets can be removed from Lox bridgedb's list of open invitation buckets once they are distributed to the first user and appended to a vector of distributed buckets and read from the end of the vector until we reach OPENINV_K. When bridges are blocked or the bucket expires as an open invitation bucket (it has been an open invitation bucket for 511 days or more), the open invitation as well as distributed bucket lists are cleaned up.
Addresses #25 (closed).
Merge request reports
Activity
added Anti-Censorship Sponsor 96 labels
assigned to @onyinyang
added 1 commit
- 1b49bf83 - Change open invite logic to distribute to k users
added 1 commit
- 418320ee - Change open invite logic to distribute to k users
added 1 commit
- 3c73c3f3 - Change open invite logic to distribute to k users
requested review from @meskio
Note that this is almost definitely not the best nor even an alpha-ready solution, but is a first step that gets us to: distribute each open entry bridge/bucket to k users. I think for MVP we should at least also include an upper bound on the number of buckets that are distributed each day.
Edited by onyinyangadded 15 commits
-
3c73c3f3...a01619de - 14 commits from branch
tpo/anti-censorship:main
- faf40caf - Change open invite logic to distribute to k users
-
3c73c3f3...a01619de - 14 commits from branch
mentioned in issue #25 (closed)