indy-sdk icon indicating copy to clipboard operation
indy-sdk copied to clipboard

Fix caching bug

Open mirgee opened this issue 5 years ago • 0 comments

Currently, when multiple revokable credentials are issued under the same revocation revocation registry to a single vcx client, when the client is sent multiple proof requests such that each credential is valid for different proof request, the first generate proof will be valid, and all the remaining ones will be invalid.

This behavior is caused by the following two isses with the revocation state cache:

1.) it assumes that prover will never use more than one rev_id per rev_reg_id, so in the scenario above it is caching the witness for the first credential and reusing it when generating proof using the second credential 2.) it loads the revocation state from the cache even when the proof request does not specify revocation interval

This fix uses compounded key of (rev_id, rev_reg_id) for the cache to fix 1.), and if the to value of the revocation interval is not set, assumes current time and always uses value from the ledger and updates cache to fix 2.). (If from is not set, it assumes 0 and based on to either loads from cache or uses the value on ledger and updates the cache).

Signed-off-by: Miroslav Kovar [email protected]

mirgee avatar May 07 '20 17:05 mirgee