-
Notifications
You must be signed in to change notification settings - Fork 57
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-relay): clear nullifier log only if length is over max epoch gap #2836
Conversation
You can find the image built from this PR at
Built from 6cc5fce |
6442063
to
32b3f6f
Compare
Thanks for this. Would it be possible to add a unit test to catch this edge case? |
6463775
to
6363e7a
Compare
6363e7a
to
ef242e7
Compare
added in ef242e7, previously we did not test for multiple epoch sizes, this test ensures it for 1,5,10,30, and 60. |
|
||
check: wakuRlnRelay.nullifierLog.len().uint == rlnMaxEpochGap | ||
|
||
# append one more now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two things:
wondering if all this repeated code can be avoided by reusing the for i in 0..<rlnMaxEpochGap:
. unsure if removing the <
may help? afaik the intention here is to add rlnMaxEpochGap + 1 nullifier and see that clearNullifierLog
doesn't clean them.
and for completeness, perhaps we should check that clearNullifierLog
does clean the log when expected? meaning i keep adding and len
()keeps being
rlnMaxEpochGap`?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 7a9ee74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
* CHANGELOG.md add info for v0.30.0 * fix(rln-relay): clear nullifier log only if length is over max epoch gap (#2836) * chore: add TWN parameters for RLNv2 (#2843) * fix(rln): nullifierlog vulnerability (#2855) * chore(rln-relay): add chain-id flag to wakunode and restrict usage if mismatches rpc provider (#2858) --------- Co-authored-by: Aaryamann Challani <[email protected]> Co-authored-by: Alvaro Revuelta <[email protected]>
chore: Update master from release v0.30 (#2866) * CHANGELOG.md add info for v0.30.0 * fix(rln-relay): clear nullifier log only if length is over max epoch gap (#2836) * chore: add TWN parameters for RLNv2 (#2843) * fix(rln): nullifierlog vulnerability (#2855) * chore(rln-relay): add chain-id flag to wakunode and restrict usage if mismatches rpc provider (#2858) --------- Co-authored-by: Aaryamann Challani <[email protected]> Co-authored-by: Alvaro Revuelta <[email protected]>
Description
Fixes an edge case where the nullifier log was cleared when maxEpochGap == nullifierLog.len
Changes