-
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
feat(rln-relay-v2): nonce/messageId manager #2413
Conversation
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 |
You can find the image built from this PR at
Built from 7c704b5 |
2c4eaf0
to
c3e7c58
Compare
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.
lgtm, minor comment.
|
||
proc get*(n: NonceManager): NonceManagerResult[Nonce] = | ||
let now = getTime().toUnixFloat() | ||
var retNonce = n.nextNonce |
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.
in the if/else you set the value of retNonce
in both cases. So this assigment will be overridden no matter what? Meaning its not needed?
or well, you can avoid the else, something like?
var retNonce = n.nextNonce
if now - n.lastNonceTime >= n.epoch:
retNonce = 0
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 699a5bc
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.
LGTM Thanks!
Description
This PR introduces a new submodule within
waku_rln_relay
, called theNonceManager
which provides functionality to fetch the next givennonce
/messageId
on a per epoch basis which is required to generate rln-v2 proofs.It also fixes the bad function signature of
appendRLNProof
which previously returned a boolean upon execution. It now returns a result.Changes
How to test
RLN_V2=true make -j16 test
is broken at the moment since the onchain/static group manager tests have not been updated yet. However, the NonceManager is independent of those changes, and can be run, and has not been guarded by therln_v2
feature flag upon runningmake -j16 test
Issue
closes #2415