Closed adklempner closed 5 months ago
- afaik
v0.4.x
only supports RLNv2 andv0.3.x
is for RLNv1. Since The Waku Network (and Waku in general) is not yet using RLNv2, I would say we need to use the latestv0.3.6
(RLN v1) as the baseline. I assume in js-waku you still point to that one?
Yes, this was my mistake.
- Perhaps
wasm_get_serialized_rln_witness_with_proof
is not needed?. I mean, you can generate the witness yourself without using zerokit (example using go) and then directly usegenerate_rln_proof_with_witness
with your witness constructed in js-waku. Nothing against exposing it though, but feels more complex (requires modifying zerokit, extra call to wasm, some ugly serde, etc)
I think this makes more sense, I will try it.
- So unless I'm missing something, I would say there is no need to modify zerokit for the PoC you are developing in js-waku. One interesting abstraction could be to have a
generate_rln_proof_with_merkle_proof
that gets everything: merkle proof, message hash, epoch, secret, etc. So instead of requiring to i) generate witness and ii) generate rln proof with witness, you can do everything in just 1 function call. But again, a mere nice to have.In case that helps, here is how I did it in go.
I agree, that would be ideal. If we move forward with this beyond PoC, I think it's worth considering.
Closing this as it was not necessary for the PoC
Benchmark for 27db555
Click to view benchmark
| Test | Base | PR | % | |------|--------------|------------------|---| | Pmtree::compute_root | 0.0±0.00ns | 0.0±0.00ns | NaN% | | Pmtree::get | 321.8±10.34ns | 317.9±5.14ns | -1.21% | | Pmtree::override_range | **229.5±3.47µs** | 235.9±7.24µs | **+2.79%** | | Pmtree::set | 54.3±0.95µs | 54.4±1.89µs | +0.18% | | Pmtree:delete | 54.3±0.64µs | 54.4±1.66µs | +0.18% |