chore(rln-relay): deprecate tree sync strategy
Opened this issue · 4 comments
Background
With the changes to the rln-v2 contracts, it is now possible to fetch the merkleProofElements from the contract and use that to generate proofs instead.
Details
Add a proc to the contract definition in
nwaku/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim
Lines 31 to 50 in 8d107b0
# this function returns the merkleProof for a given index
proc merkleProofElements(index: Uint32): seq[Uint256] {.view.}
and fetch it every time an event is emitted by the contract. Use this to generate proofs instead.
Acceptance criteria
A list of tasks that need to be done for the issue to be considered resolved.
- Cache the root of the tree every time an event is emitted by the contract
- Use the new api in zerokit to generate proofs by passing in the serialized witness
- Cache the merkleProof every time an event is emitted by the contract
- Override the GroupManager.generateProof in the OnchainGroupManager by using the custom witness we will pass in
This issue is blocked at the moment due to our nim-web3 dependency being out of date. The version we use does not support returning a sequence of elements from the smart contract.
After bumping to the latest version of nim-web3, transaction signing seems to not work as expected, and hence we're blocked
@seemenkina I know with this issue being blocked your focus has been elsewhere, but do you know if there's an update on the nim-web3 limitation?
@jm-clius as I see yesterday they started using a newer version of nim in the dependencies - I suspect it will now be possible to continue with this task
@seemenkina, thanks for the feedback. My understanding from nwaku is that the dependencies in nwaku will be updated within the next few days. :) cc @NagyZoltanPeter