diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 025ef880d7..1745146a09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,12 +54,11 @@ jobs: strategy: fail-fast: false matrix: - rln_version: [1, 2] os: [ubuntu-latest, macos-13] runs-on: ${{ matrix.os }} timeout-minutes: 60 - name: build-${{ matrix.os }}-rln-v${{ matrix.rln_version }} + name: build-${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v3 @@ -78,7 +77,7 @@ jobs: key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }} - name: Build binaries - run: make RLN_V${{matrix.rln_version}}=true V=1 QUICK_AND_DIRTY_COMPILER=1 all tools + run: make V=1 QUICK_AND_DIRTY_COMPILER=1 all tools test: needs: changes @@ -86,12 +85,11 @@ jobs: strategy: fail-fast: false matrix: - rln_version: [1, 2] os: [ubuntu-latest, macos-13] runs-on: ${{ matrix.os }} timeout-minutes: 60 - name: test-${{ matrix.os }}-rln-v${{ matrix.rln_version }} + name: test-${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v3 @@ -120,7 +118,7 @@ jobs: export MAKEFLAGS="-j1" export NIMFLAGS="--colors:off -d:chronicles_colors:none" - make RLN_V${{matrix.rln_version}}=true V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test testwakunode2 + make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test testwakunode2 build-docker-image: needs: changes diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index acfd078194..99cee03028 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -22,12 +22,11 @@ jobs: build-docker-image: strategy: matrix: - rln_version : [1, 2] os: [ubuntu-latest] runs-on: ${{ matrix.os }} timeout-minutes: 60 - name: docker-build-${{ matrix.os }}-rln-v${{ matrix.rln_version }} + name: docker-build-${{ matrix.os }} outputs: image: ${{ steps.build.outputs.image }} steps: @@ -67,12 +66,12 @@ jobs: if: ${{ steps.secrets.outcome == 'success' }} run: | - make RLN_V${{matrix.rln_version}}=true -j${NPROC} V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative -d:postgres" wakunode2 + make -j${NPROC} V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative -d:postgres" wakunode2 SHORT_REF=$(git rev-parse --short HEAD) TAG=$([ "${PR_NUMBER}" == "" ] && echo "${SHORT_REF}" || echo "${PR_NUMBER}") - IMAGE=quay.io/wakuorg/nwaku-pr:${TAG}-rln-v${{matrix.rln_version}} + IMAGE=quay.io/wakuorg/nwaku-pr:${TAG} echo "image=${IMAGE}" >> $GITHUB_OUTPUT echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT diff --git a/Makefile b/Makefile index edcdf7a9b8..faad25ea9d 100644 --- a/Makefile +++ b/Makefile @@ -139,11 +139,7 @@ clean: | clean-libbacktrace .PHONY: librln shouldUseRLNV2 LIBRLN_BUILDDIR := $(CURDIR)/vendor/zerokit -ifeq ($(RLN_V2),true) LIBRLN_VERSION := v0.4.4 -else -LIBRLN_VERSION := v0.3.7 -endif ifeq ($(OS),Windows_NT) LIBRLN_FILE := rln.lib @@ -155,12 +151,7 @@ $(LIBRLN_FILE): echo -e $(BUILD_MSG) "$@" && \ ./scripts/build_rln.sh $(LIBRLN_BUILDDIR) $(LIBRLN_VERSION) $(LIBRLN_FILE) -shouldUseRLNV2: -ifeq ($(RLN_V2),true) - $(eval NIM_PARAMS += -d:rln_v2) -endif - -librln: | $(LIBRLN_FILE) shouldUseRLNV2 +librln: | $(LIBRLN_FILE) $(eval NIM_PARAMS += --passL:$(LIBRLN_FILE) --passL:-lm) clean-librln: diff --git a/apps/chat2/chat2.nim b/apps/chat2/chat2.nim index 64ab61c392..42e2461b1a 100644 --- a/apps/chat2/chat2.nim +++ b/apps/chat2/chat2.nim @@ -542,27 +542,16 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} = echo "rln-relay preparation is in progress..." - when defined(rln_v2): - let rlnConf = WakuRlnConfig( - rlnRelayDynamic: conf.rlnRelayDynamic, - rlnRelayCredIndex: conf.rlnRelayCredIndex, - rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress, - rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress), - rlnRelayCredPath: conf.rlnRelayCredPath, - rlnRelayCredPassword: conf.rlnRelayCredPassword, - rlnRelayUserMessageLimit: conf.rlnRelayUserMessageLimit, - rlnEpochSizeSec: conf.rlnEpochSizeSec, - ) - else: - let rlnConf = WakuRlnConfig( - rlnRelayDynamic: conf.rlnRelayDynamic, - rlnRelayCredIndex: conf.rlnRelayCredIndex, - rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress, - rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress), - rlnRelayCredPath: conf.rlnRelayCredPath, - rlnRelayCredPassword: conf.rlnRelayCredPassword, - rlnEpochSizeSec: conf.rlnEpochSizeSec, - ) + let rlnConf = WakuRlnConfig( + rlnRelayDynamic: conf.rlnRelayDynamic, + rlnRelayCredIndex: conf.rlnRelayCredIndex, + rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress, + rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress), + rlnRelayCredPath: conf.rlnRelayCredPath, + rlnRelayCredPassword: conf.rlnRelayCredPassword, + rlnRelayUserMessageLimit: conf.rlnRelayUserMessageLimit, + rlnEpochSizeSec: conf.rlnEpochSizeSec, + ) waitFor node.mountRlnRelay(rlnConf, spamHandler = some(spamHandler)) diff --git a/tests/waku_relay/utils.nim b/tests/waku_relay/utils.nim index 0826cd2f4b..2e44189d12 100644 --- a/tests/waku_relay/utils.nim +++ b/tests/waku_relay/utils.nim @@ -95,51 +95,25 @@ proc sendRlnMessage*( let isCompleted = await completionFuture.withTimeout(FUTURE_TIMEOUT) return isCompleted -when defined(rln_v2): - proc sendRlnMessageWithInvalidProof*( - client: WakuNode, - pubsubTopic: string, - contentTopic: string, - completionFuture: Future[bool], - payload: seq[byte] = "Hello".toBytes(), - ): Future[bool] {.async.} = - let - extraBytes: seq[byte] = @[byte(1), 2, 3] - rateLimitProofRes = client.wakuRlnRelay.groupManager.generateProof( - concat(payload, extraBytes), - # we add extra bytes to invalidate proof verification against original payload - client.wakuRlnRelay.getCurrentEpoch(), - messageId = MessageId(0), - ) - rateLimitProof = rateLimitProofRes.get().encode().buffer - message = WakuMessage( - payload: @payload, contentTopic: contentTopic, proof: rateLimitProof - ) - - discard await client.publish(some(pubsubTopic), message) - let isCompleted = await completionFuture.withTimeout(FUTURE_TIMEOUT) - return isCompleted - -else: - proc sendRlnMessageWithInvalidProof*( - client: WakuNode, - pubsubTopic: string, - contentTopic: string, - completionFuture: Future[bool], - payload: seq[byte] = "Hello".toBytes(), - ): Future[bool] {.async.} = - let - extraBytes: seq[byte] = @[byte(1), 2, 3] - rateLimitProofRes = client.wakuRlnRelay.groupManager.generateProof( - concat(payload, extraBytes), - # we add extra bytes to invalidate proof verification against original payload - client.wakuRlnRelay.getCurrentEpoch(), - ) - rateLimitProof = rateLimitProofRes.get().encode().buffer - message = WakuMessage( - payload: @payload, contentTopic: contentTopic, proof: rateLimitProof - ) - - discard await client.publish(some(pubsubTopic), message) - let isCompleted = await completionFuture.withTimeout(FUTURE_TIMEOUT) - return isCompleted +proc sendRlnMessageWithInvalidProof*( + client: WakuNode, + pubsubTopic: string, + contentTopic: string, + completionFuture: Future[bool], + payload: seq[byte] = "Hello".toBytes(), +): Future[bool] {.async.} = + let + extraBytes: seq[byte] = @[byte(1), 2, 3] + rateLimitProofRes = client.wakuRlnRelay.groupManager.generateProof( + concat(payload, extraBytes), + # we add extra bytes to invalidate proof verification against original payload + client.wakuRlnRelay.getCurrentEpoch(), + messageId = MessageId(0), + ) + rateLimitProof = rateLimitProofRes.get().encode().buffer + message = + WakuMessage(payload: @payload, contentTopic: contentTopic, proof: rateLimitProof) + + discard await client.publish(some(pubsubTopic), message) + let isCompleted = await completionFuture.withTimeout(FUTURE_TIMEOUT) + return isCompleted diff --git a/tests/waku_rln_relay/rln/waku_rln_relay_utils.nim b/tests/waku_rln_relay/rln/waku_rln_relay_utils.nim index e25f98212f..ab3807983f 100644 --- a/tests/waku_rln_relay/rln/waku_rln_relay_utils.nim +++ b/tests/waku_rln_relay/rln/waku_rln_relay_utils.nim @@ -14,14 +14,11 @@ proc unsafeAppendRLNProof*( let input = msg.toRLNSignal() let epoch = rlnPeer.calcEpoch(senderEpochTime) - when defined(rln_v2): - # we do not fetch a nonce from the nonce manager, - # instead we use 0 as the nonce - let proof = rlnPeer.groupManager.generateProof(input, epoch, 0).valueOr: - return err("could not generate rln-v2 proof: " & $error) - else: - let proof = rlnPeer.groupManager.generateProof(input, epoch).valueOr: - return err("could not generate rln proof: " & $error) + # we do not fetch a nonce from the nonce manager, + # instead we use 0 as the nonce + let proof = rlnPeer.groupManager.generateProof(input, epoch, 0).valueOr: + return err("could not generate rln-v2 proof: " & $error) + msg.proof = proof.encode().buffer return ok() diff --git a/tests/waku_rln_relay/test_all.nim b/tests/waku_rln_relay/test_all.nim index 7aa3f395ec..fe23eb9fe9 100644 --- a/tests/waku_rln_relay/test_all.nim +++ b/tests/waku_rln_relay/test_all.nim @@ -5,7 +5,5 @@ import ./test_rln_group_manager_static, ./test_waku_rln_relay, ./test_wakunode_rln_relay, - ./test_rln_nonce_manager - -when defined(rln_v2): - import ./rln_v2/test_rln_relay_v2_serde + ./test_rln_nonce_manager, + ./test_rln_serde diff --git a/tests/waku_rln_relay/test_rln_group_manager_onchain.nim b/tests/waku_rln_relay/test_rln_group_manager_onchain.nim index 571a30ed01..c7b0a3d0db 100644 --- a/tests/waku_rln_relay/test_rln_group_manager_onchain.nim +++ b/tests/waku_rln_relay/test_rln_group_manager_onchain.nim @@ -30,13 +30,12 @@ proc generateCredentials(rlnInstance: ptr RLN): IdentityCredential = let credRes = membershipKeyGen(rlnInstance) return credRes.get() -when defined(rln_v2): - proc getRateCommitment( - idCredential: IdentityCredential, userMessageLimit: UserMessageLimit - ): RateCommitment = - return RateCommitment( - idCommitment: idCredential.idCommitment, userMessageLimit: userMessageLimit - ) +proc getRateCommitment( + idCredential: IdentityCredential, userMessageLimit: UserMessageLimit +): RateCommitment = + return RateCommitment( + idCommitment: idCredential.idCommitment, userMessageLimit: userMessageLimit + ) proc generateCredentials(rlnInstance: ptr RLN, n: int): seq[IdentityCredential] = var credentials: seq[IdentityCredential] @@ -61,39 +60,15 @@ proc uploadRLNContract*(ethClientAddress: string): Future[Address] {.async.} = let balance = await web3.provider.eth_getBalance(web3.defaultAccount, "latest") debug "Initial account balance: ", balance - when defined(rln_v2): - # deploy registry contract with its constructor inputs - let receipt = await web3.deployContract(RegistryContractCode) - else: - # deploy the poseidon hash contract and gets its address - let - hasherReceipt = await web3.deployContract(PoseidonHasherCode) - hasherAddress = hasherReceipt.contractAddress.get - debug "hasher address: ", hasherAddress - - # encode registry contract inputs to 32 bytes zero-padded - let - hasherAddressEncoded = encode(hasherAddress).data - # this is the contract constructor input - contractInput = hasherAddressEncoded - - debug "encoded hasher address: ", hasherAddressEncoded - debug "encoded contract input:", contractInput - - # deploy registry contract with its constructor inputs - let receipt = - await web3.deployContract(RegistryContractCode, contractInput = contractInput) - + # deploy registry contract with its constructor inputs + let receipt = await web3.deployContract(RegistryContractCode) let contractAddress = receipt.contractAddress.get() debug "Address of the deployed registry contract: ", contractAddress let registryContract = web3.contractSender(WakuRlnRegistry, contractAddress) - when defined(rln_v2): - let initReceipt = await registryContract.initialize().send() - let newStorageReceipt = await registryContract.newStorage(20.u256).send() - else: - let newStorageReceipt = await registryContract.newStorage().send() + let initReceipt = await registryContract.initialize().send() + let newStorageReceipt = await registryContract.newStorage(20.u256).send() debug "Receipt of the newStorage transaction: ", newStorageReceipt let newBalance = await web3.provider.eth_getBalance(web3.defaultAccount, "latest") @@ -300,13 +275,10 @@ suite "Onchain group manager": require: registrations.len == 1 registrations[0].index == 0 - when defined(rln_v2): - require: - registrations[0].rateCommitment == - getRateCommitment(credentials, UserMessageLimit(1)) - else: - require: - registrations[0].idCommitment == credentials.idCommitment + require: + registrations[0].rateCommitment == + getRateCommitment(credentials, UserMessageLimit(1)) + require: registrations[0].index == 0 fut.complete() @@ -315,10 +287,7 @@ suite "Onchain group manager": try: manager.onRegister(generateCallback(fut)) - when defined(rln_v2): - await manager.register(credentials, UserMessageLimit(1)) - else: - await manager.register(credentials) + await manager.register(credentials, UserMessageLimit(1)) (await manager.startGroupSync()).isOkOr: raiseAssert $error except Exception, CatchableError: @@ -355,19 +324,12 @@ suite "Onchain group manager": ): OnRegisterCallback = var futureIndex = 0 proc callback(registrations: seq[Membership]): Future[void] {.async.} = - when defined(rln_v2): - if registrations.len == 1 and - registrations[0].rateCommitment == - getRateCommitment(credentials[futureIndex], UserMessageLimit(1)) and - registrations[0].index == MembershipIndex(futureIndex): - futs[futureIndex].complete() - futureIndex += 1 - else: - if registrations.len == 1 and - registrations[0].idCommitment == credentials[futureIndex].idCommitment and - registrations[0].index == MembershipIndex(futureIndex): - futs[futureIndex].complete() - futureIndex += 1 + if registrations.len == 1 and + registrations[0].rateCommitment == + getRateCommitment(credentials[futureIndex], UserMessageLimit(1)) and + registrations[0].index == MembershipIndex(futureIndex): + futs[futureIndex].complete() + futureIndex += 1 return callback @@ -377,10 +339,7 @@ suite "Onchain group manager": raiseAssert $error for i in 0 ..< credentials.len(): - when defined(rln_v2): - await manager.register(credentials[i], UserMessageLimit(1)) - else: - await manager.register(credentials[i]) + await manager.register(credentials[i], UserMessageLimit(1)) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() @@ -399,14 +358,11 @@ suite "Onchain group manager": let dummyCommitment = default(IDCommitment) try: - when defined(rln_v2): - await manager.register( - RateCommitment( - idCommitment: dummyCommitment, userMessageLimit: UserMessageLimit(1) - ) + await manager.register( + RateCommitment( + idCommitment: dummyCommitment, userMessageLimit: UserMessageLimit(1) ) - else: - await manager.register(dummyCommitment) + ) except CatchableError: assert true except Exception: @@ -426,14 +382,11 @@ suite "Onchain group manager": raiseAssert $error try: - when defined(rln_v2): - await manager.register( - RateCommitment( - idCommitment: idCommitment, userMessageLimit: UserMessageLimit(1) - ) + await manager.register( + RateCommitment( + idCommitment: idCommitment, userMessageLimit: UserMessageLimit(1) ) - else: - await manager.register(idCommitment) + ) except Exception, CatchableError: assert false, "exception raised when calling register: " & getCurrentExceptionMsg() @@ -455,16 +408,11 @@ suite "Onchain group manager": proc callback(registrations: seq[Membership]): Future[void] {.async.} = require: registrations.len == 1 - when defined(rln_v2): - require: - registrations[0].rateCommitment == - RateCommitment( - idCommitment: idCommitment, userMessageLimit: UserMessageLimit(1) - ) - else: - require: - registrations[0].idCommitment == idCommitment require: + registrations[0].rateCommitment == + RateCommitment( + idCommitment: idCommitment, userMessageLimit: UserMessageLimit(1) + ) registrations[0].index == 0 fut.complete() @@ -474,14 +422,11 @@ suite "Onchain group manager": try: (await manager.startGroupSync()).isOkOr: raiseAssert $error - when defined(rln_v2): - await manager.register( - RateCommitment( - idCommitment: idCommitment, userMessageLimit: UserMessageLimit(1) - ) + await manager.register( + RateCommitment( + idCommitment: idCommitment, userMessageLimit: UserMessageLimit(1) ) - else: - await manager.register(idCommitment) + ) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() @@ -511,29 +456,20 @@ suite "Onchain group manager": let fut = newFuture[void]() proc callback(registrations: seq[Membership]): Future[void] {.async.} = - when defined(rln_v2): - if registrations.len == 1 and - registrations[0].rateCommitment == - getRateCommitment(credentials, UserMessageLimit(1)) and - registrations[0].index == 0: - manager.idCredentials = some(credentials) - fut.complete() - else: - if registrations.len == 1 and - registrations[0].idCommitment == credentials.idCommitment and - registrations[0].index == 0: - manager.idCredentials = some(credentials) - fut.complete() + if registrations.len == 1 and + registrations[0].rateCommitment == + getRateCommitment(credentials, UserMessageLimit(1)) and + registrations[0].index == 0: + manager.idCredentials = some(credentials) + fut.complete() + manager.onRegister(callback) try: (await manager.startGroupSync()).isOkOr: raiseAssert $error - when defined(rln_v2): - await manager.register(credentials, UserMessageLimit(1)) - else: - await manager.register(credentials) + await manager.register(credentials, UserMessageLimit(1)) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() @@ -546,12 +482,9 @@ suite "Onchain group manager": debug "epoch in bytes", epochHex = epoch.inHex() # generate proof - when defined(rln_v2): - let validProofRes = manager.generateProof( - data = messageBytes, epoch = epoch, messageId = MessageId(1) - ) - else: - let validProofRes = manager.generateProof(data = messageBytes, epoch = epoch) + let validProofRes = manager.generateProof( + data = messageBytes, epoch = epoch, messageId = MessageId(1) + ) require: validProofRes.isOk() @@ -576,8 +509,7 @@ suite "Onchain group manager": ## Assume the registration occured out of band manager.idCredentials = some(credentials) manager.membershipIndex = some(MembershipIndex(0)) - when defined(rln_v2): - manager.userMessageLimit = some(UserMessageLimit(1)) + manager.userMessageLimit = some(UserMessageLimit(1)) let messageBytes = "Hello".toBytes() @@ -586,12 +518,9 @@ suite "Onchain group manager": debug "epoch in bytes", epochHex = epoch.inHex() # generate proof - when defined(rln_v2): - let validProofRes = manager.generateProof( - data = messageBytes, epoch = epoch, messageId = MessageId(0) - ) - else: - let validProofRes = manager.generateProof(data = messageBytes, epoch = epoch) + let validProofRes = manager.generateProof( + data = messageBytes, epoch = epoch, messageId = MessageId(0) + ) require: validProofRes.isOk() let validProof = validProofRes.get() @@ -612,29 +541,20 @@ suite "Onchain group manager": let fut = newFuture[void]() proc callback(registrations: seq[Membership]): Future[void] {.async.} = - when defined(rln_v2): - if registrations.len == 1 and - registrations[0].rateCommitment == - getRateCommitment(credentials, UserMessageLimit(1)) and - registrations[0].index == 0: - manager.idCredentials = some(credentials) - fut.complete() - else: - if registrations.len == 1 and - registrations[0].idCommitment == credentials.idCommitment and - registrations[0].index == 0: - manager.idCredentials = some(credentials) - fut.complete() + if registrations.len == 1 and + registrations[0].rateCommitment == + getRateCommitment(credentials, UserMessageLimit(1)) and + registrations[0].index == 0: + manager.idCredentials = some(credentials) + fut.complete() + manager.onRegister(callback) try: (await manager.startGroupSync()).isOkOr: raiseAssert $error - when defined(rln_v2): - await manager.register(credentials, UserMessageLimit(1)) - else: - await manager.register(credentials) + await manager.register(credentials, UserMessageLimit(1)) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() await fut @@ -646,12 +566,9 @@ suite "Onchain group manager": debug "epoch in bytes", epochHex = epoch.inHex() # generate proof - when defined(rln_v2): - let validProofRes = manager.generateProof( - data = messageBytes, epoch = epoch, messageId = MessageId(0) - ) - else: - let validProofRes = manager.generateProof(data = messageBytes, epoch = epoch) + let validProofRes = manager.generateProof( + data = messageBytes, epoch = epoch, messageId = MessageId(0) + ) require: validProofRes.isOk() let validProof = validProofRes.get() @@ -675,10 +592,7 @@ suite "Onchain group manager": let idCredential = generateCredentials(manager.rlnInstance) try: - when defined(rln_v2): - await manager.register(getRateCommitment(idCredential, UserMessageLimit(1))) - else: - await manager.register(idCredential.idCommitment) + await manager.register(getRateCommitment(idCredential, UserMessageLimit(1))) except Exception, CatchableError: assert false, "exception raised when calling startGroupSync: " & getCurrentExceptionMsg() @@ -688,8 +602,7 @@ suite "Onchain group manager": ## Assume the registration occured out of band manager.idCredentials = some(idCredential2) manager.membershipIndex = some(MembershipIndex(0)) - when defined(rln_v2): - manager.userMessageLimit = some(UserMessageLimit(1)) + manager.userMessageLimit = some(UserMessageLimit(1)) let messageBytes = "Hello".toBytes() @@ -698,12 +611,9 @@ suite "Onchain group manager": debug "epoch in bytes", epochHex = epoch.inHex() # generate proof - when defined(rln_v2): - let invalidProofRes = manager.generateProof( - data = messageBytes, epoch = epoch, messageId = MessageId(0) - ) - else: - let invalidProofRes = manager.generateProof(data = messageBytes, epoch = epoch) + let invalidProofRes = manager.generateProof( + data = messageBytes, epoch = epoch, messageId = MessageId(0) + ) require: invalidProofRes.isOk() @@ -734,19 +644,12 @@ suite "Onchain group manager": ): OnRegisterCallback = var futureIndex = 0 proc callback(registrations: seq[Membership]): Future[void] {.async.} = - when defined(rln_v2): - if registrations.len == 1 and - registrations[0].rateCommitment == - getRateCommitment(credentials[futureIndex], UserMessageLimit(1)) and - registrations[0].index == MembershipIndex(futureIndex): - futs[futureIndex].complete() - futureIndex += 1 - else: - if registrations.len == 1 and - registrations[0].idCommitment == credentials[futureIndex].idCommitment and - registrations[0].index == MembershipIndex(futureIndex): - futs[futureIndex].complete() - futureIndex += 1 + if registrations.len == 1 and + registrations[0].rateCommitment == + getRateCommitment(credentials[futureIndex], UserMessageLimit(1)) and + registrations[0].index == MembershipIndex(futureIndex): + futs[futureIndex].complete() + futureIndex += 1 return callback @@ -756,10 +659,7 @@ suite "Onchain group manager": raiseAssert $error for i in 0 ..< credentials.len(): - when defined(rln_v2): - await manager.register(credentials[i], UserMessageLimit(1)) - else: - await manager.register(credentials[i]) + await manager.register(credentials[i], UserMessageLimit(1)) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() diff --git a/tests/waku_rln_relay/test_rln_group_manager_static.nim b/tests/waku_rln_relay/test_rln_group_manager_static.nim index b6ff5a511a..a90a56c514 100644 --- a/tests/waku_rln_relay/test_rln_group_manager_static.nim +++ b/tests/waku_rln_relay/test_rln_group_manager_static.nim @@ -94,14 +94,11 @@ suite "Static group manager": let dummyCommitment = default(IDCommitment) try: - when defined(rln_v2): - await manager.register( - RateCommitment( - idCommitment: dummyCommitment, userMessageLimit: DefaultUserMessageLimit - ) + await manager.register( + RateCommitment( + idCommitment: dummyCommitment, userMessageLimit: DefaultUserMessageLimit ) - else: - await manager.register(dummyCommitment) + ) except ValueError: assert true except Exception, CatchableError: @@ -117,14 +114,11 @@ suite "Static group manager": let merkleRootBefore = manager.rlnInstance.getMerkleRoot().valueOr: raiseAssert $error try: - when defined(rln_v2): - await manager.register( - RateCommitment( - idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit - ) + await manager.register( + RateCommitment( + idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit ) - else: - await manager.register(idCommitment) + ) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() let merkleRootAfter = manager.rlnInstance.getMerkleRoot().valueOr: @@ -143,15 +137,10 @@ suite "Static group manager": require: registrations.len == 1 registrations[0].index == 10 - when defined(rln_v2): - require: - registrations[0].rateCommitment == - RateCommitment( - idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit - ) - else: - require: - registrations[0].idCommitment == idCommitment + registrations[0].rateCommitment == + RateCommitment( + idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit + ) callbackCalled = true fut.complete() @@ -161,14 +150,11 @@ suite "Static group manager": raiseAssert $error (await manager.startGroupSync()).isOkOr: raiseAssert $error - when defined(rln_v2): - await manager.register( - RateCommitment( - idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit - ) + await manager.register( + RateCommitment( + idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit ) - else: - await manager.register(idCommitment) + ) except Exception, CatchableError: assert false, "exception raised: " & getCurrentExceptionMsg() @@ -215,15 +201,11 @@ suite "Static group manager": require: withdrawals.len == 1 withdrawals[0].index == 0 - when defined(rln_v2): - require: - withdrawals[0].rateCommitment == - RateCommitment( - idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit - ) - else: - require: - withdrawals[0].idCommitment == idCommitment + withdrawals[0].rateCommitment == + RateCommitment( + idCommitment: idCommitment, userMessageLimit: DefaultUserMessageLimit + ) + callbackCalled = true fut.complete() diff --git a/tests/waku_rln_relay/rln_v2/test_rln_relay_v2_serde.nim b/tests/waku_rln_relay/test_rln_serde.nim similarity index 94% rename from tests/waku_rln_relay/rln_v2/test_rln_relay_v2_serde.nim rename to tests/waku_rln_relay/test_rln_serde.nim index fb0d5de65e..b1b57f53c0 100644 --- a/tests/waku_rln_relay/rln_v2/test_rln_relay_v2_serde.nim +++ b/tests/waku_rln_relay/test_rln_serde.nim @@ -6,10 +6,10 @@ else: {.push raises: [].} import - ../rln/waku_rln_relay_utils, - ../../../waku/waku_keystore/protocol_types, - ../../../waku/waku_rln_relay, - ../../../waku/waku_rln_relay/rln + ./rln/waku_rln_relay_utils, + ../../waku/waku_keystore/protocol_types, + ../../waku/waku_rln_relay, + ../../waku/waku_rln_relay/rln import testutils/unittests import stew/results, stint diff --git a/tests/waku_rln_relay/test_waku_rln_relay.nim b/tests/waku_rln_relay/test_waku_rln_relay.nim index ea0e371037..c8f655ad7d 100644 --- a/tests/waku_rln_relay/test_waku_rln_relay.nim +++ b/tests/waku_rln_relay/test_waku_rln_relay.nim @@ -525,14 +525,11 @@ suite "Waku rln relay": let rln = rlnInstance.get() # create a Merkle tree - when defined(rln_v2): - let rateCommitments = - groupIDCommitments.mapIt(RateCommitment(idCommitment: it, userMessageLimit: 20)) - let leaves = rateCommitments.toLeaves().valueOr: - raiseAssert $error - let membersAdded = rln.insertMembers(0, leaves) - else: - let membersAdded = rln.insertMembers(0, groupIDCommitments) + let rateCommitments = + groupIDCommitments.mapIt(RateCommitment(idCommitment: it, userMessageLimit: 20)) + let leaves = rateCommitments.toLeaves().valueOr: + raiseAssert $error + let membersAdded = rln.insertMembers(0, leaves) assert membersAdded, "members should be added" let rawRoot = rln.getMerkleRoot().valueOr: @@ -691,21 +688,14 @@ suite "Waku rln relay": asyncTest "validateMessageAndUpdateLog test": let index = MembershipIndex(5) - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_2"), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_2"), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(index), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_2"), + ) + let wakuRlnRelay = (await WakuRlnRelay.new(wakuRlnConfig)).valueOr: raiseAssert $error @@ -749,40 +739,25 @@ suite "Waku rln relay": let index1 = MembershipIndex(5) let index2 = MembershipIndex(6) - when defined(rln_v2): - let rlnConf1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index1), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_3"), - ) - else: - let rlnConf1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index1), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_3"), - ) + let rlnConf1 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(index1), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_3"), + ) let wakuRlnRelay1 = (await WakuRlnRelay.new(rlnConf1)).valueOr: raiseAssert "failed to create waku rln relay: " & $error - when defined(rln_v2): - let rlnConf2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index2), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_4"), - ) - else: - let rlnConf2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index2), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_4"), - ) + let rlnConf2 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(index2), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "waku_rln_relay_4"), + ) + let wakuRlnRelay2 = (await WakuRlnRelay.new(rlnConf2)).valueOr: raiseAssert "failed to create waku rln relay: " & $error # get the current epoch time diff --git a/tests/waku_rln_relay/test_wakunode_rln_relay.nim b/tests/waku_rln_relay/test_wakunode_rln_relay.nim index d9f705945a..9a25f21ad8 100644 --- a/tests/waku_rln_relay/test_wakunode_rln_relay.nim +++ b/tests/waku_rln_relay/test_wakunode_rln_relay.nim @@ -40,21 +40,14 @@ procSuite "WakuNode - RLN relay": await node1.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode"), - ) - else: - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode"), - ) + let wakuRlnConfig1 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode"), + ) + await node1.mountRlnRelay(wakuRlnConfig1) await node1.start() @@ -62,21 +55,14 @@ procSuite "WakuNode - RLN relay": # node 2 await node2.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_2"), - ) - else: - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_2"), - ) + let wakuRlnConfig2 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(2.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_2"), + ) + await node2.mountRlnRelay(wakuRlnConfig2) await node2.start() @@ -84,21 +70,14 @@ procSuite "WakuNode - RLN relay": # node 3 await node3.mountRelay(@[DefaultPubsubTopic]) - when defined(rln_v2): - let wakuRlnConfig3 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(3.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_3"), - ) - else: - let wakuRlnConfig3 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(3.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_3"), - ) + let wakuRlnConfig3 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(3.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_3"), + ) + await node3.mountRlnRelay(wakuRlnConfig3) await node3.start() @@ -162,21 +141,14 @@ procSuite "WakuNode - RLN relay": # mount rlnrelay in off-chain mode for index, node in nodes: - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index.uint + 1), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_" & $(index + 1)), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(index.uint + 1), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_" & $(index + 1)), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(index.uint + 1), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_" & $(index + 1)), + ) + await node.mountRlnRelay(wakuRlnConfig) # start them @@ -263,21 +235,14 @@ procSuite "WakuNode - RLN relay": await node1.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_4"), - ) - else: - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_4"), - ) + let wakuRlnConfig1 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_4"), + ) + await node1.mountRlnRelay(wakuRlnConfig1) await node1.start() @@ -285,21 +250,14 @@ procSuite "WakuNode - RLN relay": # node 2 await node2.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_5"), - ) - else: - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_5"), - ) + let wakuRlnConfig2 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(2.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_5"), + ) + await node2.mountRlnRelay(wakuRlnConfig2) await node2.start() @@ -307,21 +265,14 @@ procSuite "WakuNode - RLN relay": # node 3 await node3.mountRelay(@[DefaultPubsubTopic]) - when defined(rln_v2): - let wakuRlnConfig3 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(3.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_6"), - ) - else: - let wakuRlnConfig3 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(3.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_6"), - ) + let wakuRlnConfig3 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(3.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_6"), + ) + await node3.mountRlnRelay(wakuRlnConfig3) await node3.start() @@ -354,17 +305,11 @@ procSuite "WakuNode - RLN relay": input = concat(payload, contentTopicBytes) extraBytes: seq[byte] = @[byte(1), 2, 3] - when defined(rln_v2): - let nonceManager = node1.wakuRlnRelay.nonceManager - let rateLimitProofRes = node1.wakuRlnRelay.groupManager.generateProof( - concat(input, extraBytes), epoch, MessageId(0) - ) - else: - let rateLimitProofRes = node1.wakuRlnRelay.groupManager.generateProof( - concat(input, extraBytes), - # we add extra bytes to invalidate proof verification against original payload - epoch, - ) + let nonceManager = node1.wakuRlnRelay.nonceManager + let rateLimitProofRes = node1.wakuRlnRelay.groupManager.generateProof( + concat(input, extraBytes), epoch, MessageId(0) + ) + assert rateLimitProofRes.isOk(), $rateLimitProofRes.error # check the proof is generated correctly outside when block to avoid duplication let rateLimitProof = rateLimitProofRes.get().encode().buffer @@ -406,21 +351,14 @@ procSuite "WakuNode - RLN relay": await node1.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_7"), - ) - else: - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_7"), - ) + let wakuRlnConfig1 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_7"), + ) + await node1.mountRlnRelay(wakuRlnConfig1) await node1.start() @@ -429,21 +367,14 @@ procSuite "WakuNode - RLN relay": await node2.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_8"), - ) - else: - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_8"), - ) + let wakuRlnConfig2 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(2.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_8"), + ) + await node2.mountRlnRelay(wakuRlnConfig2) await node2.start() @@ -451,21 +382,14 @@ procSuite "WakuNode - RLN relay": await node3.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig3 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(3.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_9"), - ) - else: - let wakuRlnConfig3 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(3.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_9"), - ) + let wakuRlnConfig3 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(3.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_9"), + ) + await node3.mountRlnRelay(wakuRlnConfig3) await node3.start() @@ -562,21 +486,14 @@ procSuite "WakuNode - RLN relay": await node1.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_10"), - ) - else: - let wakuRlnConfig1 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_10"), - ) + let wakuRlnConfig1 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_10"), + ) + await node1.mountRlnRelay(wakuRlnConfig1) await node1.start() @@ -585,21 +502,14 @@ procSuite "WakuNode - RLN relay": await node2.mountRelay(@[DefaultPubsubTopic]) # mount rlnrelay in off-chain mode - when defined(rln_v2): - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnRelayUserMessageLimit: 1, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_11"), - ) - else: - let wakuRlnConfig2 = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(2.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_11"), - ) + let wakuRlnConfig2 = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(2.uint), + rlnRelayUserMessageLimit: 1, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_11"), + ) + await node2.mountRlnRelay(wakuRlnConfig2) await node2.start() diff --git a/tests/wakunode_rest/test_rest_relay.nim b/tests/wakunode_rest/test_rest_relay.nim index 36bea003da..c672ee6e4f 100644 --- a/tests/wakunode_rest/test_rest_relay.nim +++ b/tests/wakunode_rest/test_rest_relay.nim @@ -219,21 +219,14 @@ suite "Waku v2 Rest API - Relay": let node = testWakuNode() await node.start() await node.mountRelay() - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 20, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 20, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), + ) + await node.mountRlnRelay(wakuRlnConfig) # RPC server setup @@ -443,21 +436,14 @@ suite "Waku v2 Rest API - Relay": let node = testWakuNode() await node.start() await node.mountRelay() - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 20, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 20, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), + ) + await node.mountRlnRelay(wakuRlnConfig) # RPC server setup @@ -502,21 +488,14 @@ suite "Waku v2 Rest API - Relay": let node = testWakuNode() await node.start() await node.mountRelay() - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 20, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 20, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), + ) + await node.mountRlnRelay(wakuRlnConfig) # RPC server setup @@ -557,21 +536,14 @@ suite "Waku v2 Rest API - Relay": let node = testWakuNode() await node.start() await node.mountRelay() - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 20, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 20, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), + ) + await node.mountRlnRelay(wakuRlnConfig) # RPC server setup @@ -619,21 +591,14 @@ suite "Waku v2 Rest API - Relay": let node = testWakuNode() await node.start() await node.mountRelay() - when defined(rln_v2): - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnRelayUserMessageLimit: 20, - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) - else: - let wakuRlnConfig = WakuRlnConfig( - rlnRelayDynamic: false, - rlnRelayCredIndex: some(1.uint), - rlnEpochSizeSec: 1, - rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), - ) + let wakuRlnConfig = WakuRlnConfig( + rlnRelayDynamic: false, + rlnRelayCredIndex: some(1.uint), + rlnRelayUserMessageLimit: 20, + rlnEpochSizeSec: 1, + rlnRelayTreePath: genTempPath("rln_tree", "wakunode_1"), + ) + await node.mountRlnRelay(wakuRlnConfig) # RPC server setup diff --git a/tools/rln_keystore_generator/rln_keystore_generator.nim b/tools/rln_keystore_generator/rln_keystore_generator.nim index c904519c0d..6c64ed6d2d 100644 --- a/tools/rln_keystore_generator/rln_keystore_generator.nim +++ b/tools/rln_keystore_generator/rln_keystore_generator.nim @@ -67,10 +67,7 @@ proc doRlnKeystoreGenerator*(conf: WakuNodeConf) = # 5. register on-chain try: - when defined(rln_v2): - waitFor groupManager.register(credential, conf.rlnRelayUserMessageLimit) - else: - waitFor groupManager.register(credential) + waitFor groupManager.register(credential, conf.rlnRelayUserMessageLimit) except Exception, CatchableError: error "failure while registering credentials on-chain", error = getCurrentExceptionMsg() @@ -82,27 +79,18 @@ proc doRlnKeystoreGenerator*(conf: WakuNodeConf) = chainId = $groupManager.chainId.get(), contractAddress = conf.rlnRelayEthContractAddress, membershipIndex = groupManager.membershipIndex.get() - when defined(rln_v2): - info "Your user message limit is", userMessageLimit = conf.rlnRelayUserMessageLimit + info "Your user message limit is", userMessageLimit = conf.rlnRelayUserMessageLimit # 6. write to keystore - when defined(rln_v2): - let keystoreCred = KeystoreMembership( - membershipContract: MembershipContract( - chainId: $groupManager.chainId.get(), address: conf.rlnRelayEthContractAddress - ), - treeIndex: groupManager.membershipIndex.get(), - identityCredential: credential, - userMessageLimit: conf.rlnRelayUserMessageLimit, - ) - else: - let keystoreCred = KeystoreMembership( - membershipContract: MembershipContract( - chainId: $groupManager.chainId.get(), address: conf.rlnRelayEthContractAddress - ), - treeIndex: groupManager.membershipIndex.get(), - identityCredential: credential, - ) + let keystoreCred = KeystoreMembership( + membershipContract: MembershipContract( + chainId: $groupManager.chainId.get(), address: conf.rlnRelayEthContractAddress + ), + treeIndex: groupManager.membershipIndex.get(), + identityCredential: credential, + userMessageLimit: conf.rlnRelayUserMessageLimit, + ) + let persistRes = addMembershipCredentials( conf.rlnRelayCredPath, keystoreCred, conf.rlnRelayCredPassword, RLNAppInfo diff --git a/waku/factory/node_factory.nim b/waku/factory/node_factory.nim index f3cbb7fe74..2bc468fb82 100644 --- a/waku/factory/node_factory.nim +++ b/waku/factory/node_factory.nim @@ -195,31 +195,18 @@ proc setupProtocols( quit(QuitFailure) if conf.rlnRelay: - when defined(rln_v2): - let rlnConf = WakuRlnConfig( - rlnRelayDynamic: conf.rlnRelayDynamic, - rlnRelayCredIndex: conf.rlnRelayCredIndex, - rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress, - rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress), - rlnRelayCredPath: conf.rlnRelayCredPath, - rlnRelayCredPassword: conf.rlnRelayCredPassword, - rlnRelayTreePath: conf.rlnRelayTreePath, - rlnRelayUserMessageLimit: conf.rlnRelayUserMessageLimit, - rlnEpochSizeSec: conf.rlnEpochSizeSec, - onFatalErrorAction: onFatalErrorAction, - ) - else: - let rlnConf = WakuRlnConfig( - rlnRelayDynamic: conf.rlnRelayDynamic, - rlnRelayCredIndex: conf.rlnRelayCredIndex, - rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress, - rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress), - rlnRelayCredPath: conf.rlnRelayCredPath, - rlnRelayCredPassword: conf.rlnRelayCredPassword, - rlnRelayTreePath: conf.rlnRelayTreePath, - rlnEpochSizeSec: conf.rlnEpochSizeSec, - onFatalErrorAction: onFatalErrorAction, - ) + let rlnConf = WakuRlnConfig( + rlnRelayDynamic: conf.rlnRelayDynamic, + rlnRelayCredIndex: conf.rlnRelayCredIndex, + rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress, + rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress), + rlnRelayCredPath: conf.rlnRelayCredPath, + rlnRelayCredPassword: conf.rlnRelayCredPassword, + rlnRelayTreePath: conf.rlnRelayTreePath, + rlnRelayUserMessageLimit: conf.rlnRelayUserMessageLimit, + rlnEpochSizeSec: conf.rlnEpochSizeSec, + onFatalErrorAction: onFatalErrorAction, + ) try: waitFor node.mountRlnRelay(rlnConf) diff --git a/waku/waku_keystore/protocol_types.nim b/waku/waku_keystore/protocol_types.nim index a3d9fb366c..2fab64e6f4 100644 --- a/waku/waku_keystore/protocol_types.nim +++ b/waku/waku_keystore/protocol_types.nim @@ -15,9 +15,7 @@ type IdentitySecretHash* = seq[byte] #array[32, byte] # hash of identity key as defined ed in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Membership IDCommitment* = seq[byte] #array[32, byte] - -when defined(rln_v2): - type UserMessageLimit* = uint64 + UserMessageLimit* = uint64 type IdentityCredential* = object idTrapdoor*: IdentityTrapdoor @@ -103,45 +101,24 @@ type KeystoreMembership* = ref object of RootObj membershipContract*: MembershipContract treeIndex*: MembershipIndex identityCredential*: IdentityCredential - when defined(rln_v2): - userMessageLimit*: UserMessageLimit - -when defined(rln_v2): - proc `$`*(m: KeystoreMembership): string = - return - "KeystoreMembership(chainId: " & m.membershipContract.chainId & - ", contractAddress: " & m.membershipContract.address & ", treeIndex: " & - $m.treeIndex & ", userMessageLimit: " & $m.userMessageLimit & - ", identityCredential: " & $m.identityCredential & ")" + userMessageLimit*: UserMessageLimit -else: - proc `$`*(m: KeystoreMembership): string = - return - "KeystoreMembership(chainId: " & m.membershipContract.chainId & - ", contractAddress: " & m.membershipContract.address & ", treeIndex: " & - $m.treeIndex & ", identityCredential: " & $m.identityCredential & ")" - -when defined(rln_v2): - proc `==`*(x, y: KeystoreMembership): bool = - return - x.membershipContract.chainId == y.membershipContract.chainId and - x.membershipContract.address == y.membershipContract.address and - x.treeIndex == y.treeIndex and x.userMessageLimit == y.userMessageLimit and - x.identityCredential.idTrapdoor == y.identityCredential.idTrapdoor and - x.identityCredential.idNullifier == y.identityCredential.idNullifier and - x.identityCredential.idSecretHash == y.identityCredential.idSecretHash and - x.identityCredential.idCommitment == y.identityCredential.idCommitment +proc `$`*(m: KeystoreMembership): string = + return + "KeystoreMembership(chainId: " & m.membershipContract.chainId & + ", contractAddress: " & m.membershipContract.address & ", treeIndex: " & + $m.treeIndex & ", userMessageLimit: " & $m.userMessageLimit & + ", identityCredential: " & $m.identityCredential & ")" -else: - proc `==`*(x, y: KeystoreMembership): bool = - return - x.membershipContract.chainId == y.membershipContract.chainId and - x.membershipContract.address == y.membershipContract.address and - x.treeIndex == y.treeIndex and - x.identityCredential.idTrapdoor == y.identityCredential.idTrapdoor and - x.identityCredential.idNullifier == y.identityCredential.idNullifier and - x.identityCredential.idSecretHash == y.identityCredential.idSecretHash and - x.identityCredential.idCommitment == y.identityCredential.idCommitment +proc `==`*(x, y: KeystoreMembership): bool = + return + x.membershipContract.chainId == y.membershipContract.chainId and + x.membershipContract.address == y.membershipContract.address and + x.treeIndex == y.treeIndex and x.userMessageLimit == y.userMessageLimit and + x.identityCredential.idTrapdoor == y.identityCredential.idTrapdoor and + x.identityCredential.idNullifier == y.identityCredential.idNullifier and + x.identityCredential.idSecretHash == y.identityCredential.idSecretHash and + x.identityCredential.idCommitment == y.identityCredential.idCommitment proc hash*(m: KeystoreMembership): string = # hash together the chainId, address and treeIndex diff --git a/waku/waku_rln_relay/constants.nim b/waku/waku_rln_relay/constants.nim index 9d69fdfd18..16678ad5c7 100644 --- a/waku/waku_rln_relay/constants.nim +++ b/waku/waku_rln_relay/constants.nim @@ -27,14 +27,13 @@ const const DefaultRlnTreePath* = "rln_tree.db" -when defined(rln_v2): - const - # pre-processed "rln/waku-rln-relay/v2.0.0" to array[32, byte] - DefaultRlnIdentifier*: RlnIdentifier = [ - 114, 108, 110, 47, 119, 97, 107, 117, 45, 114, 108, 110, 45, 114, 101, 108, 97, - 121, 47, 118, 50, 46, 48, 46, 48, 0, 0, 0, 0, 0, 0, 0, - ] - DefaultUserMessageLimit* = UserMessageLimit(20) +const + # pre-processed "rln/waku-rln-relay/v2.0.0" to array[32, byte] + DefaultRlnIdentifier*: RlnIdentifier = [ + 114, 108, 110, 47, 119, 97, 107, 117, 45, 114, 108, 110, 45, 114, 101, 108, 97, + 121, 47, 118, 50, 46, 48, 46, 48, 0, 0, 0, 0, 0, 0, 0, + ] + DefaultUserMessageLimit* = UserMessageLimit(20) # temporary variables to test waku-rln-relay performance in the static group mode const @@ -60048,15 +60047,11 @@ const StaticGroupKeys* = ] # StaticGroupMerkleRoot is the root of the Merkle tree constructed from the StaticGroupKeys above -# only identity commitments are used for the Merkle tree construction # rln-v2: rate commitments are used for the Merkle tree construction, defaulting the UserMessageLimit to 20 # the root is created locally, using createMembershipList proc from waku_rln_relay_utils module, and the result is hardcoded in here -when defined(rln_v2): - const StaticGroupMerkleRoot* = - "2c149e48886b5ba3da2edf8db8d7a364ae7a25618489c04cf0c0380f7cdd4d6f" -else: - const StaticGroupMerkleRoot* = - "1e534adab58f7d300aaeecae57a25e0a0b18c368a09f720280da92b288950901" +const StaticGroupMerkleRoot* = + "2c149e48886b5ba3da2edf8db8d7a364ae7a25618489c04cf0c0380f7cdd4d6f" + const MaxClockGapSeconds* = 20.0 # the maximum clock difference between peers in seconds diff --git a/waku/waku_rln_relay/contract.nim b/waku/waku_rln_relay/contract.nim index 2ff1d92b90..a88f83d20f 100644 --- a/waku/waku_rln_relay/contract.nim +++ b/waku/waku_rln_relay/contract.nim @@ -1,17 +1,5 @@ -when not defined(rln_v2): - # PoseidonHasherCode holds the bytecode of Poseidon hasher solidity smart contract: - # https://github.com/kilic/rlnapp/blob/master/packages/contracts/contracts/crypto/PoseidonHasher.sol - # the solidity contract is compiled separately and the resultant bytecode is copied here - const PoseidonHasherCode* = - "0x608060405234801561001057600080fd5b50613e58806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b189fd4c1461003b578063e493ef8c1461006b575b600080fd5b61005560048036038101906100509190613dcb565b610089565b6040516100629190613e07565b60405180910390f35b61007361009b565b6040516100809190613e07565b60405180910390f35b6000610094826100bf565b9050919050565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000181565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000017f09c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a77f0c0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81840182828309838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30830192507f27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f82019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03830192507f2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d382019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0b66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0830192507f012ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e2182019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9830192507f179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91830192507f1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b0582019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56830192507f28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd982019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043830192507f2c1f47cd17fa5adf1f39f4e7056dd03feee1efce03094581131f2377323482c982019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f07abad02b7a5ebc48632bcc9356ceb7dd9dafca276638a63646b8566a621afc9830192507f0230264601ffdf29275b33ffaab51dfe9429f90880a69cd137da0c4d15f96c3c82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1bc973054e51d905a0f168656497ca40a864414557ee289e717e5d66899aa0a9830192507f2e1c22f964435008206c3157e86341edd249aff5c2d8421f2a6b22288f0a67fc82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1224f38df67c5378121c1d5f461bbc509e8ea1598e46c9f7a70452bc2bba86b8830192507f02e4e69d8ba59e519280b4bd9ed0068fd7bfe8cd9dfeda1969d2989186cde20e82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1f1eccc34aaba0137f5df81fc04ff3ee4f19ee364e653f076d47e9735d98018e830192507f1672ad3d709a353974266c3039a9a7311424448032cd1819eacb8a4d4284f58282019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f283e3fdc2c6e420c56f44af5192b4ae9cda6961f284d24991d2ed602df8c8fc7830192507f1c2a3d120c550ecfd0db0957170fa013683751f8fdff59d6614fbd69ff394bcc82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f216f84877aac6172f7897a7323456efe143a9a43773ea6f296cb6b8177653fbd830192507f2c0d272becf2a75764ba7e8e3e28d12bceaa47ea61ca59a411a1f51552f9478882019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f16e34299865c0e28484ee7a74c454e9f170a5480abe0508fcb4a6c3d89546f43830192507f175ceba599e96f5b375a232a6fb9cc71772047765802290f48cd939755488fc582019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0c7594440dc48c16fead9e1758b028066aa410bfbc354f54d8c5ffbb44a1ee32830192507f1a3c29bc39f21bb5c466db7d7eb6fd8f760e20013ccf912c92479882d919fd8d82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0ccfdd906f3426e5c0986ea049b253400855d349074f5a6695c8eeabcd22e68f830192507f14f6bc81d9f186f62bdb475ce6c9411866a7a8a3fd065b3ce0e699b67dd9e79682019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0962b82789fb3d129702ca70b2f6c5aacc099810c9c495c888edeb7386b97052830192507f1a880af7074d18b3bf20c79de25127bc13284ab01ef02575afef0c8f6a31a86d82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f10cba18419a6a332cd5e77f0211c154b20af2924fc20ff3f4c3012bb7ae9311b830192507f057e62a9a8f89b3ebdc76ba63a9eaca8fa27b7319cae3406756a2849f302f10d82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f287c971de91dc0abd44adf5384b4988cb961303bbf65cff5afa0413b44280cee830192507f21df3388af1687bbb3bca9da0cca908f1e562bc46d4aba4e6f7f7960e306891d82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1be5c887d25bce703e25cc974d0934cd789df8f70b498fd83eff8b560e1682b3830192507f268da36f76e568fb68117175cea2cd0dd2cb5d42fda5acea48d59c2706a0d5c182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0e17ab091f6eae50c609beaf5510ececc5d8bb74135ebd05bd06460cc26a5ed6830192507f04d727e728ffa0a67aee535ab074a43091ef62d8cf83d270040f5caa1f62af4082019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0ddbd7bf9c29341581b549762bc022ed33702ac10f1bfd862b15417d7e39ca6e830192507f2790eb3351621752768162e82989c6c234f5b0d1d3af9b588a29c49c8789654b82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1e457c601a63b73e4471950193d8a570395f3d9ab8b2fd0984b764206142f9e9830192507f21ae64301dca9625638d6ab2bbe7135ffa90ecd0c43ff91fc4c686fc46e091b082019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0379f63c8ce3468d4da293166f494928854be9e3432e09555858534eed8d350b830192507e2d56420359d0266a744a080809e054ca0e4921a46686ac8c9f58a324c3504982019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f123158e5965b5d9b1d68b3cd32e10bbeda8d62459e21f4090fc2c5af963515a6830192507f0be29fc40847a941661d14bbf6cbe0420fbb2b6f52836d4e60c80eb49cad9ec182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1ac96991dec2bb0557716142015a453c36db9d859cad5f9a233802f24fdf4c1a830192507f1596443f763dbcc25f4964fc61d23b3e5e12c9fa97f18a9251ca3355bcb0627e82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f12e0bcd3654bdfa76b2861d4ec3aeae0f1857d9f17e715aed6d049eae3ba3212830192507f0fc92b4f1bbea82b9ea73d4af9af2a50ceabac7f37154b1904e6c76c7cf964ba82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1f9c0b1610446442d6f2e592a8013f40b14f7c7722236f4f9c7e965233872762830192507f0ebd74244ae72675f8cde06157a782f4050d914da38b4c058d159f643dbbf4d382019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2cb7f0ed39e16e9f69a9fafd4ab951c03b0671e97346ee397a839839dccfc6d1830192507f1a9d6e2ecff022cc5605443ee41bab20ce761d0514ce526690c72bca7352d9bf82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2a115439607f335a5ea83c3bc44a9331d0c13326a9a7ba3087da182d648ec72f830192507f23f9b6529b5d040d15b8fa7aee3e3410e738b56305cd44f29535c115c5a4c06082019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f05872c16db0f72a2249ac6ba484bb9c3a3ce97c16d58b68b260eb939f0e6e8a7830192507f1300bdee08bb7824ca20fb80118075f40219b6151d55b5c52b624a7cdeddf6a782019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f19b9b63d2f108e17e63817863a8f6c288d7ad29916d98cb1072e4e7b7d52b376830192507f015bee1357e3c015b5bda237668522f613d1c88726b5ec4224a20128481b4f7f82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2953736e94bb6b9f1b9707a4f1615e4efe1e1ce4bab218cbea92c785b128ffd1830192507f0b069353ba091618862f806180c0385f851b98d372b45f544ce7266ed6608dfc82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f304f74d461ccc13115e4e0bcfb93817e55aeb7eb9306b64e4f588ac97d81f429830192507f15bbf146ce9bca09e8a33f5e77dfe4f5aad2a164a4617a4cb8ee5415cde913fc82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0ab4dfe0c2742cde44901031487964ed9b8f4b850405c10ca9ff23859572c8c6830192507f0e32db320a044e3197f45f7649a19675ef5eedfea546dea9251de39f9639779a82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0a1756aa1f378ca4b27635a78b6888e66797733a82774896a3078efa516da016830192507f044c4a33b10f693447fd17177f952ef895e61d328f85efa94254d6a2a25d93ef82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2ed3611b725b8a70be655b537f66f700fe0879d79a496891d37b07b5466c4b8b830192507f1f9ba4e8bab7ce42c8ecc3d722aa2e0eadfdeb9cfdd347b5d8339ea7120858aa82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1b233043052e8c288f7ee907a84e518aa38e82ac4502066db74056f865c5d3da830192507f2431e1cc164bb8d074031ab72bd55b4c902053bfc0f14db0ca2f97b02087595482019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f082f934c91f5aac330cd6953a0a7db45a13e322097583319a791f273965801fd830192507f2b9a0a223e7538b0a34be074315542a3c77245e2ae7cbe999ad6bb930c48997c82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0e1cd91edd2cfa2cceb85483b887a9be8164163e75a8a00eb0b589cc70214e7d830192507f2e1eac0f2bfdfd63c951f61477e3698999774f19854d00f588d324601cebe2f982019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0cbfa95f37fb74060c76158e769d6d157345784d8efdb33c23d748115b500b83830192507f08f05b3be923ed44d65ad49d8a61e9a676d991e3a77513d9980c232dfa4a4f8482019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f22719e2a070bcd0852bf8e21984d0443e7284925dc0758a325a2dd510c047ef6830192507f041f596a9ee1cb2bc060f7fcc3a1ab4c7bdbf036119982c0f41f62b2f26830c082019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f233fd35de1be520a87628eb06f6b1d4c021be1c2d0dc464a19fcdd0986b10f89830192507f0524b46d1aa87a5e4325e0a423ebc810d31e078aa1b4707eefcb453c61c9c26782019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2c34f424c81e5716ce47fcac894b85824227bb954b0f3199cc4486237c515211830192507f0b5f2a4b63387819207effc2b5541fb72dd2025b5457cc97f33010327de4915e82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f22207856082ccc54c5b72fe439d2cfd6c17435d2f57af6ceaefac41fe05c659f830192507f24d57a8bf5da63fe4e24159b7f8950b5cdfb210194caf79f27854048ce2c817182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0afab181fdd5e0583b371d75bd693f98374ad7097bb01a8573919bb23b79396e830192507f2dba9b108f208772998a52efac7cbd5676c0057194c16c0bf16290d62b1128ee82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f26349b66edb8b16f56f881c788f53f83cbb83de0bd592b255aff13e6bce420b3830192507f25af7ce0e5e10357685e95f92339753ad81a56d28ecc193b235288a3e6f137db82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f25b4ce7bd2294390c094d6a55edd68b970eed7aae88b2bff1f7c0187fe35011f830192507f22c543f10f6c89ec387e53f1908a88e5de9cef28ebdf30b18cb9d54c1e02b63182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0236f93e7789c4724fc7908a9f191e1e425e906a919d7a34df668e74882f87a9830192507f29350b401166ca010e7d27e37d05da99652bdae114eb01659cb497af980c4b5282019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0eed787d65820d3f6bd31bbab547f75a65edb75d844ebb89ee1260916652363f830192507f07cc1170f13b46f2036a753f520b3291fdcd0e99bd94297d1906f656f4de6fad82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f22b939233b1d7205f49bcf613a3d30b1908786d7f9f5d10c2059435689e8acea830192507f01451762a0aab81c8aad1dc8bc33e870740f083a5aa85438add650ace60ae5a682019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f23506bb5d8727d4461fabf1025d46d1fe32eaa61dec7da57e704fec0892fce89830192507f2e484c44e838aea0bac06ae3f71bdd092a3709531e1efea97f8bd6890735552282019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0f4bc7d07ebafd64379e78c50bd2e42baf4a594545cedc2545418da26835b54c830192507f1f4d3c8f6583e9e5fa76637862faaee851582388725df460e620996d50d8e74e82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f093514e0c70711f82660d07be0e4a988fae02abc7b681d9153eb9bcb48fe7389830192507f1adab0c8e2b3bad346699a2b5f3bc03643ee83ece47228f24a58e0a347e153d882019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1672b1726057d99dd14709ebb474641a378c1b94b8072bac1a22dbef9e80dad2830192507f1dfd53d4576af2e38f44f53fdcab468cc5d8e2fae0acc4ee30d47b239b479c1482019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0c6888a10b75b0f3a70a36263a37e17fe6d77d640f6fc3debc7f207753205c60830192507f1addb933a65be77092b34a7e77d12fe8611a61e00ee6848b85091ecca9d1e50882019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507ed7540dcd268a845c10ae18d1de933cf638ff5425f0afff7935628e299d1791830192507f140c0e42687e9ead01b2827a5664ca9c26fedde4acd99db1d316939d20b82c0e82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2f0c3a115d4317d191ba89b8d13d1806c20a0f9b24f8c5edc091e2ae56565984830192507f0c4ee778ff7c14553006ed220cf9c81008a0cff670b22b82d8c538a1dc958c6182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1704f2766d46f82c3693f00440ccc3609424ed26c0acc66227c3d7485de74c69830192507f2f2d19cc3ea5d78ea7a02c1b51d244abf0769c9f8544e40239b66fe9009c3cfa82019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1ae03853b75fcaba5053f112e2a8e8dcdd7ee6cb9cfed9c7d6c766a806fc6629830192507f0971aabf795241df51d131d0fa61aa5f3556921b2d6f014e4e41a86ddaf056d582019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1408c316e6014e1a91d4cf6b6e0de73eda624f8380df1c875f5c29f7bfe2f646830192507f1667f3fe2edbe850248abe42b543093b6c89f1f773ef285341691f39822ef5bd82019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f13bf7c5d0d2c4376a48b0a03557cdf915b81718409e5c133424c69576500fe37830192507f07620a6dfb0b6cec3016adf3d3533c24024b95347856b79719bc0ba743a62c2c82019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1574c7ef0c43545f36a8ca08bdbdd8b075d2959e2f322b731675de3e1982b4d0830192507f269e4b5b7a2eb21afd567970a717ceec5bd4184571c254fdc06e03a7ff8378f08201915083838409905083838583840909925083828309905083828583840909915083847f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88409857f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad586090106925082945050505050919050565b600080fd5b6000819050919050565b613da881613d95565b8114613db357600080fd5b50565b600081359050613dc581613d9f565b92915050565b600060208284031215613de157613de0613d90565b5b6000613def84828501613db6565b91505092915050565b613e0181613d95565b82525050565b6000602082019050613e1c6000830184613df8565b9291505056fea2646970667358221220f20e2267360e9aeb09de75ad232eed0f5dc05f7547d686c790b156f441d402b164736f6c634300080f0033" - # RegistryContractCode contains the bytecode of the membership solidity smart contract: - # https://github.com/waku-org/rln-contract/blob/fbafa7b0bb47c5233f50ba82992c572795e7e9a6/deployments/sepolia/WakuRlnRegistry.json - # the solidity contract is compiled separately and the resultant bytecode is copied here - const RegistryContractCode* = - "0x60a06040526000600260006101000a81548161ffff021916908361ffff1602179055503480156200002f57600080fd5b5060405162002f2a38038062002f2a8339818101604052810190620000559190620001e6565b6200007562000069620000b060201b60201c565b620000b860201b60201c565b8073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250505062000218565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620001ae8262000181565b9050919050565b620001c081620001a1565b8114620001cc57600080fd5b50565b600081519050620001e081620001b5565b92915050565b600060208284031215620001ff57620001fe6200017c565b5b60006200020f84828501620001cf565b91505092915050565b608051612ce862000242600039600081816103e2015281816104120152610ad80152612ce86000f3fe60806040523480156200001157600080fd5b5060043610620000e25760003560e01c8063ab02492a1162000099578063ef653d5e116200006f578063ef653d5e14620001d1578063f184ef4c14620001f1578063f2fde38b1462000213578063f5542147146200023357620000e2565b8063ab02492a1462000183578063cf61637414620001a3578063d44fda1f14620001c557620000e2565b806326e0fc1f14620000e7578063331b6ab3146200010757806342f542e21462000129578063715018a614620001355780637a34289d14620001415780638da5cb5b1462000161575b600080fd5b620001056004803603810190620000ff919062001045565b62000269565b005b62000111620003e0565b60405162000120919062001117565b60405180910390f35b6200013362000404565b005b6200013f6200048b565b005b6200015f6004803603810190620001599190620011a2565b620004a3565b005b6200016b6200075f565b6040516200017a91906200121c565b60405180910390f35b620001a160048036038101906200019b919062001239565b62000788565b005b620001ad6200088b565b604051620001bc9190620012b4565b60405180910390f35b620001cf6200089f565b005b620001ef6004803603810190620001e9919062001302565b62000a09565b005b620001fb62000c9e565b6040516200020a9190620012b4565b60405180910390f35b6200023160048036038101906200022b919062001302565b62000cb2565b005b6200025160048036038101906200024b919062001334565b62000d3c565b6040516200026091906200121c565b60405180910390f35b600060149054906101000a900461ffff1661ffff168261ffff1610620002bb576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600167ffffffffffffffff811115620002db57620002da62001366565b5b6040519080825280602002602001820160405280156200030a5781602001602082028036833780820191505090505b509050818160008151811062000325576200032462001395565b5b602002602001018181525050600160008461ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637a34289d826040518263ffffffff1660e01b8152600401620003a7919062001492565b600060405180830381600087803b158015620003c257600080fd5b505af1158015620003d7573d6000803e3d6000fd5b50505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6200040e62000d6f565b60007f0000000000000000000000000000000000000000000000000000000000000000600060149054906101000a900461ffff16604051620004509062000fb3565b6200045d929190620014b6565b604051809103906000f0801580156200047a573d6000803e3d6000fd5b509050620004888162000df4565b50565b6200049562000d6f565b620004a1600062000ee7565b565b600060149054906101000a900461ffff1661ffff16600260009054906101000a900461ffff1661ffff161062000505576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b6001156200075b5760016000600260009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637a34289d83836040518363ffffffff1660e01b8152600401620005969291906200155a565b600060405180830381600087803b158015620005b157600080fd5b505af1925050508015620005c3575060015b6200074f573d8060008114620005f6576040519150601f19603f3d011682016040523d82523d6000602084013e620005fb565b606091505b506040516024016040516020818303038152906040527f57f69531000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050805190602001208180519060200120146200069c57805181602001fd5b600060149054906101000a900461ffff1661ffff166001600260009054906101000a900461ffff16620006d09190620015af565b61ffff16106200070c576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600260008282829054906101000a900461ffff166200072e9190620015af565b92506101000a81548161ffff021916908361ffff1602179055505062000755565b6200075b565b62000506565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060149054906101000a900461ffff1661ffff168361ffff1610620007da576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008461ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637a34289d83836040518363ffffffff1660e01b8152600401620008529291906200155a565b600060405180830381600087803b1580156200086d57600080fd5b505af115801562000882573d6000803e3d6000fd5b50505050505050565b600260009054906101000a900461ffff1681565b620008a962000d6f565b600060149054906101000a900461ffff1661ffff16600260009054906101000a900461ffff1661ffff16106200090b576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160006001600260009054906101000a900461ffff16620009469190620015af565b61ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603620009cb576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600260008282829054906101000a900461ffff16620009ed9190620015af565b92506101000a81548161ffff021916908361ffff160217905550565b62000a1362000d6f565b600073ffffffffffffffffffffffffffffffffffffffff16600160008060149054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161462000ad157806040517f9cfabd1600000000000000000000000000000000000000000000000000000000815260040162000ac891906200121c565b60405180910390fd5b60008190507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663331b6ab36040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000b59573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b7f919062001633565b73ffffffffffffffffffffffffffffffffffffffff161462000bcc576040517eaec95400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060149054906101000a900461ffff1661ffff168173ffffffffffffffffffffffffffffffffffffffff166328b070e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000c2d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c5391906200167c565b61ffff161462000c8f576040517fb893b72300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000c9a8262000df4565b5050565b600060149054906101000a900461ffff1681565b62000cbc62000d6f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160362000d2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000d259062001735565b60405180910390fd5b62000d398162000ee7565b50565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62000d7962000fab565b73ffffffffffffffffffffffffffffffffffffffff1662000d996200075f565b73ffffffffffffffffffffffffffffffffffffffff161462000df2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000de990620017a7565b60405180910390fd5b565b80600160008060149054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcf6a3b406170499209d0fcf152a1605c7c5a5c99c855e2bb803433fc960718eb600060149054906101000a900461ffff168260405162000ea0929190620017c9565b60405180910390a16001600060148282829054906101000a900461ffff1662000eca9190620015af565b92506101000a81548161ffff021916908361ffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b6114bc80620017f783390190565b600080fd5b600080fd5b600061ffff82169050919050565b62000fe48162000fcb565b811462000ff057600080fd5b50565b600081359050620010048162000fd9565b92915050565b6000819050919050565b6200101f816200100a565b81146200102b57600080fd5b50565b6000813590506200103f8162001014565b92915050565b600080604083850312156200105f576200105e62000fc1565b5b60006200106f8582860162000ff3565b925050602062001082858286016200102e565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000620010d7620010d1620010cb846200108c565b620010ac565b6200108c565b9050919050565b6000620010eb82620010b6565b9050919050565b6000620010ff82620010de565b9050919050565b6200111181620010f2565b82525050565b60006020820190506200112e600083018462001106565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126200115c576200115b62001134565b5b8235905067ffffffffffffffff8111156200117c576200117b62001139565b5b6020830191508360208202830111156200119b576200119a6200113e565b5b9250929050565b60008060208385031215620011bc57620011bb62000fc1565b5b600083013567ffffffffffffffff811115620011dd57620011dc62000fc6565b5b620011eb8582860162001143565b92509250509250929050565b600062001204826200108c565b9050919050565b6200121681620011f7565b82525050565b60006020820190506200123360008301846200120b565b92915050565b60008060006040848603121562001255576200125462000fc1565b5b6000620012658682870162000ff3565b935050602084013567ffffffffffffffff81111562001289576200128862000fc6565b5b620012978682870162001143565b92509250509250925092565b620012ae8162000fcb565b82525050565b6000602082019050620012cb6000830184620012a3565b92915050565b620012dc81620011f7565b8114620012e857600080fd5b50565b600081359050620012fc81620012d1565b92915050565b6000602082840312156200131b576200131a62000fc1565b5b60006200132b84828501620012eb565b91505092915050565b6000602082840312156200134d576200134c62000fc1565b5b60006200135d8482850162000ff3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b620013fb816200100a565b82525050565b60006200140f8383620013f0565b60208301905092915050565b6000602082019050919050565b60006200143582620013c4565b620014418185620013cf565b93506200144e83620013e0565b8060005b838110156200148557815162001469888262001401565b975062001476836200141b565b92505060018101905062001452565b5085935050505092915050565b60006020820190508181036000830152620014ae818462001428565b905092915050565b6000604082019050620014cd60008301856200120b565b620014dc6020830184620012a3565b9392505050565b600080fd5b82818337600083830152505050565b6000620015058385620013cf565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156200153b576200153a620014e3565b5b6020830292506200154e838584620014e8565b82840190509392505050565b6000602082019050818103600083015262001577818486620014f7565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620015bc8262000fcb565b9150620015c98362000fcb565b92508261ffff03821115620015e357620015e262001580565b5b828201905092915050565b6000620015fb82620011f7565b9050919050565b6200160d81620015ee565b81146200161957600080fd5b50565b6000815190506200162d8162001602565b92915050565b6000602082840312156200164c576200164b62000fc1565b5b60006200165c848285016200161c565b91505092915050565b600081519050620016768162000fd9565b92915050565b60006020828403121562001695576200169462000fc1565b5b6000620016a58482850162001665565b91505092915050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006200171d602683620016ae565b91506200172a82620016bf565b604082019050919050565b6000602082019050818103600083015262001750816200170e565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006200178f602083620016ae565b91506200179c8262001757565b602082019050919050565b60006020820190508181036000830152620017c28162001780565b9050919050565b6000604082019050620017e06000830185620012a3565b620017ef60208301846200120b565b939250505056fe61016060405260006001553480156200001757600080fd5b50604051620014bc380380620014bc83398181016040528101906200003d919062000290565b6000601483600062000064620000586200011b60201b60201c565b6200012360201b60201c565b83608081815250508260a08181525050826001901b60c081815250508173ffffffffffffffffffffffffffffffffffffffff1660e08173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff166101008173ffffffffffffffffffffffffffffffffffffffff16815250504363ffffffff166101208163ffffffff1681525050505050508061ffff166101408161ffff16815250505050620002d7565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200021982620001ec565b9050919050565b6200022b816200020c565b81146200023757600080fd5b50565b6000815190506200024b8162000220565b92915050565b600061ffff82169050919050565b6200026a8162000251565b81146200027657600080fd5b50565b6000815190506200028a816200025f565b92915050565b60008060408385031215620002aa57620002a9620001e7565b5b6000620002ba858286016200023a565b9250506020620002cd8582860162000279565b9150509250929050565b60805160a05160c05160e05161010051610120516101405161117c620003406000396000610545015260006105e3015260006105690152600081816104ac015261058d0152600081816107560152610aac015260006106fc015260006107ac015261117c6000f3fe60806040526004361061011f5760003560e01c80638be9b119116100a0578063c5b208ff11610064578063c5b208ff146103c5578063d0383d6814610402578063f207564e1461042d578063f220b9ec14610449578063f2fde38b146104745761011f565b80638be9b119146102de5780638da5cb5b1461030757806398366e3514610332578063ae74552a1461035d578063bc499128146103885761011f565b80634add651e116100e75780634add651e146101f95780635daf08ca146102245780636bdcc8ab14610261578063715018a61461029e5780637a34289d146102b55761011f565b806322d9730c1461012457806328b070e0146101615780632b7ac3f31461018c578063331b6ab3146101b75780633ccfd60b146101e2575b600080fd5b34801561013057600080fd5b5061014b60048036038101906101469190610b48565b61049d565b6040516101589190610b90565b60405180910390f35b34801561016d57600080fd5b50610176610543565b6040516101839190610bc8565b60405180910390f35b34801561019857600080fd5b506101a1610567565b6040516101ae9190610c62565b60405180910390f35b3480156101c357600080fd5b506101cc61058b565b6040516101d99190610c9e565b60405180910390f35b3480156101ee57600080fd5b506101f76105af565b005b34801561020557600080fd5b5061020e6105e1565b60405161021b9190610cd8565b60405180910390f35b34801561023057600080fd5b5061024b60048036038101906102469190610b48565b610605565b6040516102589190610d02565b60405180910390f35b34801561026d57600080fd5b5061028860048036038101906102839190610b48565b61061d565b6040516102959190610b90565b60405180910390f35b3480156102aa57600080fd5b506102b361063d565b005b3480156102c157600080fd5b506102dc60048036038101906102d79190610d82565b610651565b005b3480156102ea57600080fd5b5061030560048036038101906103009190610e2f565b61069f565b005b34801561031357600080fd5b5061031c6106d1565b6040516103299190610ea4565b60405180910390f35b34801561033e57600080fd5b506103476106fa565b6040516103549190610d02565b60405180910390f35b34801561036957600080fd5b5061037261071e565b60405161037f9190610d02565b60405180910390f35b34801561039457600080fd5b506103af60048036038101906103aa9190610b48565b610724565b6040516103bc9190610d02565b60405180910390f35b3480156103d157600080fd5b506103ec60048036038101906103e79190610eeb565b61073c565b6040516103f99190610d02565b60405180910390f35b34801561040e57600080fd5b50610417610754565b6040516104249190610d02565b60405180910390f35b61044760048036038101906104429190610b48565b610778565b005b34801561045557600080fd5b5061045e6107aa565b60405161046b9190610d02565b60405180910390f35b34801561048057600080fd5b5061049b60048036038101906104969190610eeb565b6107ce565b005b600080821415801561053c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e493ef8c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610515573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105399190610f2d565b82105b9050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b60036020528060005260406000206000915090505481565b60046020528060005260406000206000915054906101000a900460ff1681565b610645610851565b61064f60006108cf565b565b610659610851565b600082829050905060005b818110156106995761068e84848381811061068257610681610f5a565b5b90506020020135610993565b806001019050610664565b50505050565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60026020528060005260406000206000915090505481565b60056020528060005260406000206000915090505481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b6107d6610851565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610845576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083c9061100c565b60405180910390fd5b61084e816108cf565b50565b610859610a0c565b73ffffffffffffffffffffffffffffffffffffffff166108776106d1565b73ffffffffffffffffffffffffffffffffffffffff16146108cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c490611078565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61099c81610a14565b600160036000838152602001908152602001600020819055507f5a92c2530f207992057b9c3e544108ffce3beda4a63719f316967c49bf6159d2816001546040516109e8929190611098565b60405180910390a16001806000828254610a0291906110f0565b9250508190555050565b600033905090565b610a1d8161049d565b610a5e57806040517f7f3e75af000000000000000000000000000000000000000000000000000000008152600401610a559190610d02565b60405180910390fd5b6000600360008381526020019081526020016000205414610aaa576040517e0a60f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000060015410610b05576040517f57f6953100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600080fd5b600080fd5b6000819050919050565b610b2581610b12565b8114610b3057600080fd5b50565b600081359050610b4281610b1c565b92915050565b600060208284031215610b5e57610b5d610b08565b5b6000610b6c84828501610b33565b91505092915050565b60008115159050919050565b610b8a81610b75565b82525050565b6000602082019050610ba56000830184610b81565b92915050565b600061ffff82169050919050565b610bc281610bab565b82525050565b6000602082019050610bdd6000830184610bb9565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610c28610c23610c1e84610be3565b610c03565b610be3565b9050919050565b6000610c3a82610c0d565b9050919050565b6000610c4c82610c2f565b9050919050565b610c5c81610c41565b82525050565b6000602082019050610c776000830184610c53565b92915050565b6000610c8882610c2f565b9050919050565b610c9881610c7d565b82525050565b6000602082019050610cb36000830184610c8f565b92915050565b600063ffffffff82169050919050565b610cd281610cb9565b82525050565b6000602082019050610ced6000830184610cc9565b92915050565b610cfc81610b12565b82525050565b6000602082019050610d176000830184610cf3565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112610d4257610d41610d1d565b5b8235905067ffffffffffffffff811115610d5f57610d5e610d22565b5b602083019150836020820283011115610d7b57610d7a610d27565b5b9250929050565b60008060208385031215610d9957610d98610b08565b5b600083013567ffffffffffffffff811115610db757610db6610b0d565b5b610dc385828601610d2c565b92509250509250929050565b6000610dda82610be3565b9050919050565b610dea81610dcf565b8114610df557600080fd5b50565b600081359050610e0781610de1565b92915050565b600081905082602060080282011115610e2957610e28610d27565b5b92915050565b60008060006101408486031215610e4957610e48610b08565b5b6000610e5786828701610b33565b9350506020610e6886828701610df8565b9250506040610e7986828701610e0d565b9150509250925092565b6000610e8e82610be3565b9050919050565b610e9e81610e83565b82525050565b6000602082019050610eb96000830184610e95565b92915050565b610ec881610e83565b8114610ed357600080fd5b50565b600081359050610ee581610ebf565b92915050565b600060208284031215610f0157610f00610b08565b5b6000610f0f84828501610ed6565b91505092915050565b600081519050610f2781610b1c565b92915050565b600060208284031215610f4357610f42610b08565b5b6000610f5184828501610f18565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610ff6602683610f89565b915061100182610f9a565b604082019050919050565b6000602082019050818103600083015261102581610fe9565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611062602083610f89565b915061106d8261102c565b602082019050919050565b6000602082019050818103600083015261109181611055565b9050919050565b60006040820190506110ad6000830185610cf3565b6110ba6020830184610cf3565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006110fb82610b12565b915061110683610b12565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561113b5761113a6110c1565b5b82820190509291505056fea2646970667358221220507a65829a9a551e42c8757b2613a358880e56baec43e730dff9d9aa252c9a3564736f6c634300080f0033a26469706673582212208cc71be49f97f4fad7da0c74d0576129e139d0ef30e3ac4be6a3214675ab1d5264736f6c634300080f0033" -else: - # This contract code is used in deployment, note: this is not the deployedBytecode, it includes constructor args. - # Ref: https://github.com/waku-org/waku-rln-contract/blob/886891b57ae54e439563023dd50161fec5ee29f1/deployments/sepolia/WakuRlnRegistry_Implementation.json - const RegistryContractCode* = - "0x60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152506000606760006101000a81548161ffff021916908361ffff16021790555034801561006157600080fd5b50608051614429610099600039600081816106870152818161071801528181610922015281816109b30152610a6c01526144296000f3fe6080604052600436106200010a5760003560e01c80638da5cb5b1162000097578063f184ef4c1162000061578063f184ef4c14620002f3578063f2fde38b1462000323578063f55421471462000351578063fc6ed4641462000395576200010a565b80638da5cb5b146200024b578063cf616374146200027b578063d44fda1f14620002ab578063ef653d5e14620002c5576200010a565b806352d1902d11620000d957806352d1902d14620001b95780635a244efd14620001e9578063715018a614620002175780638129fc1c1462000231576200010a565b80632de999bf146200010f5780633659cfe6146200013d57806339c0364b146200016b5780634f1ef2861462000199575b600080fd5b3480156200011c57600080fd5b506200013b60048036038101906200013591906200197b565b620003c3565b005b3480156200014a57600080fd5b5062000169600480360381019062000163919062001a6e565b62000685565b005b3480156200017857600080fd5b5062000197600480360381019062000191919062001b1a565b6200081d565b005b620001b76004803603810190620001b1919062001cd3565b62000920565b005b348015620001c657600080fd5b50620001d162000a68565b604051620001e0919062001d54565b60405180910390f35b348015620001f657600080fd5b506200021560048036038101906200020f919062001d71565b62000b24565b005b3480156200022457600080fd5b506200022f62000bc7565b005b3480156200023e57600080fd5b506200024962000bdf565b005b3480156200025857600080fd5b506200026362000d2b565b60405162000272919062001db4565b60405180910390f35b3480156200028857600080fd5b506200029362000d55565b604051620002a2919062001de2565b60405180910390f35b348015620002b857600080fd5b50620002c362000d69565b005b348015620002d257600080fd5b50620002f16004803603810190620002eb919062001a6e565b62000e13565b005b3480156200030057600080fd5b506200030b62000ef4565b6040516200031a919062001de2565b60405180910390f35b3480156200033057600080fd5b506200034f600480360381019062000349919062001a6e565b62000f08565b005b3480156200035e57600080fd5b506200037d600480360381019062000377919062001dff565b62000f92565b6040516200038c919062001db4565b60405180910390f35b348015620003a257600080fd5b50620003c16004803603810190620003bb919062001e31565b62000fc5565b005b606560009054906101000a900461ffff1661ffff16606760009054906101000a900461ffff1661ffff161062000425576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b6001156200067f5760666000606760009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632de999bf858585856040518563ffffffff1660e01b8152600401620004ba949392919062001f57565b600060405180830381600087803b158015620004d557600080fd5b505af1925050508015620004e7575060015b62000673573d80600081146200051a576040519150601f19603f3d011682016040523d82523d6000602084013e6200051f565b606091505b506040516024016040516020818303038152906040527f57f69531000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505080519060200120818051906020012014620005c057805181602001fd5b606560009054906101000a900461ffff1661ffff166001606760009054906101000a900461ffff16620005f4919062001fc5565b61ffff161062000630576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606760008282829054906101000a900461ffff1662000652919062001fc5565b92506101000a81548161ffff021916908361ffff1602179055505062000679565b6200067f565b62000426565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff160362000716576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200070d9062002089565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1662000757620010ce565b73ffffffffffffffffffffffffffffffffffffffff1614620007b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620007a79062002121565b60405180910390fd5b620007bb8162001127565b6200081a81600067ffffffffffffffff811115620007de57620007dd62001b8c565b5b6040519080825280601f01601f191660200182016040528015620008115781602001600182028036833780820191505090505b50600062001134565b50565b606560009054906101000a900461ffff1661ffff168361ffff16106200086f576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606660008461ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d66d6c1083836040518363ffffffff1660e01b8152600401620008e792919062002154565b600060405180830381600087803b1580156200090257600080fd5b505af115801562000917573d6000803e3d6000fd5b50505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1603620009b1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620009a89062002089565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16620009f2620010ce565b73ffffffffffffffffffffffffffffffffffffffff161462000a4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000a429062002121565b60405180910390fd5b62000a568262001127565b62000a648282600162001134565b5050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161462000afb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000af290620021f7565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b62000b2e620012b3565b6000810362000b69576040517fe671aff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081606560009054906101000a900461ffff1660405162000b8b90620018eb565b62000b9892919062002219565b604051809103906000f08015801562000bb5573d6000803e3d6000fd5b50905062000bc38162001338565b5050565b62000bd1620012b3565b62000bdd60006200142c565b565b60008060019054906101000a900460ff1615905080801562000c115750600160008054906101000a900460ff1660ff16105b8062000c42575062000c2330620014f2565b15801562000c415750600160008054906101000a900460ff1660ff16145b5b62000c84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c7b90620022bc565b60405180910390fd5b60016000806101000a81548160ff021916908360ff160217905550801562000cc2576001600060016101000a81548160ff0219169083151502179055505b62000ccc62001515565b801562000d285760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405162000d1f919062002338565b60405180910390a15b50565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606760009054906101000a900461ffff1681565b62000d73620012b3565b606560009054906101000a900461ffff1661ffff16606760009054906101000a900461ffff1661ffff161062000dd5576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606760008282829054906101000a900461ffff1662000df7919062001fc5565b92506101000a81548161ffff021916908361ffff160217905550565b62000e1d620012b3565b6000819050606560009054906101000a900461ffff1661ffff168173ffffffffffffffffffffffffffffffffffffffff166328b070e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e83573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ea991906200236c565b61ffff161462000ee5576040517fb893b72300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000ef08262001338565b5050565b606560009054906101000a900461ffff1681565b62000f12620012b3565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160362000f84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000f7b9062002414565b60405180910390fd5b62000f8f816200142c565b50565b60666020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606560009054906101000a900461ffff1661ffff168561ffff161062001017576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606660008661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632de999bf858585856040518563ffffffff1660e01b815260040162001093949392919062001f57565b600060405180830381600087803b158015620010ae57600080fd5b505af1158015620010c3573d6000803e3d6000fd5b505050505050505050565b6000620010fe7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b62001573565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b62001131620012b3565b50565b620011627f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b6200157d565b60000160009054906101000a900460ff16156200118a57620011848362001587565b620012ae565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620011f557506040513d601f19601f82011682018060405250810190620011f2919062002467565b60015b62001237576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200122e906200250f565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b81146200129f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200129690620025a7565b60405180910390fd5b50620012ad83838362001647565b5b505050565b620012bd62001679565b73ffffffffffffffffffffffffffffffffffffffff16620012dd62000d2b565b73ffffffffffffffffffffffffffffffffffffffff161462001336576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200132d9062002619565b60405180910390fd5b565b8060666000606560009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcf6a3b406170499209d0fcf152a1605c7c5a5c99c855e2bb803433fc960718eb606560009054906101000a900461ffff1682604051620013e59291906200263b565b60405180910390a16001606560008282829054906101000a900461ffff166200140f919062001fc5565b92506101000a81548161ffff021916908361ffff16021790555050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1662001567576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200155e90620026de565b60405180910390fd5b6200157162001681565b565b6000819050919050565b6000819050919050565b6200159281620016e9565b620015d4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620015cb9062002776565b60405180910390fd5b80620016037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b62001573565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b62001652836200170c565b600082511180620016605750805b1562001674576200167283836200175d565b505b505050565b600033905090565b600060019054906101000a900460ff16620016d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620016ca90620026de565b60405180910390fd5b620016e7620016e162001679565b6200142c565b565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b620017178162001587565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060620017858383604051806060016040528060278152602001620043cd602791396200178d565b905092915050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051620017b9919062002811565b600060405180830381855af49150503d8060008114620017f6576040519150601f19603f3d011682016040523d82523d6000602084013e620017fb565b606091505b50915091506200180e8683838762001819565b925050509392505050565b60608315620018835760008351036200187a576200183785620016e9565b62001879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162001870906200287a565b60405180910390fd5b5b82905062001890565b6200188f838362001898565b5b949350505050565b600082511115620018ac5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620018e29190620028e8565b60405180910390fd5b611ac0806200290d83390190565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126200193557620019346200190d565b5b8235905067ffffffffffffffff81111562001955576200195462001912565b5b60208301915083602082028301111562001974576200197362001917565b5b9250929050565b6000806000806040858703121562001998576200199762001903565b5b600085013567ffffffffffffffff811115620019b957620019b862001908565b5b620019c7878288016200191c565b9450945050602085013567ffffffffffffffff811115620019ed57620019ec62001908565b5b620019fb878288016200191c565b925092505092959194509250565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062001a368262001a09565b9050919050565b62001a488162001a29565b811462001a5457600080fd5b50565b60008135905062001a688162001a3d565b92915050565b60006020828403121562001a875762001a8662001903565b5b600062001a978482850162001a57565b91505092915050565b600061ffff82169050919050565b62001ab98162001aa0565b811462001ac557600080fd5b50565b60008135905062001ad98162001aae565b92915050565b6000819050919050565b62001af48162001adf565b811462001b0057600080fd5b50565b60008135905062001b148162001ae9565b92915050565b60008060006060848603121562001b365762001b3562001903565b5b600062001b468682870162001ac8565b935050602062001b598682870162001b03565b925050604062001b6c8682870162001b03565b9150509250925092565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62001bc68262001b7b565b810181811067ffffffffffffffff8211171562001be85762001be762001b8c565b5b80604052505050565b600062001bfd620018f9565b905062001c0b828262001bbb565b919050565b600067ffffffffffffffff82111562001c2e5762001c2d62001b8c565b5b62001c398262001b7b565b9050602081019050919050565b82818337600083830152505050565b600062001c6c62001c668462001c10565b62001bf1565b90508281526020810184848401111562001c8b5762001c8a62001b76565b5b62001c9884828562001c46565b509392505050565b600082601f83011262001cb85762001cb76200190d565b5b813562001cca84826020860162001c55565b91505092915050565b6000806040838503121562001ced5762001cec62001903565b5b600062001cfd8582860162001a57565b925050602083013567ffffffffffffffff81111562001d215762001d2062001908565b5b62001d2f8582860162001ca0565b9150509250929050565b6000819050919050565b62001d4e8162001d39565b82525050565b600060208201905062001d6b600083018462001d43565b92915050565b60006020828403121562001d8a5762001d8962001903565b5b600062001d9a8482850162001b03565b91505092915050565b62001dae8162001a29565b82525050565b600060208201905062001dcb600083018462001da3565b92915050565b62001ddc8162001aa0565b82525050565b600060208201905062001df9600083018462001dd1565b92915050565b60006020828403121562001e185762001e1762001903565b5b600062001e288482850162001ac8565b91505092915050565b60008060008060006060868803121562001e505762001e4f62001903565b5b600062001e608882890162001ac8565b955050602086013567ffffffffffffffff81111562001e845762001e8362001908565b5b62001e92888289016200191c565b9450945050604086013567ffffffffffffffff81111562001eb85762001eb762001908565b5b62001ec6888289016200191c565b92509250509295509295909350565b600082825260208201905092915050565b600080fd5b82818337505050565b600062001f02838562001ed5565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111562001f385762001f3762001ee6565b5b60208302925062001f4b83858462001eeb565b82840190509392505050565b6000604082019050818103600083015262001f7481868862001ef4565b9050818103602083015262001f8b81848662001ef4565b905095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062001fd28262001aa0565b915062001fdf8362001aa0565b9250828201905061ffff81111562001ffc5762001ffb62001f96565b5b92915050565b600082825260208201905092915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b600062002071602c8362002002565b91506200207e8262002013565b604082019050919050565b60006020820190508181036000830152620020a48162002062565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b600062002109602c8362002002565b91506200211682620020ab565b604082019050919050565b600060208201905081810360008301526200213c81620020fa565b9050919050565b6200214e8162001adf565b82525050565b60006040820190506200216b600083018562002143565b6200217a602083018462002143565b9392505050565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b6000620021df60388362002002565b9150620021ec8262002181565b604082019050919050565b600060208201905081810360008301526200221281620021d0565b9050919050565b600060408201905062002230600083018562002143565b6200223f602083018462001dd1565b9392505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000620022a4602e8362002002565b9150620022b18262002246565b604082019050919050565b60006020820190508181036000830152620022d78162002295565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b6000620023206200231a6200231484620022de565b620022f5565b620022e8565b9050919050565b6200233281620022ff565b82525050565b60006020820190506200234f600083018462002327565b92915050565b600081519050620023668162001aae565b92915050565b60006020828403121562002385576200238462001903565b5b6000620023958482850162002355565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000620023fc60268362002002565b915062002409826200239e565b604082019050919050565b600060208201905081810360008301526200242f81620023ed565b9050919050565b620024418162001d39565b81146200244d57600080fd5b50565b600081519050620024618162002436565b92915050565b60006020828403121562002480576200247f62001903565b5b6000620024908482850162002450565b91505092915050565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b6000620024f7602e8362002002565b9150620025048262002499565b604082019050919050565b600060208201905081810360008301526200252a81620024e8565b9050919050565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b60006200258f60298362002002565b91506200259c8262002531565b604082019050919050565b60006020820190508181036000830152620025c28162002580565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006200260160208362002002565b91506200260e82620025c9565b602082019050919050565b600060208201905081810360008301526200263481620025f2565b9050919050565b600060408201905062002652600083018562001dd1565b62002661602083018462001da3565b9392505050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000620026c6602b8362002002565b9150620026d38262002668565b604082019050919050565b60006020820190508181036000830152620026f981620026b7565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006200275e602d8362002002565b91506200276b8262002700565b604082019050919050565b6000602082019050818103600083015262002791816200274f565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015620027ce578082015181840152602081019050620027b1565b60008484015250505050565b6000620027e78262002798565b620027f38185620027a3565b935062002805818560208601620027ae565b80840191505092915050565b60006200281f8284620027da565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600062002862601d8362002002565b91506200286f826200282a565b602082019050919050565b60006020820190508181036000830152620028958162002853565b9050919050565b600081519050919050565b6000620028b4826200289c565b620028c0818562002002565b9350620028d2818560208601620027ae565b620028dd8162001b7b565b840191505092915050565b60006020820190508181036000830152620029048184620028a7565b90509291505056fe61016060405260006001553480156200001757600080fd5b5060405162001ac038038062001ac083398181016040528101906200003d91906200023a565b600060148360006200006462000058620000ef60201b60201c565b620000f760201b60201c565b8360a0818152505081608081815250508260c08181525050826001901b60e081815250508073ffffffffffffffffffffffffffffffffffffffff166101008173ffffffffffffffffffffffffffffffffffffffff16815250504363ffffffff166101208163ffffffff1681525050505050508061ffff166101408161ffff1681525050505062000281565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b6000819050919050565b620001d581620001c0565b8114620001e157600080fd5b50565b600081519050620001f581620001ca565b92915050565b600061ffff82169050919050565b6200021481620001fb565b81146200022057600080fd5b50565b600081519050620002348162000209565b92915050565b60008060408385031215620002545762000253620001bb565b5b60006200026485828601620001e4565b9250506020620002778582860162000223565b9150509250929050565b60805160a05160c05160e0516101005161012051610140516117cf620002f16000396000610661015260006107c401526000610685015260008181610a4a0152610f24015260006109f001526000818161075f0152610aa00152600081816106050152610dd201526117cf6000f3fe6080604052600436106101665760003560e01c80638be9b119116100d1578063bc4991281161008a578063d66d6c1011610064578063d66d6c1014610568578063e493ef8c14610584578063f220b9ec146105af578063f2fde38b146105da57610166565b8063bc499128146104c3578063c5b208ff14610500578063d0383d681461053d57610166565b80638be9b1191461039f5780638da5cb5b146103c85780639056a9bf146103f3578063933ebfdd1461043057806398366e351461046d578063ae74552a1461049857610166565b80633ccfd60b116101235780633ccfd60b1461028f5780634add651e146102a65780635daf08ca146102d15780636bdcc8ab1461030e578063715018a61461034b5780637671ac051461036257610166565b806309aeb04c1461016b57806322d9730c1461019657806328b070e0146101d35780632b7ac3f3146101fe5780632de999bf14610229578063378de45b14610252575b600080fd5b34801561017757600080fd5b50610180610603565b60405161018d9190610f9c565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190610fed565b610627565b6040516101ca9190611035565b60405180910390f35b3480156101df57600080fd5b506101e861065f565b6040516101f5919061106d565b60405180910390f35b34801561020a57600080fd5b50610213610683565b6040516102209190611107565b60405180910390f35b34801561023557600080fd5b50610250600480360381019061024b9190611187565b6106a7565b005b34801561025e57600080fd5b5061027960048036038101906102749190610fed565b61075b565b6040516102869190610f9c565b60405180910390f35b34801561029b57600080fd5b506102a4610790565b005b3480156102b257600080fd5b506102bb6107c2565b6040516102c89190611227565b60405180910390f35b3480156102dd57600080fd5b506102f860048036038101906102f39190610fed565b6107e6565b6040516103059190610f9c565b60405180910390f35b34801561031a57600080fd5b5061033560048036038101906103309190610fed565b6107fe565b6040516103429190611035565b60405180910390f35b34801561035757600080fd5b5061036061081e565b005b34801561036e57600080fd5b5061038960048036038101906103849190610fed565b610832565b6040516103969190610f9c565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c191906112a2565b61084a565b005b3480156103d457600080fd5b506103dd61085a565b6040516103ea9190611317565b60405180910390f35b3480156103ff57600080fd5b5061041a60048036038101906104159190610fed565b610883565b6040516104279190610f9c565b60405180910390f35b34801561043c57600080fd5b5061045760048036038101906104529190611332565b61089b565b6040516104649190611430565b60405180910390f35b34801561047957600080fd5b506104826109ee565b60405161048f9190610f9c565b60405180910390f35b3480156104a457600080fd5b506104ad610a12565b6040516104ba9190610f9c565b60405180910390f35b3480156104cf57600080fd5b506104ea60048036038101906104e59190610fed565b610a18565b6040516104f79190610f9c565b60405180910390f35b34801561050c57600080fd5b506105276004803603810190610522919061147e565b610a30565b6040516105349190610f9c565b60405180910390f35b34801561054957600080fd5b50610552610a48565b60405161055f9190610f9c565b60405180910390f35b610582600480360381019061057d9190611332565b610a6c565b005b34801561059057600080fd5b50610599610a7a565b6040516105a69190610f9c565b60405180910390f35b3480156105bb57600080fd5b506105c4610a9e565b6040516105d19190610f9c565b60405180910390f35b3480156105e657600080fd5b5061060160048036038101906105fc919061147e565b610ac2565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b600080821415801561065857507f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000182105b9050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6106af610b45565b838383836106bf84848484610bc3565b6106f5576040517fb750624800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600088889050905060005b8181101561074f576107448a8a8381811061071e5761071d6114ab565b5b90506020020135898984818110610738576107376114ab565b5b90506020020135610bf5565b806001019050610700565b50505050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000826107899190611509565b9050919050565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b60036020528060005260406000206000915090505481565b60066020528060005260406000206000915054906101000a900460ff1681565b610826610b45565b6108306000610cd1565b565b60056020528060005260406000206000915090505481565b610855838383610d95565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60046020528060005260406000206000915090505481565b60608183106108e35782826040517f9ffcd53d0000000000000000000000000000000000000000000000000000000081526004016108da92919061154b565b60405180910390fd5b60015482111561092c5782826040517f9ffcd53d00000000000000000000000000000000000000000000000000000000815260040161092392919061154b565b60405180910390fd5b6000838361093a9190611574565b67ffffffffffffffff811115610953576109526115a8565b5b6040519080825280602002602001820160405280156109815781602001602082028036833780820191505090505b50905060008490505b838110156109e35760056000828152602001908152602001600020548286836109b39190611574565b815181106109c4576109c36114ab565b5b60200260200101818152505080806109db906115d7565b91505061098a565b508091505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60026020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b7f000000000000000000000000000000000000000000000000000000000000000081565b610a768282610bf5565b5050565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000181565b7f000000000000000000000000000000000000000000000000000000000000000081565b610aca610b45565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b30906116a2565b60405180910390fd5b610b4281610cd1565b50565b610b4d610dc7565b73ffffffffffffffffffffffffffffffffffffffff16610b6b61085a565b73ffffffffffffffffffffffffffffffffffffffff1614610bc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb89061170e565b60405180910390fd5b565b6000808585905090506000848490509050808214610be657600092505050610bed565b6001925050505b949350505050565b610bff8282610dcf565b6001546003600084815260200190815260200160002081905550816005600060015481526020019081526020016000208190555060016006600084815260200190815260200160002060006101000a81548160ff0219169083151502179055508060046000848152602001908152602001600020819055507fff42916a89d1f5125f7f47168ee59c2b3fc9246ad1b229082ee85b69d001b5d78282600154604051610cac9392919061172e565b60405180910390a16001806000828254610cc69190611765565b925050819055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600033905090565b807f0000000000000000000000000000000000000000000000000000000000000000811115610e3557806040517f13a5e2ee000000000000000000000000000000000000000000000000000000008152600401610e2c9190610f9c565b60405180910390fd5b60008103610e7a57806040517f13a5e2ee000000000000000000000000000000000000000000000000000000008152600401610e719190610f9c565b60405180910390fd5b82610e8481610627565b610ec557806040517f7f3e75af000000000000000000000000000000000000000000000000000000008152600401610ebc9190610f9c565b60405180910390fd5b600115156006600086815260200190815260200160002060009054906101000a900460ff16151503610f22576040517e0a60f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000060015410610f7d576040517f57f6953100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6000819050919050565b610f9681610f83565b82525050565b6000602082019050610fb16000830184610f8d565b92915050565b600080fd5b600080fd5b610fca81610f83565b8114610fd557600080fd5b50565b600081359050610fe781610fc1565b92915050565b60006020828403121561100357611002610fb7565b5b600061101184828501610fd8565b91505092915050565b60008115159050919050565b61102f8161101a565b82525050565b600060208201905061104a6000830184611026565b92915050565b600061ffff82169050919050565b61106781611050565b82525050565b6000602082019050611082600083018461105e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006110cd6110c86110c384611088565b6110a8565b611088565b9050919050565b60006110df826110b2565b9050919050565b60006110f1826110d4565b9050919050565b611101816110e6565b82525050565b600060208201905061111c60008301846110f8565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261114757611146611122565b5b8235905067ffffffffffffffff81111561116457611163611127565b5b6020830191508360208202830111156111805761117f61112c565b5b9250929050565b600080600080604085870312156111a1576111a0610fb7565b5b600085013567ffffffffffffffff8111156111bf576111be610fbc565b5b6111cb87828801611131565b9450945050602085013567ffffffffffffffff8111156111ee576111ed610fbc565b5b6111fa87828801611131565b925092505092959194509250565b600063ffffffff82169050919050565b61122181611208565b82525050565b600060208201905061123c6000830184611218565b92915050565b600061124d82611088565b9050919050565b61125d81611242565b811461126857600080fd5b50565b60008135905061127a81611254565b92915050565b60008190508260206008028201111561129c5761129b61112c565b5b92915050565b600080600061014084860312156112bc576112bb610fb7565b5b60006112ca86828701610fd8565b93505060206112db8682870161126b565b92505060406112ec86828701611280565b9150509250925092565b600061130182611088565b9050919050565b611311816112f6565b82525050565b600060208201905061132c6000830184611308565b92915050565b6000806040838503121561134957611348610fb7565b5b600061135785828601610fd8565b925050602061136885828601610fd8565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6113a781610f83565b82525050565b60006113b9838361139e565b60208301905092915050565b6000602082019050919050565b60006113dd82611372565b6113e7818561137d565b93506113f28361138e565b8060005b8381101561142357815161140a88826113ad565b9750611415836113c5565b9250506001810190506113f6565b5085935050505092915050565b6000602082019050818103600083015261144a81846113d2565b905092915050565b61145b816112f6565b811461146657600080fd5b50565b60008135905061147881611452565b92915050565b60006020828403121561149457611493610fb7565b5b60006114a284828501611469565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061151482610f83565b915061151f83610f83565b925082820261152d81610f83565b91508282048414831517611544576115436114da565b5b5092915050565b60006040820190506115606000830185610f8d565b61156d6020830184610f8d565b9392505050565b600061157f82610f83565b915061158a83610f83565b92508282039050818111156115a2576115a16114da565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006115e282610f83565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611614576116136114da565b5b600182019050919050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061168c60268361161f565b915061169782611630565b604082019050919050565b600060208201905081810360008301526116bb8161167f565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006116f860208361161f565b9150611703826116c2565b602082019050919050565b60006020820190508181036000830152611727816116eb565b9050919050565b60006060820190506117436000830186610f8d565b6117506020830185610f8d565b61175d6040830184610f8d565b949350505050565b600061177082610f83565b915061177b83610f83565b9250828201905080821115611793576117926114da565b5b9291505056fea2646970667358221220f3d63817472861b92ed47c1c0a059033d26762a83df789a2f02dba13d9cc3df464736f6c63430008130033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206950adc7c418dd947ac3e184fb9f4d3a3206a03ca637b1c5a6fa23e8ae800c7464736f6c63430008130033" +# This contract code is used in deployment, note: this is not the deployedBytecode, it includes constructor args. +# Ref: https://github.com/waku-org/waku-rln-contract/blob/886891b57ae54e439563023dd50161fec5ee29f1/deployments/sepolia/WakuRlnRegistry_Implementation.json +const RegistryContractCode* = + "0x60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152506000606760006101000a81548161ffff021916908361ffff16021790555034801561006157600080fd5b50608051614429610099600039600081816106870152818161071801528181610922015281816109b30152610a6c01526144296000f3fe6080604052600436106200010a5760003560e01c80638da5cb5b1162000097578063f184ef4c1162000061578063f184ef4c14620002f3578063f2fde38b1462000323578063f55421471462000351578063fc6ed4641462000395576200010a565b80638da5cb5b146200024b578063cf616374146200027b578063d44fda1f14620002ab578063ef653d5e14620002c5576200010a565b806352d1902d11620000d957806352d1902d14620001b95780635a244efd14620001e9578063715018a614620002175780638129fc1c1462000231576200010a565b80632de999bf146200010f5780633659cfe6146200013d57806339c0364b146200016b5780634f1ef2861462000199575b600080fd5b3480156200011c57600080fd5b506200013b60048036038101906200013591906200197b565b620003c3565b005b3480156200014a57600080fd5b5062000169600480360381019062000163919062001a6e565b62000685565b005b3480156200017857600080fd5b5062000197600480360381019062000191919062001b1a565b6200081d565b005b620001b76004803603810190620001b1919062001cd3565b62000920565b005b348015620001c657600080fd5b50620001d162000a68565b604051620001e0919062001d54565b60405180910390f35b348015620001f657600080fd5b506200021560048036038101906200020f919062001d71565b62000b24565b005b3480156200022457600080fd5b506200022f62000bc7565b005b3480156200023e57600080fd5b506200024962000bdf565b005b3480156200025857600080fd5b506200026362000d2b565b60405162000272919062001db4565b60405180910390f35b3480156200028857600080fd5b506200029362000d55565b604051620002a2919062001de2565b60405180910390f35b348015620002b857600080fd5b50620002c362000d69565b005b348015620002d257600080fd5b50620002f16004803603810190620002eb919062001a6e565b62000e13565b005b3480156200030057600080fd5b506200030b62000ef4565b6040516200031a919062001de2565b60405180910390f35b3480156200033057600080fd5b506200034f600480360381019062000349919062001a6e565b62000f08565b005b3480156200035e57600080fd5b506200037d600480360381019062000377919062001dff565b62000f92565b6040516200038c919062001db4565b60405180910390f35b348015620003a257600080fd5b50620003c16004803603810190620003bb919062001e31565b62000fc5565b005b606560009054906101000a900461ffff1661ffff16606760009054906101000a900461ffff1661ffff161062000425576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b6001156200067f5760666000606760009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632de999bf858585856040518563ffffffff1660e01b8152600401620004ba949392919062001f57565b600060405180830381600087803b158015620004d557600080fd5b505af1925050508015620004e7575060015b62000673573d80600081146200051a576040519150601f19603f3d011682016040523d82523d6000602084013e6200051f565b606091505b506040516024016040516020818303038152906040527f57f69531000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505080519060200120818051906020012014620005c057805181602001fd5b606560009054906101000a900461ffff1661ffff166001606760009054906101000a900461ffff16620005f4919062001fc5565b61ffff161062000630576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606760008282829054906101000a900461ffff1662000652919062001fc5565b92506101000a81548161ffff021916908361ffff1602179055505062000679565b6200067f565b62000426565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff160362000716576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200070d9062002089565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1662000757620010ce565b73ffffffffffffffffffffffffffffffffffffffff1614620007b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620007a79062002121565b60405180910390fd5b620007bb8162001127565b6200081a81600067ffffffffffffffff811115620007de57620007dd62001b8c565b5b6040519080825280601f01601f191660200182016040528015620008115781602001600182028036833780820191505090505b50600062001134565b50565b606560009054906101000a900461ffff1661ffff168361ffff16106200086f576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606660008461ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d66d6c1083836040518363ffffffff1660e01b8152600401620008e792919062002154565b600060405180830381600087803b1580156200090257600080fd5b505af115801562000917573d6000803e3d6000fd5b50505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1603620009b1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620009a89062002089565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16620009f2620010ce565b73ffffffffffffffffffffffffffffffffffffffff161462000a4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000a429062002121565b60405180910390fd5b62000a568262001127565b62000a648282600162001134565b5050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161462000afb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000af290620021f7565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b62000b2e620012b3565b6000810362000b69576040517fe671aff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081606560009054906101000a900461ffff1660405162000b8b90620018eb565b62000b9892919062002219565b604051809103906000f08015801562000bb5573d6000803e3d6000fd5b50905062000bc38162001338565b5050565b62000bd1620012b3565b62000bdd60006200142c565b565b60008060019054906101000a900460ff1615905080801562000c115750600160008054906101000a900460ff1660ff16105b8062000c42575062000c2330620014f2565b15801562000c415750600160008054906101000a900460ff1660ff16145b5b62000c84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c7b90620022bc565b60405180910390fd5b60016000806101000a81548160ff021916908360ff160217905550801562000cc2576001600060016101000a81548160ff0219169083151502179055505b62000ccc62001515565b801562000d285760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405162000d1f919062002338565b60405180910390a15b50565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606760009054906101000a900461ffff1681565b62000d73620012b3565b606560009054906101000a900461ffff1661ffff16606760009054906101000a900461ffff1661ffff161062000dd5576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606760008282829054906101000a900461ffff1662000df7919062001fc5565b92506101000a81548161ffff021916908361ffff160217905550565b62000e1d620012b3565b6000819050606560009054906101000a900461ffff1661ffff168173ffffffffffffffffffffffffffffffffffffffff166328b070e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e83573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ea991906200236c565b61ffff161462000ee5576040517fb893b72300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000ef08262001338565b5050565b606560009054906101000a900461ffff1681565b62000f12620012b3565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160362000f84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000f7b9062002414565b60405180910390fd5b62000f8f816200142c565b50565b60666020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606560009054906101000a900461ffff1661ffff168561ffff161062001017576040517fd23276a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606660008661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632de999bf858585856040518563ffffffff1660e01b815260040162001093949392919062001f57565b600060405180830381600087803b158015620010ae57600080fd5b505af1158015620010c3573d6000803e3d6000fd5b505050505050505050565b6000620010fe7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b62001573565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b62001131620012b3565b50565b620011627f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b6200157d565b60000160009054906101000a900460ff16156200118a57620011848362001587565b620012ae565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620011f557506040513d601f19601f82011682018060405250810190620011f2919062002467565b60015b62001237576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200122e906200250f565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b81146200129f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200129690620025a7565b60405180910390fd5b50620012ad83838362001647565b5b505050565b620012bd62001679565b73ffffffffffffffffffffffffffffffffffffffff16620012dd62000d2b565b73ffffffffffffffffffffffffffffffffffffffff161462001336576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200132d9062002619565b60405180910390fd5b565b8060666000606560009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcf6a3b406170499209d0fcf152a1605c7c5a5c99c855e2bb803433fc960718eb606560009054906101000a900461ffff1682604051620013e59291906200263b565b60405180910390a16001606560008282829054906101000a900461ffff166200140f919062001fc5565b92506101000a81548161ffff021916908361ffff16021790555050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1662001567576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200155e90620026de565b60405180910390fd5b6200157162001681565b565b6000819050919050565b6000819050919050565b6200159281620016e9565b620015d4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620015cb9062002776565b60405180910390fd5b80620016037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b62001573565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b62001652836200170c565b600082511180620016605750805b1562001674576200167283836200175d565b505b505050565b600033905090565b600060019054906101000a900460ff16620016d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620016ca90620026de565b60405180910390fd5b620016e7620016e162001679565b6200142c565b565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b620017178162001587565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060620017858383604051806060016040528060278152602001620043cd602791396200178d565b905092915050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051620017b9919062002811565b600060405180830381855af49150503d8060008114620017f6576040519150601f19603f3d011682016040523d82523d6000602084013e620017fb565b606091505b50915091506200180e8683838762001819565b925050509392505050565b60608315620018835760008351036200187a576200183785620016e9565b62001879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162001870906200287a565b60405180910390fd5b5b82905062001890565b6200188f838362001898565b5b949350505050565b600082511115620018ac5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620018e29190620028e8565b60405180910390fd5b611ac0806200290d83390190565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126200193557620019346200190d565b5b8235905067ffffffffffffffff81111562001955576200195462001912565b5b60208301915083602082028301111562001974576200197362001917565b5b9250929050565b6000806000806040858703121562001998576200199762001903565b5b600085013567ffffffffffffffff811115620019b957620019b862001908565b5b620019c7878288016200191c565b9450945050602085013567ffffffffffffffff811115620019ed57620019ec62001908565b5b620019fb878288016200191c565b925092505092959194509250565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062001a368262001a09565b9050919050565b62001a488162001a29565b811462001a5457600080fd5b50565b60008135905062001a688162001a3d565b92915050565b60006020828403121562001a875762001a8662001903565b5b600062001a978482850162001a57565b91505092915050565b600061ffff82169050919050565b62001ab98162001aa0565b811462001ac557600080fd5b50565b60008135905062001ad98162001aae565b92915050565b6000819050919050565b62001af48162001adf565b811462001b0057600080fd5b50565b60008135905062001b148162001ae9565b92915050565b60008060006060848603121562001b365762001b3562001903565b5b600062001b468682870162001ac8565b935050602062001b598682870162001b03565b925050604062001b6c8682870162001b03565b9150509250925092565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62001bc68262001b7b565b810181811067ffffffffffffffff8211171562001be85762001be762001b8c565b5b80604052505050565b600062001bfd620018f9565b905062001c0b828262001bbb565b919050565b600067ffffffffffffffff82111562001c2e5762001c2d62001b8c565b5b62001c398262001b7b565b9050602081019050919050565b82818337600083830152505050565b600062001c6c62001c668462001c10565b62001bf1565b90508281526020810184848401111562001c8b5762001c8a62001b76565b5b62001c9884828562001c46565b509392505050565b600082601f83011262001cb85762001cb76200190d565b5b813562001cca84826020860162001c55565b91505092915050565b6000806040838503121562001ced5762001cec62001903565b5b600062001cfd8582860162001a57565b925050602083013567ffffffffffffffff81111562001d215762001d2062001908565b5b62001d2f8582860162001ca0565b9150509250929050565b6000819050919050565b62001d4e8162001d39565b82525050565b600060208201905062001d6b600083018462001d43565b92915050565b60006020828403121562001d8a5762001d8962001903565b5b600062001d9a8482850162001b03565b91505092915050565b62001dae8162001a29565b82525050565b600060208201905062001dcb600083018462001da3565b92915050565b62001ddc8162001aa0565b82525050565b600060208201905062001df9600083018462001dd1565b92915050565b60006020828403121562001e185762001e1762001903565b5b600062001e288482850162001ac8565b91505092915050565b60008060008060006060868803121562001e505762001e4f62001903565b5b600062001e608882890162001ac8565b955050602086013567ffffffffffffffff81111562001e845762001e8362001908565b5b62001e92888289016200191c565b9450945050604086013567ffffffffffffffff81111562001eb85762001eb762001908565b5b62001ec6888289016200191c565b92509250509295509295909350565b600082825260208201905092915050565b600080fd5b82818337505050565b600062001f02838562001ed5565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111562001f385762001f3762001ee6565b5b60208302925062001f4b83858462001eeb565b82840190509392505050565b6000604082019050818103600083015262001f7481868862001ef4565b9050818103602083015262001f8b81848662001ef4565b905095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062001fd28262001aa0565b915062001fdf8362001aa0565b9250828201905061ffff81111562001ffc5762001ffb62001f96565b5b92915050565b600082825260208201905092915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b600062002071602c8362002002565b91506200207e8262002013565b604082019050919050565b60006020820190508181036000830152620020a48162002062565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b600062002109602c8362002002565b91506200211682620020ab565b604082019050919050565b600060208201905081810360008301526200213c81620020fa565b9050919050565b6200214e8162001adf565b82525050565b60006040820190506200216b600083018562002143565b6200217a602083018462002143565b9392505050565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b6000620021df60388362002002565b9150620021ec8262002181565b604082019050919050565b600060208201905081810360008301526200221281620021d0565b9050919050565b600060408201905062002230600083018562002143565b6200223f602083018462001dd1565b9392505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000620022a4602e8362002002565b9150620022b18262002246565b604082019050919050565b60006020820190508181036000830152620022d78162002295565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b6000620023206200231a6200231484620022de565b620022f5565b620022e8565b9050919050565b6200233281620022ff565b82525050565b60006020820190506200234f600083018462002327565b92915050565b600081519050620023668162001aae565b92915050565b60006020828403121562002385576200238462001903565b5b6000620023958482850162002355565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000620023fc60268362002002565b915062002409826200239e565b604082019050919050565b600060208201905081810360008301526200242f81620023ed565b9050919050565b620024418162001d39565b81146200244d57600080fd5b50565b600081519050620024618162002436565b92915050565b60006020828403121562002480576200247f62001903565b5b6000620024908482850162002450565b91505092915050565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b6000620024f7602e8362002002565b9150620025048262002499565b604082019050919050565b600060208201905081810360008301526200252a81620024e8565b9050919050565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b60006200258f60298362002002565b91506200259c8262002531565b604082019050919050565b60006020820190508181036000830152620025c28162002580565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006200260160208362002002565b91506200260e82620025c9565b602082019050919050565b600060208201905081810360008301526200263481620025f2565b9050919050565b600060408201905062002652600083018562001dd1565b62002661602083018462001da3565b9392505050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000620026c6602b8362002002565b9150620026d38262002668565b604082019050919050565b60006020820190508181036000830152620026f981620026b7565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006200275e602d8362002002565b91506200276b8262002700565b604082019050919050565b6000602082019050818103600083015262002791816200274f565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015620027ce578082015181840152602081019050620027b1565b60008484015250505050565b6000620027e78262002798565b620027f38185620027a3565b935062002805818560208601620027ae565b80840191505092915050565b60006200281f8284620027da565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600062002862601d8362002002565b91506200286f826200282a565b602082019050919050565b60006020820190508181036000830152620028958162002853565b9050919050565b600081519050919050565b6000620028b4826200289c565b620028c0818562002002565b9350620028d2818560208601620027ae565b620028dd8162001b7b565b840191505092915050565b60006020820190508181036000830152620029048184620028a7565b90509291505056fe61016060405260006001553480156200001757600080fd5b5060405162001ac038038062001ac083398181016040528101906200003d91906200023a565b600060148360006200006462000058620000ef60201b60201c565b620000f760201b60201c565b8360a0818152505081608081815250508260c08181525050826001901b60e081815250508073ffffffffffffffffffffffffffffffffffffffff166101008173ffffffffffffffffffffffffffffffffffffffff16815250504363ffffffff166101208163ffffffff1681525050505050508061ffff166101408161ffff1681525050505062000281565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b6000819050919050565b620001d581620001c0565b8114620001e157600080fd5b50565b600081519050620001f581620001ca565b92915050565b600061ffff82169050919050565b6200021481620001fb565b81146200022057600080fd5b50565b600081519050620002348162000209565b92915050565b60008060408385031215620002545762000253620001bb565b5b60006200026485828601620001e4565b9250506020620002778582860162000223565b9150509250929050565b60805160a05160c05160e0516101005161012051610140516117cf620002f16000396000610661015260006107c401526000610685015260008181610a4a0152610f24015260006109f001526000818161075f0152610aa00152600081816106050152610dd201526117cf6000f3fe6080604052600436106101665760003560e01c80638be9b119116100d1578063bc4991281161008a578063d66d6c1011610064578063d66d6c1014610568578063e493ef8c14610584578063f220b9ec146105af578063f2fde38b146105da57610166565b8063bc499128146104c3578063c5b208ff14610500578063d0383d681461053d57610166565b80638be9b1191461039f5780638da5cb5b146103c85780639056a9bf146103f3578063933ebfdd1461043057806398366e351461046d578063ae74552a1461049857610166565b80633ccfd60b116101235780633ccfd60b1461028f5780634add651e146102a65780635daf08ca146102d15780636bdcc8ab1461030e578063715018a61461034b5780637671ac051461036257610166565b806309aeb04c1461016b57806322d9730c1461019657806328b070e0146101d35780632b7ac3f3146101fe5780632de999bf14610229578063378de45b14610252575b600080fd5b34801561017757600080fd5b50610180610603565b60405161018d9190610f9c565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190610fed565b610627565b6040516101ca9190611035565b60405180910390f35b3480156101df57600080fd5b506101e861065f565b6040516101f5919061106d565b60405180910390f35b34801561020a57600080fd5b50610213610683565b6040516102209190611107565b60405180910390f35b34801561023557600080fd5b50610250600480360381019061024b9190611187565b6106a7565b005b34801561025e57600080fd5b5061027960048036038101906102749190610fed565b61075b565b6040516102869190610f9c565b60405180910390f35b34801561029b57600080fd5b506102a4610790565b005b3480156102b257600080fd5b506102bb6107c2565b6040516102c89190611227565b60405180910390f35b3480156102dd57600080fd5b506102f860048036038101906102f39190610fed565b6107e6565b6040516103059190610f9c565b60405180910390f35b34801561031a57600080fd5b5061033560048036038101906103309190610fed565b6107fe565b6040516103429190611035565b60405180910390f35b34801561035757600080fd5b5061036061081e565b005b34801561036e57600080fd5b5061038960048036038101906103849190610fed565b610832565b6040516103969190610f9c565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c191906112a2565b61084a565b005b3480156103d457600080fd5b506103dd61085a565b6040516103ea9190611317565b60405180910390f35b3480156103ff57600080fd5b5061041a60048036038101906104159190610fed565b610883565b6040516104279190610f9c565b60405180910390f35b34801561043c57600080fd5b5061045760048036038101906104529190611332565b61089b565b6040516104649190611430565b60405180910390f35b34801561047957600080fd5b506104826109ee565b60405161048f9190610f9c565b60405180910390f35b3480156104a457600080fd5b506104ad610a12565b6040516104ba9190610f9c565b60405180910390f35b3480156104cf57600080fd5b506104ea60048036038101906104e59190610fed565b610a18565b6040516104f79190610f9c565b60405180910390f35b34801561050c57600080fd5b506105276004803603810190610522919061147e565b610a30565b6040516105349190610f9c565b60405180910390f35b34801561054957600080fd5b50610552610a48565b60405161055f9190610f9c565b60405180910390f35b610582600480360381019061057d9190611332565b610a6c565b005b34801561059057600080fd5b50610599610a7a565b6040516105a69190610f9c565b60405180910390f35b3480156105bb57600080fd5b506105c4610a9e565b6040516105d19190610f9c565b60405180910390f35b3480156105e657600080fd5b5061060160048036038101906105fc919061147e565b610ac2565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b600080821415801561065857507f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000182105b9050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6106af610b45565b838383836106bf84848484610bc3565b6106f5576040517fb750624800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600088889050905060005b8181101561074f576107448a8a8381811061071e5761071d6114ab565b5b90506020020135898984818110610738576107376114ab565b5b90506020020135610bf5565b806001019050610700565b50505050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000826107899190611509565b9050919050565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b60036020528060005260406000206000915090505481565b60066020528060005260406000206000915054906101000a900460ff1681565b610826610b45565b6108306000610cd1565b565b60056020528060005260406000206000915090505481565b610855838383610d95565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60046020528060005260406000206000915090505481565b60608183106108e35782826040517f9ffcd53d0000000000000000000000000000000000000000000000000000000081526004016108da92919061154b565b60405180910390fd5b60015482111561092c5782826040517f9ffcd53d00000000000000000000000000000000000000000000000000000000815260040161092392919061154b565b60405180910390fd5b6000838361093a9190611574565b67ffffffffffffffff811115610953576109526115a8565b5b6040519080825280602002602001820160405280156109815781602001602082028036833780820191505090505b50905060008490505b838110156109e35760056000828152602001908152602001600020548286836109b39190611574565b815181106109c4576109c36114ab565b5b60200260200101818152505080806109db906115d7565b91505061098a565b508091505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b60026020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b7f000000000000000000000000000000000000000000000000000000000000000081565b610a768282610bf5565b5050565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000181565b7f000000000000000000000000000000000000000000000000000000000000000081565b610aca610b45565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b30906116a2565b60405180910390fd5b610b4281610cd1565b50565b610b4d610dc7565b73ffffffffffffffffffffffffffffffffffffffff16610b6b61085a565b73ffffffffffffffffffffffffffffffffffffffff1614610bc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb89061170e565b60405180910390fd5b565b6000808585905090506000848490509050808214610be657600092505050610bed565b6001925050505b949350505050565b610bff8282610dcf565b6001546003600084815260200190815260200160002081905550816005600060015481526020019081526020016000208190555060016006600084815260200190815260200160002060006101000a81548160ff0219169083151502179055508060046000848152602001908152602001600020819055507fff42916a89d1f5125f7f47168ee59c2b3fc9246ad1b229082ee85b69d001b5d78282600154604051610cac9392919061172e565b60405180910390a16001806000828254610cc69190611765565b925050819055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600033905090565b807f0000000000000000000000000000000000000000000000000000000000000000811115610e3557806040517f13a5e2ee000000000000000000000000000000000000000000000000000000008152600401610e2c9190610f9c565b60405180910390fd5b60008103610e7a57806040517f13a5e2ee000000000000000000000000000000000000000000000000000000008152600401610e719190610f9c565b60405180910390fd5b82610e8481610627565b610ec557806040517f7f3e75af000000000000000000000000000000000000000000000000000000008152600401610ebc9190610f9c565b60405180910390fd5b600115156006600086815260200190815260200160002060009054906101000a900460ff16151503610f22576040517e0a60f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000060015410610f7d576040517f57f6953100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6000819050919050565b610f9681610f83565b82525050565b6000602082019050610fb16000830184610f8d565b92915050565b600080fd5b600080fd5b610fca81610f83565b8114610fd557600080fd5b50565b600081359050610fe781610fc1565b92915050565b60006020828403121561100357611002610fb7565b5b600061101184828501610fd8565b91505092915050565b60008115159050919050565b61102f8161101a565b82525050565b600060208201905061104a6000830184611026565b92915050565b600061ffff82169050919050565b61106781611050565b82525050565b6000602082019050611082600083018461105e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006110cd6110c86110c384611088565b6110a8565b611088565b9050919050565b60006110df826110b2565b9050919050565b60006110f1826110d4565b9050919050565b611101816110e6565b82525050565b600060208201905061111c60008301846110f8565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261114757611146611122565b5b8235905067ffffffffffffffff81111561116457611163611127565b5b6020830191508360208202830111156111805761117f61112c565b5b9250929050565b600080600080604085870312156111a1576111a0610fb7565b5b600085013567ffffffffffffffff8111156111bf576111be610fbc565b5b6111cb87828801611131565b9450945050602085013567ffffffffffffffff8111156111ee576111ed610fbc565b5b6111fa87828801611131565b925092505092959194509250565b600063ffffffff82169050919050565b61122181611208565b82525050565b600060208201905061123c6000830184611218565b92915050565b600061124d82611088565b9050919050565b61125d81611242565b811461126857600080fd5b50565b60008135905061127a81611254565b92915050565b60008190508260206008028201111561129c5761129b61112c565b5b92915050565b600080600061014084860312156112bc576112bb610fb7565b5b60006112ca86828701610fd8565b93505060206112db8682870161126b565b92505060406112ec86828701611280565b9150509250925092565b600061130182611088565b9050919050565b611311816112f6565b82525050565b600060208201905061132c6000830184611308565b92915050565b6000806040838503121561134957611348610fb7565b5b600061135785828601610fd8565b925050602061136885828601610fd8565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6113a781610f83565b82525050565b60006113b9838361139e565b60208301905092915050565b6000602082019050919050565b60006113dd82611372565b6113e7818561137d565b93506113f28361138e565b8060005b8381101561142357815161140a88826113ad565b9750611415836113c5565b9250506001810190506113f6565b5085935050505092915050565b6000602082019050818103600083015261144a81846113d2565b905092915050565b61145b816112f6565b811461146657600080fd5b50565b60008135905061147881611452565b92915050565b60006020828403121561149457611493610fb7565b5b60006114a284828501611469565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061151482610f83565b915061151f83610f83565b925082820261152d81610f83565b91508282048414831517611544576115436114da565b5b5092915050565b60006040820190506115606000830185610f8d565b61156d6020830184610f8d565b9392505050565b600061157f82610f83565b915061158a83610f83565b92508282039050818111156115a2576115a16114da565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006115e282610f83565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611614576116136114da565b5b600182019050919050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061168c60268361161f565b915061169782611630565b604082019050919050565b600060208201905081810360008301526116bb8161167f565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006116f860208361161f565b9150611703826116c2565b602082019050919050565b60006020820190508181036000830152611727816116eb565b9050919050565b60006060820190506117436000830186610f8d565b6117506020830185610f8d565b61175d6040830184610f8d565b949350505050565b600061177082610f83565b915061177b83610f83565b9250828201905080821115611793576117926114da565b5b9291505056fea2646970667358221220f3d63817472861b92ed47c1c0a059033d26762a83df789a2f02dba13d9cc3df464736f6c63430008130033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206950adc7c418dd947ac3e184fb9f4d3a3206a03ca637b1c5a6fa23e8ae800c7464736f6c63430008130033" diff --git a/waku/waku_rln_relay/conversion_utils.nim b/waku/waku_rln_relay/conversion_utils.nim index 5744507f8a..afdae614d7 100644 --- a/waku/waku_rln_relay/conversion_utils.nim +++ b/waku/waku_rln_relay/conversion_utils.nim @@ -30,9 +30,8 @@ proc inHex*( valueHex = "0" & valueHex return toLowerAscii(valueHex) -when defined(rln_v2): - proc toUserMessageLimit*(v: UInt256): UserMessageLimit = - return cast[UserMessageLimit](v) +proc toUserMessageLimit*(v: UInt256): UserMessageLimit = + return cast[UserMessageLimit](v) proc encodeLengthPrefix*(input: openArray[byte]): seq[byte] = ## returns length prefixed version of the input @@ -56,75 +55,47 @@ proc serialize*(v: uint64): array[32, byte] = discard output.copyFrom(bytes) return output -when defined(rln_v2): - proc serialize*( - idSecretHash: IdentitySecretHash, - memIndex: MembershipIndex, - userMessageLimit: UserMessageLimit, - messageId: MessageId, - externalNullifier: ExternalNullifier, - msg: openArray[byte], - ): seq[byte] = - ## a private proc to convert RateLimitProof and the data to a byte seq - ## this conversion is used in the proofGen proc - ## the serialization is done as instructed in https://github.com/kilic/rln/blob/7ac74183f8b69b399e3bc96c1ae8ab61c026dc43/src/public.rs#L146 - ## [ id_key<32> | id_index<8> | epoch<32> | signal_len<8> | signal ] - let memIndexBytes = toBytes(uint64(memIndex), Endianness.littleEndian) - let userMessageLimitBytes = userMessageLimit.serialize() - let messageIdBytes = messageId.serialize() - let lenPrefMsg = encodeLengthPrefix(msg) - let output = concat( - @idSecretHash, - @memIndexBytes, - @userMessageLimitBytes, - @messageIdBytes, - @externalNullifier, - lenPrefMsg, - ) - return output +proc serialize*( + idSecretHash: IdentitySecretHash, + memIndex: MembershipIndex, + userMessageLimit: UserMessageLimit, + messageId: MessageId, + externalNullifier: ExternalNullifier, + msg: openArray[byte], +): seq[byte] = + ## a private proc to convert RateLimitProof and the data to a byte seq + ## this conversion is used in the proofGen proc + ## the serialization is done as instructed in https://github.com/kilic/rln/blob/7ac74183f8b69b399e3bc96c1ae8ab61c026dc43/src/public.rs#L146 + ## [ id_key<32> | id_index<8> | epoch<32> | signal_len<8> | signal ] + let memIndexBytes = toBytes(uint64(memIndex), Endianness.littleEndian) + let userMessageLimitBytes = userMessageLimit.serialize() + let messageIdBytes = messageId.serialize() + let lenPrefMsg = encodeLengthPrefix(msg) + let output = concat( + @idSecretHash, + @memIndexBytes, + @userMessageLimitBytes, + @messageIdBytes, + @externalNullifier, + lenPrefMsg, + ) + return output -else: - proc serialize*( - idSecretHash: IdentitySecretHash, - memIndex: MembershipIndex, - epoch: Epoch, - msg: openArray[byte], - ): seq[byte] = - ## a private proc to convert RateLimitProof and the data to a byte seq - ## this conversion is used in the proofGen proc - ## the serialization is done as instructed in https://github.com/kilic/rln/blob/7ac74183f8b69b399e3bc96c1ae8ab61c026dc43/src/public.rs#L146 - ## [ id_key<32> | id_index<8> | epoch<32> | signal_len<8> | signal ] - let memIndexBytes = toBytes(uint64(memIndex), Endianness.littleEndian) - let lenPrefMsg = encodeLengthPrefix(msg) - let output = concat(@idSecretHash, @memIndexBytes, @epoch, lenPrefMsg) - return output proc serialize*(proof: RateLimitProof, data: openArray[byte]): seq[byte] = ## a private proc to convert RateLimitProof and data to a byte seq ## this conversion is used in the proof verification proc ## [ proof<128> | root<32> | epoch<32> | share_x<32> | share_y<32> | nullifier<32> | rln_identifier<32> | signal_len<8> | signal ] let lenPrefMsg = encodeLengthPrefix(@data) - when defined(rln_v2): - var proofBytes = concat( - @(proof.proof), - @(proof.merkleRoot), - @(proof.externalNullifier), - @(proof.shareX), - @(proof.shareY), - @(proof.nullifier), - lenPrefMsg, - ) - else: - var proofBytes = concat( - @(proof.proof), - @(proof.merkleRoot), - @(proof.epoch), - @(proof.shareX), - @(proof.shareY), - @(proof.nullifier), - @(proof.rlnIdentifier), - lenPrefMsg, - ) + var proofBytes = concat( + @(proof.proof), + @(proof.merkleRoot), + @(proof.externalNullifier), + @(proof.shareX), + @(proof.shareY), + @(proof.nullifier), + lenPrefMsg, + ) return proofBytes diff --git a/waku/waku_rln_relay/group_manager/group_manager_base.nim b/waku/waku_rln_relay/group_manager/group_manager_base.nim index 6fce958300..7b2c651766 100644 --- a/waku/waku_rln_relay/group_manager/group_manager_base.nim +++ b/waku/waku_rln_relay/group_manager/group_manager_base.nim @@ -15,10 +15,7 @@ export options, chronos, results, protocol_types, protocol_metrics, deques type Membership* = object index*: MembershipIndex - when defined(rln_v2): - rateCommitment*: RateCommitment - else: - idCommitment*: IDCommitment + rateCommitment*: RateCommitment type OnRegisterCallback* = proc(registrations: seq[Membership]): Future[void] {.gcsafe.} type OnWithdrawCallback* = proc(withdrawals: seq[Membership]): Future[void] {.gcsafe.} @@ -35,8 +32,7 @@ type GroupManager* = ref object of RootObj latestIndex*: MembershipIndex validRoots*: Deque[MerkleNode] onFatalErrorAction*: OnFatalErrorHandler - when defined(rln_v2): - userMessageLimit*: Option[UserMessageLimit] + userMessageLimit*: Option[UserMessageLimit] # This proc is used to initialize the group manager # Any initialization logic should be implemented here @@ -53,61 +49,35 @@ method startGroupSync*( # This proc is used to register a new identity commitment into the merkle tree # The user may or may not have the identity secret to this commitment # It should be used when detecting new members in the group, and syncing the group state -when defined(rln_v2): - method register*( - g: GroupManager, rateCommitment: RateCommitment - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "register proc for " & $g.type & " is not implemented yet" - ) - -else: - method register*( - g: GroupManager, idCommitment: IDCommitment - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "register proc for " & $g.type & " is not implemented yet" - ) +method register*( + g: GroupManager, rateCommitment: RateCommitment +): Future[void] {.base, async: (raises: [Exception]).} = + raise newException( + CatchableError, "register proc for " & $g.type & " is not implemented yet" + ) # This proc is used to register a new identity commitment into the merkle tree # The user should have the identity secret to this commitment # It should be used when the user wants to join the group -when defined(rln_v2): - method register*( - g: GroupManager, - credentials: IdentityCredential, - userMessageLimit: UserMessageLimit, - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "register proc for " & $g.type & " is not implemented yet" - ) +method register*( + g: GroupManager, + credentials: IdentityCredential, + userMessageLimit: UserMessageLimit, +): Future[void] {.base, async: (raises: [Exception]).} = + raise newException( + CatchableError, "register proc for " & $g.type & " is not implemented yet" + ) -else: - method register*( - g: GroupManager, credentials: IdentityCredential - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "register proc for " & $g.type & " is not implemented yet" - ) # This proc is used to register a batch of new identity commitments into the merkle tree # The user may or may not have the identity secret to these commitments # It should be used when detecting a batch of new members in the group, and syncing the group state -when defined(rln_v2): - method registerBatch*( - g: GroupManager, rateCommitments: seq[RateCommitment] - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "registerBatch proc for " & $g.type & " is not implemented yet" - ) - -else: - method registerBatch*( - g: GroupManager, idCommitments: seq[IDCommitment] - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "registerBatch proc for " & $g.type & " is not implemented yet" - ) +method registerBatch*( + g: GroupManager, rateCommitments: seq[RateCommitment] +): Future[void] {.base, async: (raises: [Exception]).} = + raise newException( + CatchableError, "registerBatch proc for " & $g.type & " is not implemented yet" + ) # This proc is used to set a callback that will be called when a new identity commitment is registered # The callback may be called multiple times, and should be used to for any post processing @@ -133,25 +103,15 @@ method withdrawBatch*( ) # This proc is used to insert and remove a set of commitments from the merkle tree -when defined(rln_v2): - method atomicBatch*( - g: GroupManager, - rateCommitments: seq[RateCommitment], - toRemoveIndices: seq[MembershipIndex], - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "atomicBatch proc for " & $g.type & " is not implemented yet" - ) +method atomicBatch*( + g: GroupManager, + rateCommitments: seq[RateCommitment], + toRemoveIndices: seq[MembershipIndex], +): Future[void] {.base, async: (raises: [Exception]).} = + raise newException( + CatchableError, "atomicBatch proc for " & $g.type & " is not implemented yet" + ) -else: - method atomicBatch*( - g: GroupManager, - idCommitments: seq[IDCommitment], - toRemoveIndices: seq[MembershipIndex], - ): Future[void] {.base, async: (raises: [Exception]).} = - raise newException( - CatchableError, "atomicBatch proc for " & $g.type & " is not implemented yet" - ) method stop*(g: GroupManager): Future[void] {.base, async.} = raise @@ -216,55 +176,34 @@ method verifyProof*( return err("proof verification failed: " & $proofVerifyRes.error()) return ok(proofVerifyRes.value()) -when defined(rln_v2): - method generateProof*( - g: GroupManager, - data: openArray[byte], - epoch: Epoch, - messageId: MessageId, - rlnIdentifier = DefaultRlnIdentifier, - ): GroupManagerResult[RateLimitProof] {.base, gcsafe, raises: [].} = - ## generates a proof for the given data and epoch - ## the proof is generated using the current merkle root - if g.idCredentials.isNone(): - return err("identity credentials are not set") - if g.membershipIndex.isNone(): - return err("membership index is not set") - if g.userMessageLimit.isNone(): - return err("user message limit is not set") - waku_rln_proof_generation_duration_seconds.nanosecondTime: - let proof = proofGen( - rlnInstance = g.rlnInstance, - data = data, - membership = g.idCredentials.get(), - index = g.membershipIndex.get(), - epoch = epoch, - userMessageLimit = g.userMessageLimit.get(), - messageId = messageId, - ).valueOr: - return err("proof generation failed: " & $error) - return ok(proof) +method generateProof*( + g: GroupManager, + data: openArray[byte], + epoch: Epoch, + messageId: MessageId, + rlnIdentifier = DefaultRlnIdentifier, +): GroupManagerResult[RateLimitProof] {.base, gcsafe, raises: [].} = + ## generates a proof for the given data and epoch + ## the proof is generated using the current merkle root + if g.idCredentials.isNone(): + return err("identity credentials are not set") + if g.membershipIndex.isNone(): + return err("membership index is not set") + if g.userMessageLimit.isNone(): + return err("user message limit is not set") + waku_rln_proof_generation_duration_seconds.nanosecondTime: + let proof = proofGen( + rlnInstance = g.rlnInstance, + data = data, + membership = g.idCredentials.get(), + index = g.membershipIndex.get(), + epoch = epoch, + userMessageLimit = g.userMessageLimit.get(), + messageId = messageId, + ).valueOr: + return err("proof generation failed: " & $error) + return ok(proof) -else: - method generateProof*( - g: GroupManager, data: openArray[byte], epoch: Epoch - ): GroupManagerResult[RateLimitProof] {.base, gcsafe, raises: [].} = - ## generates a proof for the given data and epoch - ## the proof is generated using the current merkle root - if g.idCredentials.isNone(): - return err("identity credentials are not set") - if g.membershipIndex.isNone(): - return err("membership index is not set") - waku_rln_proof_generation_duration_seconds.nanosecondTime: - let proof = proofGen( - rlnInstance = g.rlnInstance, - data = data, - memKeys = g.idCredentials.get(), - memIndex = g.membershipIndex.get(), - epoch = epoch, - ).valueOr: - return err("proof generation failed: " & $error) - return ok(proof) method isReady*(g: GroupManager): Future[bool] {.base, async.} = raise newException( diff --git a/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim b/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim index f6ecdea2e3..ff93b58cb3 100644 --- a/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim +++ b/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim @@ -31,60 +31,36 @@ logScope: topics = "waku rln_relay onchain_group_manager" # using the when predicate does not work within the contract macro, hence need to dupe -when defined(rln_v2): - contract(WakuRlnRegistry): - # this describes the storage slot to use - proc usingStorageIndex(): Uint16 {.pure.} - # this map contains the address of a given storage slot - proc storages(index: Uint16): Address {.pure.} - # this serves as an entrypoint into the rln storage contract - proc register( - storageIndex: Uint16, idCommitment: Uint256, userMessageLimit: Uint256 - ) - - # this creates a new storage on the rln registry - proc newStorage(maxMessageLimit: Uint256) - # Initializes the implementation contract (only used in unit tests) - proc initialize() - - # membership contract interface - contract(RlnStorage): - # this event is raised when a new member is registered - proc MemberRegistered( - idCommitment: Uint256, userMessageLimit: Uint256, index: Uint256 - ) {.event.} - - # this constant contains the membership deposit of the contract - proc MEMBERSHIP_DEPOSIT(): Uint256 {.pure.} - # this map denotes existence of a given user - proc memberExists(idCommitment: Uint256): Uint256 {.view.} - # this constant describes the next index of a new member - proc idCommitmentIndex(): Uint256 {.view.} - # this constant describes the block number this contract was deployed on - proc deployedBlockNumber(): Uint256 {.view.} -else: - contract(WakuRlnRegistry): - # this describes the storage slot to use - proc usingStorageIndex(): Uint16 {.pure.} - # this map contains the address of a given storage slot - proc storages(index: Uint16): Address {.pure.} - # this serves as an entrypoint into the rln storage contract - proc register(storageIndex: Uint16, idCommitment: Uint256) - # this creates a new storage on the rln registry - proc newStorage() - - # membership contract interface - contract(RlnStorage): - # this event is raised when a new member is registered - proc MemberRegistered(idCommitment: Uint256, index: Uint256) {.event.} - # this constant contains the membership deposit of the contract - proc MEMBERSHIP_DEPOSIT(): Uint256 {.pure.} - # this map denotes existence of a given user - proc memberExists(idCommitment: Uint256): Uint256 {.view.} - # this constant describes the next index of a new member - proc idCommitmentIndex(): Uint256 {.view.} - # this constant describes the block number this contract was deployed on - proc deployedBlockNumber(): Uint256 {.view.} +contract(WakuRlnRegistry): + # this describes the storage slot to use + proc usingStorageIndex(): Uint16 {.pure.} + # this map contains the address of a given storage slot + proc storages(index: Uint16): Address {.pure.} + # this serves as an entrypoint into the rln storage contract + proc register( + storageIndex: Uint16, idCommitment: Uint256, userMessageLimit: Uint256 + ) + + # this creates a new storage on the rln registry + proc newStorage(maxMessageLimit: Uint256) + # Initializes the implementation contract (only used in unit tests) + proc initialize() + +# membership contract interface +contract(RlnStorage): + # this event is raised when a new member is registered + proc MemberRegistered( + idCommitment: Uint256, userMessageLimit: Uint256, index: Uint256 + ) {.event.} + + # this constant contains the membership deposit of the contract + proc MEMBERSHIP_DEPOSIT(): Uint256 {.pure.} + # this map denotes existence of a given user + proc memberExists(idCommitment: Uint256): Uint256 {.view.} + # this constant describes the next index of a new member + proc idCommitmentIndex(): Uint256 {.view.} + # this constant describes the block number this contract was deployed on + proc deployedBlockNumber(): Uint256 {.view.} type RegistryContractWithSender = Sender[WakuRlnRegistry] @@ -157,212 +133,112 @@ proc setMetadata*( return err("failed to persist rln metadata: " & getCurrentExceptionMsg()) return ok() -when defined(rln_v2): - method atomicBatch*( - g: OnchainGroupManager, - start: MembershipIndex, - rateCommitments = newSeq[RateCommitment](), - toRemoveIndices = newSeq[MembershipIndex](), - ): Future[void] {.async: (raises: [Exception]), base.} = - initializedGuard(g) - - # convert the rateCommitment struct to a leaf value - let leaves = rateCommitments.toLeaves().valueOr: - raise newException( - ValueError, "failed to convert rateCommitments to leaves: " & $error - ) - - waku_rln_membership_insertion_duration_seconds.nanosecondTime: - let operationSuccess = - g.rlnInstance.atomicWrite(some(start), leaves, toRemoveIndices) - if not operationSuccess: - raise newException(CatchableError, "atomic batch operation failed") - # TODO: when slashing is enabled, we need to track slashed members - waku_rln_number_registered_memberships.set(int64(g.rlnInstance.leavesSet())) - - if g.registerCb.isSome(): - var membersSeq = newSeq[Membership]() - for i in 0 ..< rateCommitments.len: - var index = start + MembershipIndex(i) - trace "registering member", rateCommitment = rateCommitments[i], index = index - let member = Membership(rateCommitment: rateCommitments[i], index: index) - membersSeq.add(member) - await g.registerCb.get()(membersSeq) - - g.validRootBuffer = g.slideRootQueue() - -else: - method atomicBatch*( - g: OnchainGroupManager, - start: MembershipIndex, - idCommitments = newSeq[IDCommitment](), - toRemoveIndices = newSeq[MembershipIndex](), - ): Future[void] {.async: (raises: [Exception]), base.} = - initializedGuard(g) - - waku_rln_membership_insertion_duration_seconds.nanosecondTime: - let operationSuccess = - g.rlnInstance.atomicWrite(some(start), idCommitments, toRemoveIndices) - if not operationSuccess: - raise newException(ValueError, "atomic batch operation failed") - # TODO: when slashing is enabled, we need to track slashed members - waku_rln_number_registered_memberships.set(int64(g.rlnInstance.leavesSet())) - - if g.registerCb.isSome(): - var membersSeq = newSeq[Membership]() - for i in 0 ..< idCommitments.len: - var index = start + MembershipIndex(i) - trace "registering member", idCommitment = idCommitments[i], index = index - let member = Membership(idCommitment: idCommitments[i], index: index) - membersSeq.add(member) - await g.registerCb.get()(membersSeq) - - g.validRootBuffer = g.slideRootQueue() - -when defined(rln_v2): - method register*( - g: OnchainGroupManager, rateCommitment: RateCommitment - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) - - await g.registerBatch(@[rateCommitment]) +method atomicBatch*( + g: OnchainGroupManager, + start: MembershipIndex, + rateCommitments = newSeq[RateCommitment](), + toRemoveIndices = newSeq[MembershipIndex](), +): Future[void] {.async: (raises: [Exception]), base.} = + initializedGuard(g) -else: - method register*( - g: OnchainGroupManager, idCommitment: IDCommitment - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) + # convert the rateCommitment struct to a leaf value + let leaves = rateCommitments.toLeaves().valueOr: + raise newException( + ValueError, "failed to convert rateCommitments to leaves: " & $error + ) - await g.registerBatch(@[idCommitment]) + waku_rln_membership_insertion_duration_seconds.nanosecondTime: + let operationSuccess = + g.rlnInstance.atomicWrite(some(start), leaves, toRemoveIndices) + if not operationSuccess: + raise newException(CatchableError, "atomic batch operation failed") + # TODO: when slashing is enabled, we need to track slashed members + waku_rln_number_registered_memberships.set(int64(g.rlnInstance.leavesSet())) -when defined(rln_v2): - method registerBatch*( - g: OnchainGroupManager, rateCommitments: seq[RateCommitment] - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) + if g.registerCb.isSome(): + var membersSeq = newSeq[Membership]() + for i in 0 ..< rateCommitments.len: + var index = start + MembershipIndex(i) + trace "registering member", rateCommitment = rateCommitments[i], index = index + let member = Membership(rateCommitment: rateCommitments[i], index: index) + membersSeq.add(member) + await g.registerCb.get()(membersSeq) - await g.atomicBatch(g.latestIndex, rateCommitments) - g.latestIndex += MembershipIndex(rateCommitments.len) + g.validRootBuffer = g.slideRootQueue() -else: - method registerBatch*( - g: OnchainGroupManager, idCommitments: seq[IDCommitment] - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) +method register*( + g: OnchainGroupManager, rateCommitment: RateCommitment +): Future[void] {.async: (raises: [Exception]).} = + initializedGuard(g) - await g.atomicBatch(g.latestIndex, idCommitments) - g.latestIndex += MembershipIndex(idCommitments.len) + await g.registerBatch(@[rateCommitment]) -when defined(rln_v2): - method register*( - g: OnchainGroupManager, - identityCredential: IdentityCredential, - userMessageLimit: UserMessageLimit, - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) +method registerBatch*( + g: OnchainGroupManager, rateCommitments: seq[RateCommitment] +): Future[void] {.async: (raises: [Exception]).} = + initializedGuard(g) - let ethRpc = g.ethRpc.get() - let registryContract = g.registryContract.get() - let membershipFee = g.membershipFee.get() - - var gasPrice: int - g.retryWrapper(gasPrice, "Failed to get gas price"): - int(await ethRpc.provider.eth_gasPrice()) * 2 - let idCommitment = identityCredential.idCommitment.toUInt256() - - let storageIndex = g.usingStorageIndex.get() - debug "registering the member", - idCommitment = idCommitment, - storageIndex = storageIndex, - userMessageLimit = userMessageLimit - var txHash: TxHash - g.retryWrapper(txHash, "Failed to register the member"): - await registryContract - .register(storageIndex, idCommitment, u256(userMessageLimit)) - .send(gasPrice = gasPrice) - - # wait for the transaction to be mined - var tsReceipt: ReceiptObject - g.retryWrapper(tsReceipt, "Failed to get the transaction receipt"): - await ethRpc.getMinedTransactionReceipt(txHash) - debug "registration transaction mined", txHash = txHash - g.registrationTxHash = some(txHash) - # the receipt topic holds the hash of signature of the raised events - # TODO: make this robust. search within the event list for the event - let firstTopic = tsReceipt.logs[0].topics[0] - # the hash of the signature of MemberRegistered(uint256,uint256,uint256) event is equal to the following hex value - if firstTopic != - cast[FixedBytes[32]](keccak256.digest( - "MemberRegistered(uint256,uint256,uint256)" - ).data): - raise newException(ValueError, "unexpected event signature") - - # the arguments of the raised event i.e., MemberRegistered are encoded inside the data field - # data = pk encoded as 256 bits || index encoded as 256 bits || userMessageLimit encoded as 256 bits - let arguments = tsReceipt.logs[0].data - debug "tx log data", arguments = arguments - let - argumentsBytes = arguments - # In TX log data, uints are encoded in big endian - membershipIndex = UInt256.fromBytesBE(argumentsBytes[64 ..^ 1]) - - g.userMessageLimit = some(userMessageLimit) - g.membershipIndex = some(membershipIndex.toMembershipIndex()) - - # don't handle member insertion into the tree here, it will be handled by the event listener - return + await g.atomicBatch(g.latestIndex, rateCommitments) + g.latestIndex += MembershipIndex(rateCommitments.len) -else: - method register*( - g: OnchainGroupManager, credentials: IdentityCredential - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) +method register*( + g: OnchainGroupManager, + identityCredential: IdentityCredential, + userMessageLimit: UserMessageLimit, +): Future[void] {.async: (raises: [Exception]).} = + initializedGuard(g) - let ethRpc = g.ethRpc.get() - let registryContract = g.registryContract.get() - let membershipFee = g.membershipFee.get() - - var gasPrice: int - g.retryWrapper(gasPrice, "Failed to get gas price"): - int(await ethRpc.provider.eth_gasPrice()) * 2 - let idCommitment = credentials.idCommitment.toUInt256() - - let storageIndex = g.usingStorageIndex.get() - debug "registering the member", - idCommitment = idCommitment, storageIndex = storageIndex - var txHash: TxHash - g.retryWrapper(txHash, "Failed to register the member"): - await registryContract.register(storageIndex, idCommitment).send( - gasPrice = gasPrice - ) + let ethRpc = g.ethRpc.get() + let registryContract = g.registryContract.get() + let membershipFee = g.membershipFee.get() + + var gasPrice: int + g.retryWrapper(gasPrice, "Failed to get gas price"): + int(await ethRpc.provider.eth_gasPrice()) * 2 + let idCommitment = identityCredential.idCommitment.toUInt256() + + let storageIndex = g.usingStorageIndex.get() + debug "registering the member", + idCommitment = idCommitment, + storageIndex = storageIndex, + userMessageLimit = userMessageLimit + var txHash: TxHash + g.retryWrapper(txHash, "Failed to register the member"): + await registryContract + .register(storageIndex, idCommitment, u256(userMessageLimit)) + .send(gasPrice = gasPrice) + + # wait for the transaction to be mined + var tsReceipt: ReceiptObject + g.retryWrapper(tsReceipt, "Failed to get the transaction receipt"): + await ethRpc.getMinedTransactionReceipt(txHash) + debug "registration transaction mined", txHash = txHash + g.registrationTxHash = some(txHash) + # the receipt topic holds the hash of signature of the raised events + # TODO: make this robust. search within the event list for the event + let firstTopic = tsReceipt.logs[0].topics[0] + # the hash of the signature of MemberRegistered(uint256,uint256,uint256) event is equal to the following hex value + if firstTopic != + cast[FixedBytes[32]](keccak256.digest( + "MemberRegistered(uint256,uint256,uint256)" + ).data): + raise newException(ValueError, "unexpected event signature") + + # the arguments of the raised event i.e., MemberRegistered are encoded inside the data field + # data = pk encoded as 256 bits || index encoded as 256 bits || userMessageLimit encoded as 256 bits + let arguments = tsReceipt.logs[0].data + debug "tx log data", arguments = arguments + let + argumentsBytes = arguments + # In TX log data, uints are encoded in big endian + membershipIndex = UInt256.fromBytesBE(argumentsBytes[64 ..^ 1]) + + g.userMessageLimit = some(userMessageLimit) + g.membershipIndex = some(membershipIndex.toMembershipIndex()) + + # don't handle member insertion into the tree here, it will be handled by the event listener + return - # wait for the transaction to be mined - var tsReceipt: ReceiptObject - g.retryWrapper(tsReceipt, "Failed to get the transaction receipt"): - await ethRpc.getMinedTransactionReceipt(txHash) - debug "registration transaction mined", txHash = txHash - g.registrationTxHash = some(txHash) - # the receipt topic holds the hash of signature of the raised events - # TODO: make this robust. search within the event list for the event - let firstTopic = tsReceipt.logs[0].topics[0] - # the hash of the signature of MemberRegistered(uint256,uint256) event is equal to the following hex value - if firstTopic != - cast[FixedBytes[32]](keccak256.digest("MemberRegistered(uint256,uint256)").data): - raise newException(ValueError, "unexpected event signature") - - # the arguments of the raised event i.e., MemberRegistered are encoded inside the data field - # data = pk encoded as 256 bits || index encoded as 256 bits - let arguments = tsReceipt.logs[0].data - debug "tx log data", arguments = arguments - let - argumentsBytes = arguments - # In TX log data, uints are encoded in big endian - eventIndex = UInt256.fromBytesBE(argumentsBytes[32 ..^ 1]) - - g.membershipIndex = some(eventIndex.toMembershipIndex()) - - # don't handle member insertion into the tree here, it will be handled by the event listener - return method withdraw*( g: OnchainGroupManager, idCommitment: IDCommitment @@ -383,8 +259,7 @@ proc parseEvent( ## returns an error if it cannot parse the `data` parameter var idComm: UInt256 var index: UInt256 - when defined(rln_v2): - var userMessageLimit: UInt256 + var userMessageLimit: UInt256 var data: string # Remove the 0x prefix try: @@ -398,27 +273,20 @@ proc parseEvent( try: # Parse the idComm offset += decode(data, offset, idComm) - when defined(rln_v2): - # Parse the userMessageLimit - offset += decode(data, offset, userMessageLimit) + # Parse the userMessageLimit + offset += decode(data, offset, userMessageLimit) # Parse the index offset += decode(data, offset, index) - when defined(rln_v2): - return ok( - Membership( - rateCommitment: RateCommitment( - idCommitment: idComm.toIDCommitment(), - userMessageLimit: userMessageLimit.toUserMessageLimit(), - ), - index: index.toMembershipIndex(), - ) - ) - else: - return ok( - Membership( - idCommitment: idComm.toIDCommitment(), index: index.toMembershipIndex() - ) + return ok( + Membership( + rateCommitment: RateCommitment( + idCommitment: idComm.toIDCommitment(), + userMessageLimit: userMessageLimit.toUserMessageLimit(), + ), + index: index.toMembershipIndex(), ) + ) + except CatchableError: return err("failed to parse the data field of the MemberRegistered event") @@ -501,24 +369,15 @@ proc handleEvents( try: let startIndex = blockTable[blockNumber].filterIt(not it[1])[0][0].index let removalIndices = members.filterIt(it[1]).mapIt(it[0].index) - when defined(rln_v2): - let rateCommitments = members.mapIt(it[0].rateCommitment) - await g.atomicBatch( - start = startIndex, - rateCommitments = rateCommitments, - toRemoveIndices = removalIndices, - ) - g.latestIndex = startIndex + MembershipIndex(rateCommitments.len) - trace "new members added to the Merkle tree", commitments = rateCommitments - else: - let idCommitments = members.mapIt(it[0].idCommitment) - await g.atomicBatch( - start = startIndex, - idCommitments = idCommitments, - toRemoveIndices = removalIndices, - ) - g.latestIndex = startIndex + MembershipIndex(idCommitments.len) - trace "new members added to the Merkle tree", commitments = idCommitments + let rateCommitments = members.mapIt(it[0].rateCommitment) + await g.atomicBatch( + start = startIndex, + rateCommitments = rateCommitments, + toRemoveIndices = removalIndices, + ) + g.latestIndex = startIndex + MembershipIndex(rateCommitments.len) + trace "new members added to the Merkle tree", commitments = rateCommitments + except CatchableError: error "failed to insert members into the tree", error = getCurrentExceptionMsg() raise newException(ValueError, "failed to insert members into the tree") @@ -759,8 +618,7 @@ method init*(g: OnchainGroupManager): Future[GroupManagerResult[void]] {.async.} return err("failed to get the keystore credentials: " & $error) g.membershipIndex = some(keystoreCred.treeIndex) - when defined(rln_v2): - g.userMessageLimit = some(keystoreCred.userMessageLimit) + g.userMessageLimit = some(keystoreCred.userMessageLimit) # now we check on the contract if the commitment actually has a membership try: let membershipExists = await rlnContract diff --git a/waku/waku_rln_relay/group_manager/static/group_manager.nim b/waku/waku_rln_relay/group_manager/static/group_manager.nim index 084aba1af7..877124af4f 100644 --- a/waku/waku_rln_relay/group_manager/static/group_manager.nim +++ b/waku/waku_rln_relay/group_manager/static/group_manager.nim @@ -33,25 +33,18 @@ method init*(g: StaticGroupManager): Future[GroupManagerResult[void]] {.async.} "Invalid membership index. Must be within 0 and " & $(groupSize - 1) & "but was " & $membershipIndex ) - when defined(rln_v2): - g.userMessageLimit = some(DefaultUserMessageLimit) + g.userMessageLimit = some(DefaultUserMessageLimit) g.idCredentials = some(groupKeys[membershipIndex]) # Seed the received commitments into the merkle tree - when defined(rln_v2): - let rateCommitments = groupKeys.mapIt( - RateCommitment( - idCommitment: it.idCommitment, userMessageLimit: g.userMessageLimit.get() - ) + let rateCommitments = groupKeys.mapIt( + RateCommitment( + idCommitment: it.idCommitment, userMessageLimit: g.userMessageLimit.get() ) - let leaves = rateCommitments.toLeaves().valueOr: - return err("Failed to convert rate commitments to leaves: " & $error) - let membersInserted = g.rlnInstance.insertMembers(g.latestIndex, leaves) - else: - let idCommitments = groupKeys.mapIt(it.idCommitment) - let membersInserted = g.rlnInstance.insertMembers(g.latestIndex, idCommitments) - if not membersInserted: - return err("Failed to insert members into the merkle tree") + ) + let leaves = rateCommitments.toLeaves().valueOr: + return err("Failed to convert rate commitments to leaves: " & $error) + let membersInserted = g.rlnInstance.insertMembers(g.latestIndex, leaves) discard g.slideRootQueue() @@ -68,127 +61,67 @@ method startGroupSync*( # No-op return ok() -when defined(rln_v2): - method register*( - g: StaticGroupManager, rateCommitment: RateCommitment - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) - - await g.registerBatch(@[rateCommitment]) - -else: - method register*( - g: StaticGroupManager, idCommitment: IDCommitment - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) - - await g.registerBatch(@[idCommitment]) - -when defined(rln_v2): - method registerBatch*( - g: StaticGroupManager, rateCommitments: seq[RateCommitment] - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) - - let leavesRes = rateCommitments.toLeaves() - if not leavesRes.isOk(): - raise newException(ValueError, "Failed to convert rate commitments to leaves") - let leaves = cast[seq[seq[byte]]](leavesRes.get()) - - let membersInserted = g.rlnInstance.insertMembers(g.latestIndex + 1, leaves) - if not membersInserted: - raise newException(ValueError, "Failed to insert members into the merkle tree") - - if g.registerCb.isSome(): - var memberSeq = newSeq[Membership]() - for i in 0 ..< rateCommitments.len: - memberSeq.add( - Membership( - rateCommitment: rateCommitments[i], - index: g.latestIndex + MembershipIndex(i) + 1, - ) - ) - await g.registerCb.get()(memberSeq) - - discard g.slideRootQueue() - - g.latestIndex += MembershipIndex(rateCommitments.len) - - return - -else: - method registerBatch*( - g: StaticGroupManager, idCommitments: seq[IDCommitment] - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) - - let membersInserted = g.rlnInstance.insertMembers(g.latestIndex + 1, idCommitments) - if not membersInserted: - raise newException(ValueError, "Failed to insert members into the merkle tree") - - if g.registerCb.isSome(): - var memberSeq = newSeq[Membership]() - for i in 0 ..< idCommitments.len: - memberSeq.add( - Membership( - idCommitment: idCommitments[i], - index: g.latestIndex + MembershipIndex(i) + 1, - ) - ) - await g.registerCb.get()(memberSeq) - - discard g.slideRootQueue() - - g.latestIndex += MembershipIndex(idCommitments.len) +method register*( + g: StaticGroupManager, rateCommitment: RateCommitment +): Future[void] {.async: (raises: [Exception]).} = + initializedGuard(g) - return + await g.registerBatch(@[rateCommitment]) -when defined(rln_v2): - method withdraw*( - g: StaticGroupManager, idSecretHash: IdentitySecretHash - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) - let groupKeys = g.groupKeys +method registerBatch*( + g: StaticGroupManager, rateCommitments: seq[RateCommitment] +): Future[void] {.async: (raises: [Exception]).} = + initializedGuard(g) - for i in 0 ..< groupKeys.len: - if groupKeys[i].idSecretHash == idSecretHash: - let idCommitment = groupKeys[i].idCommitment - let index = MembershipIndex(i) - let rateCommitment = RateCommitment( - idCommitment: idCommitment, userMessageLimit: g.userMessageLimit.get() + let leavesRes = rateCommitments.toLeaves() + if not leavesRes.isOk(): + raise newException(ValueError, "Failed to convert rate commitments to leaves") + let leaves = cast[seq[seq[byte]]](leavesRes.get()) + + let membersInserted = g.rlnInstance.insertMembers(g.latestIndex + 1, leaves) + if not membersInserted: + raise newException(ValueError, "Failed to insert members into the merkle tree") + + if g.registerCb.isSome(): + var memberSeq = newSeq[Membership]() + for i in 0 ..< rateCommitments.len: + memberSeq.add( + Membership( + rateCommitment: rateCommitments[i], + index: g.latestIndex + MembershipIndex(i) + 1, ) - let memberRemoved = g.rlnInstance.removeMember(index) - if not memberRemoved: - raise newException(ValueError, "Failed to remove member from the merkle tree") + ) + await g.registerCb.get()(memberSeq) - if g.withdrawCb.isSome(): - let withdrawCb = g.withdrawCb.get() - await withdrawCb(@[Membership(rateCommitment: rateCommitment, index: index)]) + discard g.slideRootQueue() - return + g.latestIndex += MembershipIndex(rateCommitments.len) + return -else: - method withdraw*( - g: StaticGroupManager, idSecretHash: IdentitySecretHash - ): Future[void] {.async: (raises: [Exception]).} = - initializedGuard(g) +method withdraw*( + g: StaticGroupManager, idSecretHash: IdentitySecretHash +): Future[void] {.async: (raises: [Exception]).} = + initializedGuard(g) - let groupKeys = g.groupKeys + let groupKeys = g.groupKeys - for i in 0 ..< groupKeys.len: - if groupKeys[i].idSecretHash == idSecretHash: - let idCommitment = groupKeys[i].idCommitment - let index = MembershipIndex(i) - let memberRemoved = g.rlnInstance.removeMember(index) - if not memberRemoved: - raise newException(ValueError, "Failed to remove member from the merkle tree") + for i in 0 ..< groupKeys.len: + if groupKeys[i].idSecretHash == idSecretHash: + let idCommitment = groupKeys[i].idCommitment + let index = MembershipIndex(i) + let rateCommitment = RateCommitment( + idCommitment: idCommitment, userMessageLimit: g.userMessageLimit.get() + ) + let memberRemoved = g.rlnInstance.removeMember(index) + if not memberRemoved: + raise newException(ValueError, "Failed to remove member from the merkle tree") - if g.withdrawCb.isSome(): - let withdrawCb = g.withdrawCb.get() - await withdrawCb((@[Membership(idCommitment: idCommitment, index: index)])) + if g.withdrawCb.isSome(): + let withdrawCb = g.withdrawCb.get() + await withdrawCb(@[Membership(rateCommitment: rateCommitment, index: index)]) - return + return method withdrawBatch*( g: StaticGroupManager, idSecretHashes: seq[IdentitySecretHash] diff --git a/waku/waku_rln_relay/protocol_types.nim b/waku/waku_rln_relay/protocol_types.nim index 158f550b9a..c0224bacae 100644 --- a/waku/waku_rln_relay/protocol_types.nim +++ b/waku/waku_rln_relay/protocol_types.nim @@ -21,13 +21,9 @@ type Epoch* = array[32, byte] RlnIdentifier* = array[32, byte] ZKSNARK* = array[128, byte] - -when defined(rln_v2): - type - MessageId* = uint64 - ExternalNullifier* = array[32, byte] - - type RateCommitment* = object + MessageId* = uint64 + ExternalNullifier* = array[32, byte] + RateCommitment* = object idCommitment*: IDCommitment userMessageLimit*: UserMessageLimit @@ -51,9 +47,8 @@ type RateLimitProof* = object epoch*: Epoch ## Application specific RLN Identifier rlnIdentifier*: RlnIdentifier - when defined(rln_v2): - ## the external nullifier used for the generation of the `proof` (derived from poseidon([epoch, rln_identifier])) - externalNullifier*: ExternalNullifier + ## the external nullifier used for the generation of the `proof` (derived from poseidon([epoch, rln_identifier])) + externalNullifier*: ExternalNullifier type ProofMetadata* = object nullifier*: Nullifier diff --git a/waku/waku_rln_relay/rln/wrappers.nim b/waku/waku_rln_relay/rln/wrappers.nim index 1f26e2eec4..f6056c5bc8 100644 --- a/waku/waku_rln_relay/rln/wrappers.nim +++ b/waku/waku_rln_relay/rln/wrappers.nim @@ -161,32 +161,31 @@ proc poseidon*(data: seq[seq[byte]]): RlnRelayResult[array[32, byte]] = return ok(output) -when defined(rln_v2): - proc toLeaf*(rateCommitment: RateCommitment): RlnRelayResult[seq[byte]] = - let idCommitment = rateCommitment.idCommitment - var userMessageLimit: array[32, byte] - try: - discard userMessageLimit.copyFrom( - toBytes(rateCommitment.userMessageLimit, Endianness.littleEndian) - ) - except CatchableError: - return err( - "could not convert the user message limit to bytes: " & getCurrentExceptionMsg() - ) - let leaf = poseidon(@[@idCommitment, @userMessageLimit]).valueOr: - return err("could not convert the rate commitment to a leaf") - var retLeaf = newSeq[byte](leaf.len) - for i in 0 ..< leaf.len: - retLeaf[i] = leaf[i] - return ok(retLeaf) - - proc toLeaves*(rateCommitments: seq[RateCommitment]): RlnRelayResult[seq[seq[byte]]] = - var leaves = newSeq[seq[byte]]() - for rateCommitment in rateCommitments: - let leaf = toLeaf(rateCommitment).valueOr: - return err("could not convert the rate commitment to a leaf: " & $error) - leaves.add(leaf) - return ok(leaves) +proc toLeaf*(rateCommitment: RateCommitment): RlnRelayResult[seq[byte]] = + let idCommitment = rateCommitment.idCommitment + var userMessageLimit: array[32, byte] + try: + discard userMessageLimit.copyFrom( + toBytes(rateCommitment.userMessageLimit, Endianness.littleEndian) + ) + except CatchableError: + return err( + "could not convert the user message limit to bytes: " & getCurrentExceptionMsg() + ) + let leaf = poseidon(@[@idCommitment, @userMessageLimit]).valueOr: + return err("could not convert the rate commitment to a leaf") + var retLeaf = newSeq[byte](leaf.len) + for i in 0 ..< leaf.len: + retLeaf[i] = leaf[i] + return ok(retLeaf) + +proc toLeaves*(rateCommitments: seq[RateCommitment]): RlnRelayResult[seq[seq[byte]]] = + var leaves = newSeq[seq[byte]]() + for rateCommitment in rateCommitments: + let leaf = toLeaf(rateCommitment).valueOr: + return err("could not convert the rate commitment to a leaf: " & $error) + leaves.add(leaf) + return ok(leaves) proc extractMetadata*(proof: RateLimitProof): RlnRelayResult[ProofMetadata] = let externalNullifier = poseidon(@[@(proof.epoch), @(proof.rlnIdentifier)]).valueOr: @@ -200,151 +199,81 @@ proc extractMetadata*(proof: RateLimitProof): RlnRelayResult[ProofMetadata] = ) ) -when defined(rln_v2): - proc proofGen*( - rlnInstance: ptr RLN, - data: openArray[byte], - membership: IdentityCredential, - userMessageLimit: UserMessageLimit, - messageId: MessageId, - index: MembershipIndex, - epoch: Epoch, - rlnIdentifier = DefaultRlnIdentifier, - ): RateLimitProofResult = - # obtain the external nullifier - let externalNullifierRes = poseidon(@[@(epoch), @(rlnIdentifier)]) - - if externalNullifierRes.isErr(): - return err("could not construct the external nullifier") - - # serialize inputs - let serializedInputs = serialize( - idSecretHash = membership.idSecretHash, - memIndex = index, - userMessageLimit = userMessageLimit, - messageId = messageId, - externalNullifier = externalNullifierRes.get(), - msg = data, - ) - var inputBuffer = toBuffer(serializedInputs) - - debug "input buffer ", inputBuffer = repr(inputBuffer) - - # generate the proof - var proof: Buffer - let proofIsSuccessful = generate_proof(rlnInstance, addr inputBuffer, addr proof) - # check whether the generate_proof call is done successfully - if not proofIsSuccessful: - return err("could not generate the proof") - - var proofValue = cast[ptr array[320, byte]](proof.`ptr`) - let proofBytes: array[320, byte] = proofValue[] - debug "proof content", proofHex = proofValue[].toHex - - ## parse the proof as [ proof<128> | root<32> | external_nullifier<32> | share_x<32> | share_y<32> | nullifier<32> ] - - let - proofOffset = 128 - rootOffset = proofOffset + 32 - externalNullifierOffset = rootOffset + 32 - shareXOffset = externalNullifierOffset + 32 - shareYOffset = shareXOffset + 32 - nullifierOffset = shareYOffset + 32 - - var - zkproof: ZKSNARK - proofRoot, shareX, shareY: MerkleNode - externalNullifier: ExternalNullifier - nullifier: Nullifier - - discard zkproof.copyFrom(proofBytes[0 .. proofOffset - 1]) - discard proofRoot.copyFrom(proofBytes[proofOffset .. rootOffset - 1]) - discard - externalNullifier.copyFrom(proofBytes[rootOffset .. externalNullifierOffset - 1]) - discard shareX.copyFrom(proofBytes[externalNullifierOffset .. shareXOffset - 1]) - discard shareY.copyFrom(proofBytes[shareXOffset .. shareYOffset - 1]) - discard nullifier.copyFrom(proofBytes[shareYOffset .. nullifierOffset - 1]) - - let output = RateLimitProof( - proof: zkproof, - merkleRoot: proofRoot, - externalNullifier: externalNullifier, - epoch: epoch, - rlnIdentifier: rlnIdentifier, - shareX: shareX, - shareY: shareY, - nullifier: nullifier, - ) - return ok(output) - -else: - proc proofGen*( - rlnInstance: ptr RLN, - data: openArray[byte], - memKeys: IdentityCredential, - memIndex: MembershipIndex, - epoch: Epoch, - ): RateLimitProofResult = - # serialize inputs - let serializedInputs = serialize( - idSecretHash = memKeys.idSecretHash, - memIndex = memIndex, - epoch = epoch, - msg = data, - ) - var inputBuffer = toBuffer(serializedInputs) - - debug "input buffer ", inputBuffer = repr(inputBuffer) - - # generate the proof - var proof: Buffer - let proofIsSuccessful = generate_proof(rlnInstance, addr inputBuffer, addr proof) - # check whether the generate_proof call is done successfully - if not proofIsSuccessful: - return err("could not generate the proof") - - var proofValue = cast[ptr array[320, byte]](proof.`ptr`) - let proofBytes: array[320, byte] = proofValue[] - debug "proof content", proofHex = proofValue[].toHex - - ## parse the proof as [ proof<128> | root<32> | epoch<32> | share_x<32> | share_y<32> | nullifier<32> | rln_identifier<32> ] - - let - proofOffset = 128 - rootOffset = proofOffset + 32 - epochOffset = rootOffset + 32 - shareXOffset = epochOffset + 32 - shareYOffset = shareXOffset + 32 - nullifierOffset = shareYOffset + 32 - rlnIdentifierOffset = nullifierOffset + 32 - - var - zkproof: ZKSNARK - proofRoot, shareX, shareY: MerkleNode - epoch: Epoch - nullifier: Nullifier - rlnIdentifier: RlnIdentifier - - discard zkproof.copyFrom(proofBytes[0 .. proofOffset - 1]) - discard proofRoot.copyFrom(proofBytes[proofOffset .. rootOffset - 1]) - discard epoch.copyFrom(proofBytes[rootOffset .. epochOffset - 1]) - discard shareX.copyFrom(proofBytes[epochOffset .. shareXOffset - 1]) - discard shareY.copyFrom(proofBytes[shareXOffset .. shareYOffset - 1]) - discard nullifier.copyFrom(proofBytes[shareYOffset .. nullifierOffset - 1]) - discard - rlnIdentifier.copyFrom(proofBytes[nullifierOffset .. rlnIdentifierOffset - 1]) - - let output = RateLimitProof( - proof: zkproof, - merkleRoot: proofRoot, - epoch: epoch, - shareX: shareX, - shareY: shareY, - nullifier: nullifier, - rlnIdentifier: rlnIdentifier, - ) +proc proofGen*( + rlnInstance: ptr RLN, + data: openArray[byte], + membership: IdentityCredential, + userMessageLimit: UserMessageLimit, + messageId: MessageId, + index: MembershipIndex, + epoch: Epoch, + rlnIdentifier = DefaultRlnIdentifier, +): RateLimitProofResult = + # obtain the external nullifier + let externalNullifierRes = poseidon(@[@(epoch), @(rlnIdentifier)]) + + if externalNullifierRes.isErr(): + return err("could not construct the external nullifier") - return ok(output) + # serialize inputs + let serializedInputs = serialize( + idSecretHash = membership.idSecretHash, + memIndex = index, + userMessageLimit = userMessageLimit, + messageId = messageId, + externalNullifier = externalNullifierRes.get(), + msg = data, + ) + var inputBuffer = toBuffer(serializedInputs) + + debug "input buffer ", inputBuffer = repr(inputBuffer) + + # generate the proof + var proof: Buffer + let proofIsSuccessful = generate_proof(rlnInstance, addr inputBuffer, addr proof) + # check whether the generate_proof call is done successfully + if not proofIsSuccessful: + return err("could not generate the proof") + + var proofValue = cast[ptr array[320, byte]](proof.`ptr`) + let proofBytes: array[320, byte] = proofValue[] + debug "proof content", proofHex = proofValue[].toHex + + ## parse the proof as [ proof<128> | root<32> | external_nullifier<32> | share_x<32> | share_y<32> | nullifier<32> ] + + let + proofOffset = 128 + rootOffset = proofOffset + 32 + externalNullifierOffset = rootOffset + 32 + shareXOffset = externalNullifierOffset + 32 + shareYOffset = shareXOffset + 32 + nullifierOffset = shareYOffset + 32 + + var + zkproof: ZKSNARK + proofRoot, shareX, shareY: MerkleNode + externalNullifier: ExternalNullifier + nullifier: Nullifier + + discard zkproof.copyFrom(proofBytes[0 .. proofOffset - 1]) + discard proofRoot.copyFrom(proofBytes[proofOffset .. rootOffset - 1]) + discard + externalNullifier.copyFrom(proofBytes[rootOffset .. externalNullifierOffset - 1]) + discard shareX.copyFrom(proofBytes[externalNullifierOffset .. shareXOffset - 1]) + discard shareY.copyFrom(proofBytes[shareXOffset .. shareYOffset - 1]) + discard nullifier.copyFrom(proofBytes[shareYOffset .. nullifierOffset - 1]) + + let output = RateLimitProof( + proof: zkproof, + merkleRoot: proofRoot, + externalNullifier: externalNullifier, + epoch: epoch, + rlnIdentifier: rlnIdentifier, + shareX: shareX, + shareY: shareY, + nullifier: nullifier, + ) + return ok(output) # validRoots should contain a sequence of roots in the acceptable windows. # As default, it is set to an empty sequence of roots. This implies that the validity check for the proof's root is skipped @@ -357,14 +286,13 @@ proc proofVerify*( ## verifies the proof, returns an error if the proof verification fails ## returns true if the proof is valid var normalizedProof = proof - when defined(rln_v2): - # when we do this, we ensure that we compute the proof for the derived value - # of the externalNullifier. The proof verification will fail if a malicious peer - # attaches invalid epoch+rlnidentifier pair - normalizedProof.externalNullifier = poseidon( - @[@(proof.epoch), @(proof.rlnIdentifier)] - ).valueOr: - return err("could not construct the external nullifier") + # when we do this, we ensure that we compute the proof for the derived value + # of the externalNullifier. The proof verification will fail if a malicious peer + # attaches invalid epoch+rlnidentifier pair + normalizedProof.externalNullifier = poseidon( + @[@(proof.epoch), @(proof.rlnIdentifier)] + ).valueOr: + return err("could not construct the external nullifier") var proofBytes = serialize(normalizedProof, data) proofBuffer = proofBytes.toBuffer() diff --git a/waku/waku_rln_relay/rln_relay.nim b/waku/waku_rln_relay/rln_relay.nim index c255505cd3..139c7aaf99 100644 --- a/waku/waku_rln_relay/rln_relay.nim +++ b/waku/waku_rln_relay/rln_relay.nim @@ -23,10 +23,8 @@ import ./conversion_utils, ./constants, ./protocol_types, - ./protocol_metrics - -when defined(rln_v2): - import ./nonce_manager + ./protocol_metrics, + ./nonce_manager import ../common/error_handling, @@ -47,8 +45,7 @@ type WakuRlnConfig* = object rlnRelayTreePath*: string rlnEpochSizeSec*: uint64 onFatalErrorAction*: OnFatalErrorHandler - when defined(rln_v2): - rlnRelayUserMessageLimit*: uint64 + rlnRelayUserMessageLimit*: uint64 proc createMembershipList*( rln: ptr RLN, n: int @@ -93,8 +90,7 @@ type WakuRLNRelay* = ref object of RootObj rlnMaxEpochGap*: uint64 groupManager*: GroupManager onFatalErrorAction*: OnFatalErrorHandler - when defined(rln_v2): - nonceManager*: NonceManager + nonceManager*: NonceManager proc calcEpoch*(rlnPeer: WakuRLNRelay, t: float64): Epoch = ## gets time `t` as `flaot64` with subseconds resolution in the fractional part @@ -307,14 +303,11 @@ proc appendRLNProof*( let input = msg.toRLNSignal() let epoch = rlnPeer.calcEpoch(senderEpochTime) - when defined(rln_v2): - let nonce = rlnPeer.nonceManager.getNonce().valueOr: - return err("could not get new message id to generate an rln proof: " & $error) - let proof = rlnPeer.groupManager.generateProof(input, epoch, nonce).valueOr: - return err("could not generate rln-v2 proof: " & $error) - else: - let proof = rlnPeer.groupManager.generateProof(input, epoch).valueOr: - return err("could not generate rln proof: " & $error) + let nonce = rlnPeer.nonceManager.getNonce().valueOr: + return err("could not get new message id to generate an rln proof: " & $error) + let proof = rlnPeer.groupManager.generateProof(input, epoch, nonce).valueOr: + return err("could not generate rln-v2 proof: " & $error) + msg.proof = proof.encode().buffer return ok() @@ -445,28 +438,18 @@ proc mount( (await groupManager.startGroupSync()).isOkOr: return err("could not start the group sync: " & $error) - when defined(rln_v2): - return ok( - WakuRLNRelay( - groupManager: groupManager, - nonceManager: - NonceManager.init(conf.rlnRelayUserMessageLimit, conf.rlnEpochSizeSec.float), - rlnEpochSizeSec: conf.rlnEpochSizeSec, - rlnMaxEpochGap: - max(uint64(MaxClockGapSeconds / float64(conf.rlnEpochSizeSec)), 1), - onFatalErrorAction: conf.onFatalErrorAction, - ) - ) - else: - return ok( - WakuRLNRelay( - groupManager: groupManager, - rlnEpochSizeSec: conf.rlnEpochSizeSec, - rlnMaxEpochGap: - max(uint64(MaxClockGapSeconds / float64(conf.rlnEpochSizeSec)), 1), - onFatalErrorAction: conf.onFatalErrorAction, - ) + return ok( + WakuRLNRelay( + groupManager: groupManager, + nonceManager: + NonceManager.init(conf.rlnRelayUserMessageLimit, conf.rlnEpochSizeSec.float), + rlnEpochSizeSec: conf.rlnEpochSizeSec, + rlnMaxEpochGap: + max(uint64(MaxClockGapSeconds / float64(conf.rlnEpochSizeSec)), 1), + onFatalErrorAction: conf.onFatalErrorAction, ) + ) + proc isReady*(rlnPeer: WakuRLNRelay): Future[bool] {.async: (raises: [Exception]).} = ## returns true if the rln-relay protocol is ready to relay messages