feat(mix): DoS protection integration - #3931
Conversation
|
You can find the image built from this PR at Built from fbb612b |
|
Thanks for that PR @chaitanyaprem |
Also it may be possible that some of the work in this PR should be ported to the other bump PR in any case (i.e. if what is done here to bump is preferred over what I did in my PR to bump) |
Makes sense, i was doing this more from a point of validating using single zerokit compiled lib for both rln relay and mix DoS protection. I got stuck and had to do this update, so i thought it would be useful for whoever is doing the bump hence checked it in. The idea is once you guys bump libp2p, i will just rebase onto that and only have mix related changes :) |
I would leave that upto you, i just took shortest and easiest path to make it work in order to test mix DoS protection simulation with zerokit-2.0.2 statless built and reused across rln relay and mix. You may have better idea if some of these changes make sense or not. Let me know once 2.0.0 bump branch is ready so that i can rebase onto it. |
1729a96 to
cc71244
Compare
412d97a to
111f0a3
Compare
|
This PR may contain changes to configuration options of one of the apps. If you are introducing a breaking change (i.e. the set of options in latest release would no longer be applicable) make sure the original option is preserved with a deprecation note for 2 following releases before it is actually removed. Please also make sure the label |
|
This PR may contain changes to database schema of one of the drivers. If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues. Please make sure the label |
111f0a3 to
d529be1
Compare
efe5e1e to
3f0f14c
Compare
3f0f14c to
eea07b1
Compare
Ivansete-status
left a comment
There was a problem hiding this comment.
Some comments so far. Thanks!
RLN-based DoS/spam protection for the mix protocol, adaptive mix-peer discovery, and the libp2p v2.1.4 / nim-libp2p-mix master dependency bump. - Integrates mix-rln-spam-protection-plugin: mix messages carry an RLN proof, intermediate hops verify it, per-sender rate limiting via userMessageLimit. - Stateless RLN (Nim-side IMT, ffi_verify_with_roots; no local Merkle tree). - DoS self-registration split into a background retry task off the startup path. - Spam-protection coordination over Waku filter (waku_mix_coordination.nim). - Adaptive mix-peer discovery: generic runServicePeerTopUp loop pulls more mix-service peers via the ServicePeersRequest broker below target pool size. - Deps: libp2p == 2.1.4 (version form, matching mix/plugin requirements), libp2p_mix master (c387ca6, LIONESS/LIP-183), mix-rln-spam-protection-plugin main (135182b, plugin#12), lsquic v0.5.6. - libp2p/utility removed upstream (nim-libp2p 77fc086ac); imports moved to libp2p/utils/*. PublishCallback now returns Future[Result[void, string]]. - chat2mix demo + mixnet sim harness (simulations/mixnet/).
be96757 to
0bcd2b3
Compare
Adds DoS / spam protection to the mix protocol (RLN-based).
What's in this PR
Mix DoS / spam protection (RLN)
mix-rln-spam-protection-plugininto the mix protocol — mix messages carry an RLN proof, intermediate hops verify it, per-sender rate-limited viauserMessageLimit. (waku_mix/protocol.nim,waku_node.nim)ffi_verify_with_roots; no local Merkle tree).waku_mix_coordination.nim, new).libp2p v2.1.4 bump
libp2pmoves from thenim-libp2p.git#v2.0.0git-URL pin to the version formlibp2p == 2.1.4.nim-libp2p-mixmaster and the RLN plugin both requirelibp2p == 2.1.4by package name, and nimble treats a git-URL pin and a name+version requirement as distinct packages — the diamond only collapses when every side uses the same form.libp2p_mix→ master (c387ca6), which carries the v2.1.4 bump (chore: bump libp2p to v2.1.4 logos-co/nim-libp2p-mix#23) and LIONESS wide-block payload encryption (feat(sphinx): LIONESS wide-block payload encryption (LIP-183) logos-co/nim-libp2p-mix#30, LIP-183).mix-rln-spam-protection-plugin→main(135182b, chore: pin libp2p to v2.1.4 release tag logos-co/mix-rln-spam-protection-plugin#12, merged).lsquicv0.5.1 → v0.5.6 (libp2p requires>= 0.5.4);metrics0.2.2 andprotobuf_serialization0.5.3 resolved intonimble.lock.libp2p/utility(vacp2p/nim-libp2p77fc086ac, "unify and dedup utilities") and split it intolibp2p/utils/*. 15 call sites now importutils/shortlogorutils/opt, or drop the import where it had become unused — import-only changes.PublishCallbacknow returnsFuture[Result[void, string]], sowaku_mixpropagates coordination-publish failures instead of swallowing them.switch("import", ".../compat/option_valueor")fromconfig.nims: master'sOption→Optmigration (chore: replace Option with Opt #4035) removed that compat module, so the implicit import was dangling.Adaptive mix-peer discovery — generic
runServicePeerTopUploop pulls more mix-service peers via theServicePeersRequestbroker while the pool is below target; keepsWakuKademliageneric.Minor — chat2mix demo + mixnet sim harness (
simulations/mixnet/); dep pins (mix-rln-spam-protection-plugin,libp2p_mix,nim-sds); small build/test fixes.Validation
wakunode2+chat2mixbuild clean against libp2p 2.1.4 on the rebased base.Spam protection proof verified successfullyat every relaying hop; message delivered back to the subscribed client via filter push.tests/waku_kademlia, previously 14/14) has not been re-run since the 2.1.4 bump and rebase — worth a CI pass before merge.