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

fix(rln): error in api when rate limit #2212

Merged
merged 3 commits into from
Nov 21, 2023
Merged

fix(rln): error in api when rate limit #2212

merged 3 commits into from
Nov 21, 2023

Conversation

alrevuelta
Copy link
Contributor

When using the rest api to publish messages with rln, eg:

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"}'

It should error when a message is expected to be considered as spam by the network. This is very important, because otherwise the user would expect the message to arrive, while it was rejected due to being rate limited.

Using validateMessage does not work, because that doesn't update the nullifier log. Using validateMessageAndUpdateLog instead, which does the same + update the nullifier.

cc @rymnc

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks 💯 !

Copy link

github-actions bot commented Nov 10, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2212

Built from 1744f39

Copy link
Contributor

@rymnc rymnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this!

@alrevuelta alrevuelta merged commit 51f3609 into master Nov 21, 2023
9 of 10 checks passed
@alrevuelta alrevuelta deleted the fix-rln-api branch November 21, 2023 18:24
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

Successfully merging this pull request may close these issues.

None yet

3 participants