Skip to content

feat(rln): fetch/cache merkle proofs/roots in background #2722

@adklempner

Description

@adklempner

Description

Generating an RLN proof requires a merkle proof of the user's commitment in the on-chain tree.

As new memberships are registered and the root is updated, the proof can become invalid per the acceptable_root_window_size

If the necessary RPC requests (to either get the proof, or check if proof is still valid) are performed on-demand per send, then this increases the time it takes to send a message.

User Story

As a user, I don't want the technical requirements imposed by RLN to increase the time it takes to send a message.

Proposed Solution / Feature Design

  • After a Waku node is started and an RLN identity is "loaded", perform the RPC read request to get the latest merkle proof and root for the identity and store it.
  • In the background, periodically check if a new proof/root is required per network parameters and get it if necessary. (More likely leverage eth_subscribe; event-based instead of polling-based approach)
  • RLN encoder should get the merkle proof/root from a cache updated by this service.

Optional: Diagram or Draft of Design

Notes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

To Do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions