-
Notifications
You must be signed in to change notification settings - Fork 0
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
RLN Key Benchmarks #23
Labels
E:3.2: Basic DoS protection in production
See https://github.com/waku-org/pm/issues/70 for details
Comments
Really great work here. |
This analysis is awesome, thanks @alrevuelta!! |
Weekly Update
|
chair28980
added
the
E:3.2: Basic DoS protection in production
See https://github.com/waku-org/pm/issues/70 for details
label
Sep 19, 2023
@alrevuelta @jm-clius I added epic label 3.2 to this issue, let me know if this is not correct. |
This was referenced Oct 12, 2023
This was referenced Oct 25, 2023
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E:3.2: Basic DoS protection in production
See https://github.com/waku-org/pm/issues/70 for details
Introduction
Since RLN has been chosen as the spamming protection mechanism for waku, we must understand the practical implications of using it. This issue explains the main differences between
relay
andrln-relay
and gives some benchmarks after running simulations usingwaku-simulator
, in a network with the following characteristics:The main deltas
rln
vsrln-relay
are:proof
field inWakuMessage
containing 384 extra bytes. This field must be generated and attached to each message.proof
toAccept
orReject
the message. The proof has to be verified.But what are the practical implications of these?
TLDR:
Proof Generation Times
Seems that proof generation times stay constant no matter the size of the message. In the following simulation it was increased from:
1kB
,10kB
,50kB
,150kB
. On average it takes0.15 seconds
to calculate the message proof. This means that when a node wants to send a message, it will need to spend this time generating the proof. It seems very reasonable and it actually acts as a mini proof of work, where a consumer computer won't be able to publish a really high number of messages per second.Proof Verification Times
On the other hand, rln also adds an overhead in the gossisub validation process. On average it takes
0.012 seconds
to verify the proof. It seems that when we increase the message size, validation time seems to increase a bit, which can be for any other reason besides rln itself (eg deserializing the message might take longer).This number seems reasonable and shouldn't affect that much the average delay of a message. Assuming a d-regular graph, with
10k
nodes andD=6
, we can have up tolog(total_nodes)/log(D)=5
hops. So in the worst case, rln will add a network latency of0.012*5 = 0.06 seconds
Spam Protection
For the initial release of RLN, slashing won't be implemented and it still remains unclear if it will be implemented in the future. Luckily, even if slashing is not implemented rln can be used to detect spam and punish the sender offchain (instead of slashing an onchain collateral). This is done with gossipsub scoring.
In the following simulation, we can see
100
nwaku interconnected nodes, where one of them suddenly starts spamming the network with multiple valid rln messages3000 messages/minute
. Since its rate limiteed to 1msg/10 seconds, we can see that in almost no time, every node in the network disconnects from the spammer peer (see red node), leaving it with0 peers
, which disincentivizes such attacks and without requiring a financial slashing.RLN Tree Sync
Using RLN implies that waku should now piggyback on a blockchain (the case study uses Ethereum Sepolia) and has to stay up to date with the latest events emited by the rln smart contract. These events are used to locally construct a tree that contains all members allowed to create valid proofs to send messages. Some numbers:
2Mbytes
of space. Neglectable.520 requests
to synchronize 1 year of historical data from the tree. Assumable since most of the free endpoints out there allow 100k/day.Performance relay vs rln-relay
Same simulation with 100 nodes was executed
with rln
andwithout rln
:with rln
without rln
(*) Couldn't capture cpu metrics
(**) Minor differences in messages per seconds is due to injection technique, nothing related to rln itself.
The text was updated successfully, but these errors were encountered: