BrightID-Node
BrightID-Node copied to clipboard
Stop calculating a verification per user for each app/expression in scorer
The scorer has an apps
verification calculation beside the bitu
, meets
, etc that loops over all users and evaluates all existing verification expressions for the user, and inserts a document into the verifications collection for each expression that the user is verified for.
These verification documents are used by the batch verification querying endpoint in v5:
https://node.brightid.org/brightid/v5/verifications/{app}
Calculating these verifications and inserting them in the database is very time-consuming and can be removed if we update the batch verification endpoint in v5 to simply return all the linked users for the app without checking if they are verified or not.
The linking process in v5 can also be updated to prevent users that are not verified to link. In this way returning the list of all links in the batch verification endpoint is almost equivalent to returning the list of verified users of the app.
But v5 apps should still be encouraged to not rely on this endpoint result as a verification method because it will include the links that was verified in past but are not anymore. Apps should rely on the single verification endpoint instead.