facebook / akd

An implementation of an auditable key directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add usage of VRF map for already-existing labels in Directory::publish()

kevinlewi opened this issue · comments

In #295, we introduced a VRF map in directory publish that precomputes the VRF labels in parallel.

This map is used for the case where a label has not been encountered before, like so: https://github.com/novifinancial/akd/blob/main/akd/src/directory.rs#L147-L151

However, it is not used for the case where a label has already been encountered, see: https://github.com/novifinancial/akd/blob/main/akd/src/directory.rs#L169-L176

In this second case, note that we actually do two VRF computations, one for the stale label and one for the fresh label. We should add usage of the VRF map for this case as well.

cc: @slawlor