Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate RLN v2 into waku-simulator #44

Closed
alrevuelta opened this issue Apr 23, 2024 · 3 comments
Closed

Integrate RLN v2 into waku-simulator #44

alrevuelta opened this issue Apr 23, 2024 · 3 comments
Assignees

Comments

@alrevuelta
Copy link
Collaborator

Integrate RLN v2 into waku-simulator

@stubbsta
Copy link
Contributor

Here is a very basic test plan to verify the RLNv2 functionality:
https://www.notion.so/Waku-RLNv2-End-to-End-Testing-with-Waku-simulator-6f50a5613eb44ae38e2dbbcfa72b7417

@stubbsta
Copy link
Contributor

stubbsta commented May 9, 2024

Here is an overview of the objective for the RLNv2 testing and how we alter the nwaku code in order to bypass the API checks:

  1. We want to publish a message or messages using the API as entry point (just because this is the most convenient/quick way) and we want to be able to exceed the message limit to verify that the message is then not published and the stats should show this is an Invalid/Spam RLN Message.
    -I would want to test this with autosharding and the default Pubsub-topic by simply sending a POST e.g.
 curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
 -H "content-type: application/json" \
 -d '{"payload":"'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'","contentTopic":"/my-app/2/chatroom-1/proto"}'

Obstacles/side quests:

  1. The API does some of message validity checks which fail if the message limit is exceeded.
    this is solved by commenting out the validateMessage calls in handlers.nim
  2. The method which appends the RLN proof to the message does a nonce value check
  • the nonce is basically a counter to check how many messages have already been sent in a single epoch
  • this is bypassed by commenting out the nonce limit check in nonce_manager.nim
  1. The method which appends the RLN proof to the message uses the nonce value as the messageId parameter for generating the proof and will fail if the messageId exceeds the message limit or if the messageId is the same within the same epoch.

@alrevuelta
Copy link
Collaborator Author

Closed by #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants