Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rln-relay-v2): use rln-v2 contract code #2381

Merged
merged 3 commits into from
Jan 30, 2024
Merged

chore(rln-relay-v2): use rln-v2 contract code #2381

merged 3 commits into from
Jan 30, 2024

Conversation

rymnc
Copy link
Contributor

@rymnc rymnc commented Jan 29, 2024

Description

This PR adds rln-v2 contract code into the waku_rln_relay/contract.nim file

This PR also feature flags it with rln_v2 and updates the Makefile entry for conditional compilation as well.

Changes

  • Makefile entries for conditional compiling rln_v2
  • Feature flag for rln_v2 in tests and contract.nim

Issue

closes #2375

@rymnc rymnc added the E:RLN on mainnet see https://github.com/waku-org/pm/issues/98 for details label Jan 29, 2024
@rymnc rymnc self-assigned this Jan 29, 2024
Copy link

github-actions bot commented Jan 29, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2381

Built from 4ec1d8f

@rymnc rymnc marked this pull request as ready for review January 29, 2024 11:06
@rymnc rymnc mentioned this pull request Jan 29, 2024
17 tasks
Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for it! 💯
I just added a question and a nitpick comment ;P

debug "Initial account balance: ", balance

# deploy registry contract with its constructor inputs
let receipt = await web3.deployContract(RegistryContractCode)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only difference between the two branches of the when defined(rln_v2). Thereafter, I think is better to perform the when validation in a narrower scope instead of duplicating so much code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will make that change 👍
wanted to make it easier to transition from v1 to v2 by deleting whole functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in b05815e

let contractAddress = receipt.contractAddress.get()
debug "Address of the deployed registry contract: ", contractAddress
# deploy registry contract with its constructor inputs
let receipt = await web3.deployContract(RegistryContractCode,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following my previous comment, this is the only diff (and its parameters.) Let's reduce the when scope if possible :)

@@ -134,6 +138,10 @@ $(LIBRLN_FILE):

librln: | $(LIBRLN_FILE)
$(eval NIM_PARAMS += --passL:$(LIBRLN_FILE) --passL:-lm)
ifeq ($(RLN_V2),true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the impression that we won't test this in our CI. Shall we switch it manually in the future? To elaborate a bit more, I think we'd need to adapt the following somehow in the future:

make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=1 test testwakunode2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, at the moment rln-v2 is unstable in nwaku. when it's at a better state I'll add the flag similar to how we had it for experimental builds

Copy link
Contributor

@alrevuelta alrevuelta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rymnc rymnc merged commit c55ca06 into master Jan 30, 2024
8 of 10 checks passed
@rymnc rymnc deleted the rln-v2-contract branch January 30, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:RLN on mainnet see https://github.com/waku-org/pm/issues/98 for details
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rln-v2: Update waku-rln-contract bindings
3 participants