-
Notifications
You must be signed in to change notification settings - Fork 60
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): track last seen event #1296
Conversation
# TODO: check the index and the pubkey depending on | ||
# the group update operation | ||
var handler: GroupUpdateHandler | ||
handler = proc(pubkey: Uint256, index: Uint256): RlnRelayResult[void] {.raises: [Defect].} = |
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.
As part of the member deletion feature, this handler will soon take in an additional argument, GroupUpdateType
, which will be either Insertion
or Deletion
, and then we can handle those cases separately.
Jenkins BuildsClick to see older builds (24)
|
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.
The PR looks good to me, but I'm still not sure about using the last seen index as indicator. See #1265 (comment).
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.
Thanks, please see my comments below.
|
||
|
||
proc handleGroupUpdates*(rlnPeer: WakuRLNRelay, handler: RegistrationEventHandler) {.async, gcsafe.} = | ||
proc handleGroupUpdates*(rlnPeer: WakuRLNRelay) {.async, gcsafe.} = | ||
# mounts the supplied handler for the registration events emitting from the membership contract |
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.
Do these comments still hold?
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 582a6c3
ethAccountAddress: Option[Address] = none(Address), | ||
contractAddress: Address, | ||
blockNumber: string = "0x0", | ||
handler: GroupUpdateHandler) {.async, gcsafe.} = | ||
## connects to the eth client whose URI is supplied as `ethClientUri` |
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.
Please update the proc description to match the new semantics.
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 582a6c3
@@ -945,20 +976,25 @@ proc subscribeToGroupEvents(ethClientUri: string, ethAccountAddress: Option[Addr | |||
|
|||
proc startSubscription(web3: Web3) {.async, gcsafe.} = |
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.
Why do we need to have a separate proc for this, why not just call the subscribeToMemberRegistrations
proc?
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.
Eventually, when we have the reconnection logic, it becomes easier to resubscribe to events from the last processed block.
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 ✅
Should resolve #1265
Tracks the last seen event and stores it on the WakuRlnRelay instance so that it can be reused in the eth node reconnection feature