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

feat: rln subcommands #654

Merged
merged 3 commits into from
Aug 24, 2023
Merged

feat: rln subcommands #654

merged 3 commits into from
Aug 24, 2023

Conversation

richard-ramos
Copy link
Member

@richard-ramos richard-ramos commented Aug 18, 2023

Description

See waku-org/nwaku#1887 for justification to remove registration from the wakunode.

Changes

  • Remove RLN registration logic from wakunode
  • Subcommand to generate RLN credentials
  • Subcommand to list credentials (might be done in a separate PR)
  • Update test units
  • Update examples
  • Update documentation

Testing

./build/waku generate-rln-credentials --eth-account-private-key=<private-key> --eth-contract-address=<0x000...> --eth-client-address=<eth-client-rpc-or-wss-endpoint> --cred-path=rlnKeystore.json

@status-im-auto
Copy link

status-im-auto commented Aug 18, 2023

Jenkins Builds

Click to see older builds (60)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 767c0ea #1 2023-08-18 21:46:35 ~1 min linux 📦deb
✔️ 767c0ea #1 2023-08-18 21:47:30 ~2 min nix-flake 📄log
✖️ 767c0ea #1 2023-08-18 21:47:41 ~2 min tests 📄log
✔️ 767c0ea #1 2023-08-18 21:48:32 ~3 min tests 📄log
✔️ 767c0ea #1 2023-08-18 21:49:30 ~4 min android 📦tgz
✔️ 767c0ea #1 2023-08-18 21:50:39 ~5 min ios 📦tgz
✔️ 6a6bfd5 #2 2023-08-20 16:01:16 ~49 sec tests 📄log
✔️ 6a6bfd5 #2 2023-08-20 16:01:38 ~1 min linux 📦deb
✖️ 6a6bfd5 #2 2023-08-20 16:02:08 ~1 min tests 📄log
✔️ 6a6bfd5 #2 2023-08-20 16:02:16 ~1 min nix-flake 📄log
✔️ 6a6bfd5 #2 2023-08-20 16:04:48 ~4 min android 📦tgz
✔️ 6a6bfd5 #2 2023-08-20 16:05:00 ~4 min ios 📦tgz
✔️ 8213081 #3 2023-08-20 19:50:12 ~30 sec linux 📦deb
✔️ 8213081 #3 2023-08-20 19:50:30 ~48 sec tests 📄log
✔️ 8213081 #3 2023-08-20 19:51:28 ~1 min tests 📄log
✔️ 8213081 #3 2023-08-20 19:51:48 ~2 min nix-flake 📄log
✔️ 8213081 #3 2023-08-20 19:53:14 ~3 min android 📦tgz
✔️ 8213081 #3 2023-08-20 19:54:22 ~4 min ios 📦tgz
✔️ 1f6c5b7 #4 2023-08-20 23:03:29 ~31 sec linux 📦deb
✔️ 1f6c5b7 #4 2023-08-20 23:03:41 ~44 sec tests 📄log
✔️ 1f6c5b7 #4 2023-08-20 23:04:40 ~1 min tests 📄log
✔️ 1f6c5b7 #4 2023-08-20 23:04:50 ~1 min nix-flake 📄log
✔️ 1f6c5b7 #4 2023-08-20 23:06:42 ~3 min android 📦tgz
✔️ 1f6c5b7 #4 2023-08-20 23:07:56 ~4 min ios 📦tgz
✖️ bdc1e63 #5 2023-08-21 14:22:47 ~26 sec nix-flake 📄log
✔️ bdc1e63 #5 2023-08-21 14:23:33 ~1 min linux 📦deb
✔️ bdc1e63 #5 2023-08-21 14:23:53 ~1 min tests 📄log
✔️ bdc1e63 #5 2023-08-21 14:25:17 ~2 min tests 📄log
✔️ bdc1e63 #5 2023-08-21 14:25:43 ~3 min android 📦tgz
✔️ bdc1e63 #5 2023-08-21 14:27:10 ~4 min ios 📦tgz
✔️ 420891c #6 2023-08-21 16:36:34 ~34 sec linux 📦deb
✔️ 420891c #6 2023-08-21 16:37:12 ~1 min tests 📄log
✔️ 420891c #6 2023-08-21 16:38:05 ~2 min tests 📄log
✔️ 420891c #6 2023-08-21 16:38:16 ~2 min nix-flake 📄log
✔️ 420891c #6 2023-08-21 16:39:14 ~3 min ios 📦tgz
✔️ 420891c #6 2023-08-21 16:39:21 ~3 min android 📦tgz
✖️ 6ce04a1 #7 2023-08-21 16:59:17 ~12 sec nix-flake 📄log
✔️ 6ce04a1 #7 2023-08-21 16:59:36 ~31 sec linux 📦deb
✔️ 6ce04a1 #7 2023-08-21 17:00:15 ~1 min tests 📄log
✔️ 6ce04a1 #7 2023-08-21 17:00:49 ~1 min tests 📄log
✔️ 6ce04a1 #7 2023-08-21 17:02:10 ~3 min android 📦tgz
✔️ 6ce04a1 #7 2023-08-21 17:02:35 ~3 min ios 📦tgz
✖️ 996c8a5 #8 2023-08-21 17:06:38 ~28 sec nix-flake 📄log
✔️ 996c8a5 #8 2023-08-21 17:06:43 ~32 sec linux 📦deb
✔️ 996c8a5 #8 2023-08-21 17:06:54 ~43 sec tests 📄log
✔️ 996c8a5 #8 2023-08-21 17:07:59 ~1 min tests 📄log
✔️ 996c8a5 #8 2023-08-21 17:09:07 ~3 min android 📦tgz
✔️ 996c8a5 #8 2023-08-21 17:09:24 ~3 min ios 📦tgz
✖️ f4e7e04 #9 2023-08-21 19:11:28 ~12 sec nix-flake 📄log
✖️ f4e7e04 #9 2023-08-21 19:11:37 ~21 sec tests 📄log
✖️ f4e7e04 #9 2023-08-21 19:11:38 ~21 sec tests 📄log
✔️ f4e7e04 #9 2023-08-21 19:11:45 ~29 sec linux 📦deb
✔️ f4e7e04 #9 2023-08-21 19:14:32 ~3 min android 📦tgz
✔️ f4e7e04 #9 2023-08-21 19:15:37 ~4 min ios 📦tgz
✔️ a70ef8e #10 2023-08-21 19:25:06 ~29 sec linux 📦deb
✔️ a70ef8e #10 2023-08-21 19:25:32 ~51 sec tests 📄log
✔️ a70ef8e #10 2023-08-21 19:26:29 ~1 min tests 📄log
✔️ a70ef8e #10 2023-08-21 19:26:48 ~2 min nix-flake 📄log
✔️ a70ef8e #10 2023-08-21 19:27:41 ~3 min android 📦tgz
✔️ a70ef8e #10 2023-08-21 19:28:10 ~3 min ios 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 060bcbc #11 2023-08-24 14:29:28 ~34 sec linux 📦deb
✔️ 060bcbc #11 2023-08-24 14:30:52 ~1 min nix-flake 📄log
✔️ 060bcbc #11 2023-08-24 14:30:58 ~2 min tests 📄log
✔️ 060bcbc #11 2023-08-24 14:32:04 ~3 min tests 📄log
✔️ 060bcbc #11 2023-08-24 14:32:31 ~3 min android 📦tgz
✔️ 060bcbc #11 2023-08-24 14:32:33 ~3 min ios 📦tgz
✔️ 93398ed #12 2023-08-24 14:34:15 ~36 sec linux 📦deb
✔️ 93398ed #12 2023-08-24 14:35:12 ~1 min tests 📄log
✔️ 93398ed #12 2023-08-24 14:35:31 ~1 min nix-flake 📄log
✔️ 93398ed #12 2023-08-24 14:35:41 ~1 min tests 📄log
✔️ 93398ed #12 2023-08-24 14:36:50 ~3 min android 📦tgz
✔️ 93398ed #12 2023-08-24 14:37:09 ~3 min ios 📦tgz

@richard-ramos
Copy link
Member Author

@alrevuelta The PR as it is right now can be used to create keystores. If you want, i can add some flag that could let you send the transactions and create the keystore items regardless of the transaction being mined or not.

The subcommand also has some flags to specify the nonce, and gas price in case you need to modify this for your tests

@@ -0,0 +1,3 @@
[submodule "waku/v2/protocol/rln/contracts/rln-contract"]
path = waku/v2/protocol/rln/contracts/rln-contract
url = [email protected]:vacp2p/rln-contract.git
Copy link

Choose a reason for hiding this comment

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

err we should use the waku-org/waku-rln-contract now!

Copy link
Member Author

Choose a reason for hiding this comment

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

Using waku-rln-contract WakuRlnRegistry introduces a lot of breaking changes, due to how the bindings for go are modified and I end up not being able to retrieve the events:

waku/v2/protocol/rln/group_manager/dynamic/web3.go:17:73: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/web3.go:110:102: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/web3.go:111:27: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/web3.go:172:104: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/web3.go:173:37: gm.rlnContract.FilterMemberRegistered undefined (type *contracts.RLN has no field or method FilterMemberRegistered)
waku/v2/protocol/rln/group_manager/dynamic/dynamic.go:58:59: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/dynamic.go:73:36: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/dynamic.go:76:42: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/dynamic.go:151:24: gm.rlnContract.MEMBERSHIPDEPOSIT undefined (type *contracts.RLN has no field or method MEMBERSHIPDEPOSIT)
waku/v2/protocol/rln/group_manager/dynamic/dynamic.go:231:38: undefined: contracts.RLNMemberRegistered
waku/v2/protocol/rln/group_manager/dynamic/web3.go:173:37: too many errors

Notice how I can't easily filter events, nor obtain the fee.
Since @alrevuelta is still using vacp2p/rln-contract, I'll figure out how to solve the errors introduced by changing the contract in a separate PR.

Copy link
Collaborator

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

LGTM, just had 1 query.

cli "github.com/urfave/cli/v2"
)

// Command generates a key file used to generate the node's peerID, encrypted with an optional password
Copy link
Collaborator

Choose a reason for hiding this comment

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

Node's peerId maynot be tied to RLN membership right.
A user has the flexibility to use different public/private key pair for RLN and peerID generation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct. the peerID is not associated to rln. User is able to choose which credential to use via the membership group and keystore index flags

return 0, fmt.Errorf("transaction error: %w", err)
}

url := ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better to rename to explorerURL

@richard-ramos richard-ramos merged commit f62ba67 into master Aug 24, 2023
8 of 10 checks passed
@richard-ramos richard-ramos deleted the rln-subcommand branch August 24, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants