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): added tests for static rln-relay-v2 #2484

Merged
merged 9 commits into from
Mar 4, 2024

Conversation

rymnc
Copy link
Contributor

@rymnc rymnc commented Feb 28, 2024

Description

Follows suit with the changes that were made in #2482

Updates the static group manager + tests for rln-v2, defaulting the UserMessageLimit to 20 for testing purposes.

Note

The rln-v2 test suite is not feature complete yet, i.e it has to be integrated in other test suites like test_wakunode_rln_relay.nim and test_waku_rln_relay.nim, those will be addressed in follow up PRs

Changes

  • User is able to register and generate valid proofs with the static group manager
  • Changes to all the test vectors to account for rate commitments instead of id commitments.

How to test

  1. source env.sh
  2. nim c --out:build/static_rln_test -r -d:chronicles_log_level=DEBUG -d:rln_v2:true -d:os=Darwin --verbosity:0 --hints:off -d:chronicles_log_level=TRACE -d:git_version="v0.24.0-rc.0-35-g50308e" -d:release --passL:librln_v0.4.1.a --passL:-lm tests/waku_rln_relay/test_rln_group_manager_static.nim

Copy link

github-actions bot commented Feb 28, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2484

Built from fb8bf41

@rymnc rymnc changed the title chore(rln-relay): added tests for static rln-relay-v2 chore(rln-relay-v2): added tests for static rln-relay-v2 Feb 28, 2024
Base automatically changed from onchain-rln-v2-tests to master March 1, 2024 08:45
@rymnc rymnc marked this pull request as ready for review March 1, 2024 10:09
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! 💯

waku/waku_rln_relay/group_manager/static/group_manager.nim Outdated Show resolved Hide resolved
raise newException(ValueError, "Failed to remove member from the merkle tree")

if g.withdrawCb.isSome():
await g.withdrawCb.get()(@[Membership(rateCommitment: rateCommitment, index: index)])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not super critical but shall we separate this line into two statements so that it is clear the item that withdrawCb is returning?

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 249c50c

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
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

registrations[0].idCommitment == idCommitment
registrations[0].index == 10
when defined(rln_v2):
require:
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick. registrations.len == 1 and registrations[0].index == 10 is the same in v1 and v2. extract it and remove the duplicate?

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 320661d

withdrawals[0].index == 0
when defined(rln_v2):
require:
withdrawals.len == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

same, duplicated?

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 588160f

@rymnc rymnc merged commit 5b174fb into master Mar 4, 2024
8 of 10 checks passed
@rymnc rymnc deleted the update-static-rln-v2-tests branch March 4, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants