facebook / akd

An implementation of an auditable key directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated proofs should contain the associated root hash to solve them from the same epoch guaranteed

slawlor opened this issue · comments

In the current system, it's 2 calls to generate a root hash and a proof. This means that between proof generation and root-hash generation it's possible the epoch is advanced meaning the root hash no longer applies to the associated proof that was just generated.

A work-around for this is

  1. Get the epoch
  2. Generate the proof
  3. Get the root hash, using Directory::get_root_hash_safe which will err if the epoch changed
  4. Try again

But ideally we'd avoid this by having the proof generations just return the EpochHash as an additional result.