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 onchain rln-relay-v2 #2482

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

rymnc
Copy link
Contributor

@rymnc rymnc commented Feb 27, 2024

Description

This PR includes changes to the test_rln_group_manager_onchain with fixes to some of the serde done at the event parsing side.

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 onchain 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/onchain_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_onchain.nim

Issue

closes #2481

Copy link

github-actions bot commented Feb 27, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2482

Built from 1b070c6

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.

waku/waku_rln_relay/rln/wrappers.nim Outdated Show resolved Hide resolved
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! 💯
Just minor nitpick comments:)

raise newException(CatchableError, "failed to convert rateCommitments to leaves: " & leavesRes.error)
let leaves = cast[seq[seq[byte]]](leavesRes.get())
let leaves = rateCommitments.toLeaves().valueOr:
raise newException(ValueError, "failed to convert rateCommitments to leaves: " & $error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unrelated to this PR but I'm more keen on avoid raising exceptions whenever is possible

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 address in follow up prs!

@rymnc rymnc merged commit 88ff928 into master Mar 1, 2024
9 of 10 checks passed
@rymnc rymnc deleted the onchain-rln-v2-tests branch March 1, 2024 08:45
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.

rln-v2: additional testing
3 participants