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: Valid messages identified as spam when other nodes are registering memberships #2879

Open
stubbsta opened this issue Jul 4, 2024 · 3 comments
Labels
bug Something isn't working effort/days Estimated to be completed in a few days, less than a week

Comments

@stubbsta
Copy link

stubbsta commented Jul 4, 2024

Problem

During RLN testing with different network sizes and RLN config, it was noticed that sometimes when there are many consecutive RLN membership registrations occurring and many messages published by other already registered nodes, then some messages in the network are identified as spam.
This happens while the messaging rate is well within the RLN limits and should not lead to any spam messages being identified by the nodes.

Impact

These messages are not spam and should be relayed. This erroneous identification of spam messages could lead to nodes disconnecting from a peer because it seems like it is spamming

To reproduce

Using the waku-simulator https://github.com/waku-org/waku-simulator:

  1. env. config:
NWAKU_IMAGE=harbor.status.im/wakuorg/nwaku:v0.30.0
NUM_NWAKU_NODES=1
RLN_RELAY_EPOCH_SEC=60
RLN_RELAY_MSG_LIMIT=400
TRAFFIC_DELAY_SECONDS=0
MSG_SIZE_KBYTES=3
MAX_MESSAGE_LIMIT=400
  1. Run the simulator and wait for the network to stabilise and start publishing messages
  2. Run this command to register multiple RLN memberships consecutively:
docker run --network waku-simulator_simulation alrevuelta/go-waku-light:4fe5a81 \
--eth-endpoint=http://foundry:8545 \
--contract-address=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \
register \
--priv-key=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--user-message-limit=150 \
--amount=20
  1. It may be necessary to increase the amount of memberships to register or run the command again.

Expected behavior

These messages should be valid.

Screenshots/logs

nwaku node logging:

TRC 2024-07-04 11:40:59.581+00:00 invalid message: message is spam           topics="waku rln_relay" tid=1 file=rln_relay.nim:256 payloadLen=3000
TRC 2024-07-04 11:40:59.581+00:00 A spam message is found! yay! discarding:  topics="waku rln_relay" tid=1 file=rln_relay.nim:383 proof=d0c8d5b3cfebe75dd773a3efb3e06d2d154f3e41a52f84e63f3ab6e928113f202914fab70a92899fb878d7bfa5b7b9c5f5b69b02472f8ac4e9e3e3c388dba314b3b9fa844e8e444514f1a064c94ae068a12af914b54ce6cb385599a8eab3cb2304460643c02a91b312f872e4b4f99a7f7509adc36d497d75a6751184ca22b484 root=138076aa32fc3631a87925c59fd133498693439c156d2eecc60173f17df05a40 shareX=2b06d443c3f3f1a9684371f53e5a4d69865de259b5eea3b214d91906234ffbc7 shareY=17731cf4ed543686e12ffba5ccca142378c4c9a0271ae12bb57ae7a57d5482e4 nullifier=286720e66ed183aef36dd38b5c4a1fcf11d6bfe39abe4bbae70cb1739143006d

Membership registration logging:

time="2024-07-04T11:40:55Z" level=info msg="Waiting for tx to be validated..."
time="2024-07-04T11:40:58Z" level=info msg="Tx validated. Receipt: &{2 [] 1 241595 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0 0 128 0 0 0 0 0 0 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0xc000264bb0] 0x58bfbc4c145e6d4c16efffc9836a341dae53e688a6741e5256ce2728da2b70ff 0x0000000000000000000000000000000000000000 241595 1000000007 0x42c080b43b12ab1c9f774f65b52837f8147d19da12a8e7e92e50f3b37498f1a4 688 0}"
time="2024-07-04T11:40:58Z" level=info msg="Tx sent. Nonce: 44 Commitment: 11533823924293895139412530338751036828958194326498325842309615614090360719692 UserMessageLimit: 400 TxHash: 0xe9efb9e4c5e96f28b473f03091995c6e13f0da0ad2bedcb43ef7e5a4c7f7e44b"
time="2024-07-04T11:40:58Z" level=info msg="Waiting for tx to be validated..."
time="2024-07-04T11:41:01Z" level=info msg="Tx validated. Receipt: &{2 [] 1 109706 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0 0 128 0 0 0 0 0 0 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0xc000264e70] 0xe9efb9e4c5e96f28b473f03091995c6e13f0da0ad2bedcb43ef7e5a4c7f7e44b 0x0000000000000000000000000000000000000000 109706 1000000007 0xa4a4474cb835a96d2a72a31f756655011adf2df2be58b1536ca3b1b8585e5b80 689 0}"
time="2024-07-04T11:41:01Z" level=info msg="Waiting for the root to be propagated to the network..."

nwaku version/commit hash

v0.30.0

@stubbsta stubbsta added the bug Something isn't working label Jul 4, 2024
@rymnc
Copy link
Contributor

rymnc commented Jul 4, 2024

this is a variant of #2870, right?
but here, the messages are counted as spam instead of invalid.
perhaps duplicated messages are being propagated?

@stubbsta
Copy link
Author

stubbsta commented Jul 4, 2024

I'm not sure if it's a variant or a different bug occurring in the same scenarios.
With the specific config mentioned here where only 1 full node is present, I don't see invalid messages at all, only the spam.
I have seen the spam and invalid messages happen with the same config mentioned in #2870, but not at the exact same time.

@stubbsta
Copy link
Author

stubbsta commented Jul 4, 2024

FYI: the invalid messages issue occurs a lot more often than the spam messages issue

@Ivansete-status Ivansete-status added the effort/days Estimated to be completed in a few days, less than a week label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort/days Estimated to be completed in a few days, less than a week
Projects
Status: To Do
Development

No branches or pull requests

3 participants