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

bug: multiple messages published in the same second via RLN RELAY are not dropped #2371

Closed
fbarbu15 opened this issue Jan 26, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@fbarbu15
Copy link
Contributor

Problem

According to the specs I would expect a max of 1 message / sec to be relayed when using RLN as described here

To reproduce

  1. Setup a RLN RELAY node as described here (the only thing I changes is the nwaku version in docker compose yaml. I used harbor.status.im/wakuorg/nwaku:v0.24.0)
  2. After the node starts, subscribe to this topic: curl -X POST "http://127.0.0.1:8645/relay/v1/auto/subscriptions" -H "accept: text/plain" -H "content-type: application/json" -d '["/my-app/2/chatroom-1/proto"]'
  3. Send 15 publish message curl requests:
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "1Mes1sage 202222" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "2Mes23sage 202321" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "3Message 202423" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "4Messag5ge 202524" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "54 202625" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "6Message 207222" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "7Message 208221" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "8Messf2age 209223" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "9Mesgs3age 200224" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "10Mes1sag1e 20225" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "M1es2sage 20222" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "M2es231sage 20221" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "M3ess4age 20223" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "M4es5sage5 20224" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' --header 'Content-Type: application/json' --data '{"payload": "'$(echo -n "M5ess64age 20225" | base64)'","contentTopic": "/my-app/2/chatroom-1/proto", "timestamp":'$(date +%s)'}'
  1. Check that the messages were relayed via RLN RELAY in the logs and also using : curl -X GET "http://127.0.0.1:8645/relay/v1/auto/messages/%2Fmy-app%2F2%2Fchatroom-1%2Fproto" -H "accept: application/json"

Expected behavior

I would've expect some of the messages to be dropped (Aaryamann confirmed that he also expected that)

Docker logs
nwaku_docker_logs.txt

@fbarbu15 fbarbu15 added the bug Something isn't working label Jan 26, 2024
@chair28980
Copy link
Contributor

This might potentially be solved by PR currently in-progress by @gabrielmer: #2373

This is related to the API and not validation itself.

@gabrielmer gabrielmer self-assigned this Feb 5, 2024
@gabrielmer
Copy link
Contributor

Seems to be fixed by #2394

Reproducing the process with the image quay.io/wakuorg/nwaku-pr:2394, RLN validation works and the output is the following:

rln-validation

@fbarbu15
Copy link
Contributor Author

fbarbu15 commented Feb 6, 2024

Confirming the fix, it works as expected now, only 1 message/sec is allowed.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants