Skip to content

Clean unused pseudonyms when reducing cache size for identities pre-generation (both fp256bn and bn254) #1820

Description

@antoinearnould

Problem

Bug description
When the pseudonym cache size is reduced, previously generated cached pseudonyms are not cleaned up after restart.

Current behavior
We currently have two cache settings:

mspCacheSize: cached pseudonyms for MSP Idemix (fp256bn)
defaultCacheSize: cached pseudonyms for wallet Idemix (bn254)
For example, if both values are set to 1000, the service pre-generates 1000 pseudonyms for each cache/pool.

If the configuration is later changed from 1000 to 10 for both settings, and the service is restarted, the previously generated 1000 pseudonyms per pool remain on disk. The service then creates a new cache using the updated value (10), but the old unused pseudonyms are not removed.

Expected behavior
When the cache size is reduced, the service should provide a way to clean up or remove pseudonyms inherited from the previous cache size, for both:

MSP Idemix (Fabric)
Wallet Idemix (FTS)

Impact
In a simple case with 1 wallet / 1 MSP, this leaves unused pseudonyms on the filesystem.

In our real use case, we have ~500 wallets, which results in thousands of unused pseudonyms accumulating on disk and requiring manual cleanup, with no easy way to identify and delete them safely without risking deleting relevant identities.

Suggested improvement
Add a mechanism to detect and remove obsolete cached pseudonyms when cache settings are reduced, or provide an explicit cleanup operation for unused pseudonyms from previous cache generations.

Observed in latest FTS version with Fabric 2.5 and Fabric Smart Client.

Solution

  • Add a function or an algorithm, a script, to clean unused cached pseudonyms for MSP and wallet identities.

Alternatives

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions