diff --git a/tests/v2/test_waku_rln_relay.nim b/tests/v2/test_waku_rln_relay.nim index ced25033a..14949a14a 100644 --- a/tests/v2/test_waku_rln_relay.nim +++ b/tests/v2/test_waku_rln_relay.nim @@ -246,7 +246,7 @@ procSuite "Waku rln relay": debug "expected root ", expectedRoot # start rln-relay - node.mountRelay() + node.mountRelay(@[RLNRELAY_PUBSUB_TOPIC]) await node.mountRlnRelay(ethClientAddrOpt = some(EthClient), ethAccAddrOpt = some(ethAccountAddress), memContractAddOpt = some(membershipContractAddress), groupOpt = some(group), memKeyPairOpt = some(keypair.get()), memIndexOpt = some(index), pubsubTopic = RLNRELAY_PUBSUB_TOPIC) let calculatedRoot = node.wakuRlnRelay.rlnInstance.getMerkleRoot().value().toHex debug "calculated root ", calculatedRoot @@ -280,7 +280,7 @@ procSuite "Waku rln relay": let index = MembershipIndex(5) # -------- mount rln-relay in the off-chain mode - node.mountRelay() + node.mountRelay(@[RLNRELAY_PUBSUB_TOPIC]) await node.mountRlnRelay(groupOpt = some(groupIDCommitments), memKeyPairOpt = some(groupKeyPairs[index]), memIndexOpt = some(index), onchainMode = false, pubsubTopic = RLNRELAY_PUBSUB_TOPIC) # get the root of Merkle tree which is constructed inside the mountRlnRelay proc diff --git a/waku/v2/protocol/waku_rln_relay/parameters.key b/waku/v2/protocol/waku_rln_relay/parameters.key index 8691479c3..9829416d9 100644 Binary files a/waku/v2/protocol/waku_rln_relay/parameters.key and b/waku/v2/protocol/waku_rln_relay/parameters.key differ diff --git a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim index 6e112e05c..e510560e4 100644 --- a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim +++ b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim @@ -44,7 +44,7 @@ type MembershipIndex* = uint const MEMBERSHIP_FEE* = 5.u256 # the current implementation of the rln lib only supports a circuit for Merkle tree with depth 32 - MERKLE_TREE_DEPTH* = 32 + MERKLE_TREE_DEPTH* = 20 # TODO the ETH_CLIENT should be an input to the rln-relay, though hardcoded for now # the current address is the address of ganache-cli when run locally ETH_CLIENT* = "ws://localhost:8540/" @@ -67,5 +67,5 @@ const # STATIC_GROUP_MERKLE_ROOT is the root of the Merkle tree constructed from the STATIC_GROUP_KEYS above # only identity commitments are used for the Merkle tree construction # the root is created locally, using createMembershipList proc from waku_rln_relay_utils module, and the result is hardcoded in here - STATIC_GROUP_MERKLE_ROOT* = "25e03b7d551c3016cb21c057a113be5bf27eaa9b2529e806715bc0a1ef221e07" + STATIC_GROUP_MERKLE_ROOT* = "a1877a553eff12e1b21632a0545a916a5c5b8060ad7cc6c69956741134397b2d" diff --git a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim index 9da35e202..f12e4e9f6 100644 --- a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim +++ b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim @@ -28,11 +28,15 @@ proc createRLNInstance*(d: int = MERKLE_TREE_DEPTH): RLNResult var rlnInstance: RLN[Bn256] merkleDepth: csize_t = uint(d) - # parameters.key contains the parameters related to the Poseidon hasher - # to generate this file, clone this repo https://github.com/kilic/rln - # and run the following command in the root directory of the cloned project - # cargo run --example export_test_keys - # the file is generated separately and copied here + ## parameters.key contains the prover and verifier keys + ## to generate this file, clone this repo https://github.com/kilic/rln + ## and run the following command in the root directory of the cloned project + ## cargo run --example export_test_keys + ## the file is generated separately and copied here + ## parameters are function of tree depth and poseidon hasher + ## to generate parameters for a different tree depth, change the tree size in the following line of rln library + ## https://github.com/kilic/rln/blob/3bbec368a4adc68cd5f9bfae80b17e1bbb4ef373/examples/export_test_keys/main.rs#L4 + ## and then proceed as explained above parameters = readFile("waku/v2/protocol/waku_rln_relay/parameters.key") pbytes = parameters.toBytes() len : csize_t = uint(pbytes.len)