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

refactor: keystore as a data type and store credentials into a map #675

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

richard-ramos
Copy link
Member

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

Description

Extracts the rln keystore to be its own data type so the dynamic group manager does not have to worry about the keystore path and its existence. Also, uses the structure proposed in waku-org/nwaku#1922 (comment) and waku-org/nwaku#1922 (comment)

Changes

  • Extracts keystore functionality to an AppKeystore struct
  • Uses a map instead of an array to store credentials
  • Removes the flag rln-relay-membership-index from wakunode and chat2
  • Simplifies API of GetMembershipCredentials function
  • Ensures credentials can be used in both nwaku and go-waku

@status-im-auto
Copy link

status-im-auto commented Aug 23, 2023

Jenkins Builds

Click to see older builds (60)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 7d006fb #1 2023-08-23 20:54:10 ~2 min tests 📄log
✔️ 7d006fb #1 2023-08-23 20:54:23 ~2 min nix-flake 📄log
✔️ 7d006fb #1 2023-08-23 20:54:37 ~2 min linux 📦deb
✔️ 7d006fb #1 2023-08-23 20:55:05 ~2 min tests 📄log
✔️ 7d006fb #1 2023-08-23 20:56:41 ~4 min android 📦tgz
✔️ 7d006fb #1 2023-08-23 20:56:46 ~4 min ios 📦tgz
✔️ 7d006fb #2 2023-08-24 14:49:42 ~1 min tests 📄log
✔️ 7d006fb #2 2023-08-24 14:50:09 ~1 min linux 📦deb
✔️ 7d006fb #2 2023-08-24 14:50:37 ~1 min nix-flake 📄log
✖️ 7d006fb #2 2023-08-24 14:51:04 ~2 min tests 📄log
✔️ 7d006fb #2 2023-08-24 14:51:51 ~3 min android 📦tgz
✔️ 7d006fb #2 2023-08-24 14:51:55 ~3 min ios 📦tgz
✔️ 855e84c #3 2023-08-24 15:32:00 ~1 min linux 📦deb
✔️ 855e84c #3 2023-08-24 15:32:54 ~2 min nix-flake 📄log
✖️ 855e84c #3 2023-08-24 15:33:06 ~2 min tests 📄log
✔️ 855e84c #3 2023-08-24 15:33:54 ~3 min tests 📄log
✔️ 855e84c #3 2023-08-24 15:34:04 ~3 min ios 📦tgz
✔️ 855e84c #3 2023-08-24 15:34:19 ~3 min android 📦tgz
✔️ fdb2b6d #4 2023-08-24 16:01:56 ~31 sec linux 📦deb
✔️ fdb2b6d #4 2023-08-24 16:02:17 ~52 sec tests 📄log
✖️ fdb2b6d #4 2023-08-24 16:02:28 ~1 min tests 📄log
✔️ fdb2b6d #4 2023-08-24 16:03:25 ~2 min nix-flake 📄log
✔️ fdb2b6d #4 2023-08-24 16:04:47 ~3 min ios 📦tgz
✔️ fdb2b6d #4 2023-08-24 16:05:47 ~4 min android 📦tgz
✖️ bea7a5b #5 2023-08-24 18:44:52 ~1 min tests 📄log
✔️ bea7a5b #5 2023-08-24 18:44:59 ~1 min linux 📦deb
✔️ bea7a5b #5 2023-08-24 18:45:37 ~1 min nix-flake 📄log
✔️ bea7a5b #5 2023-08-24 18:46:35 ~2 min tests 📄log
✔️ bea7a5b #5 2023-08-24 18:47:15 ~3 min android 📦tgz
✔️ bea7a5b #5 2023-08-24 18:47:44 ~4 min ios 📦tgz
✔️ 1fb18bb #6 2023-08-29 21:51:27 ~32 sec linux 📦deb
✖️ 1fb18bb #6 2023-08-29 21:51:59 ~1 min tests 📄log
✔️ 1fb18bb #6 2023-08-29 21:52:11 ~1 min tests 📄log
✔️ 1fb18bb #6 2023-08-29 21:52:49 ~1 min nix-flake 📄log
✔️ 1fb18bb #6 2023-08-29 21:55:12 ~4 min android 📦tgz
✔️ 1fb18bb #6 2023-08-29 21:55:43 ~4 min ios 📦tgz
✔️ fc8521a #7 2023-08-29 22:52:42 ~36 sec linux 📦deb
✔️ fc8521a #7 2023-08-29 22:52:59 ~53 sec tests 📄log
✔️ fc8521a #7 2023-08-29 22:53:58 ~1 min nix-flake 📄log
✔️ fc8521a #7 2023-08-29 22:54:51 ~2 min tests 📄log
✔️ fc8521a #7 2023-08-29 22:55:17 ~3 min android 📦tgz
✔️ fc8521a #7 2023-08-29 22:55:31 ~3 min ios 📦tgz
✔️ f2ea4b3 #8 2023-08-31 15:59:59 ~36 sec linux 📦deb
✔️ f2ea4b3 #8 2023-08-31 16:00:08 ~45 sec tests 📄log
✔️ f2ea4b3 #8 2023-08-31 16:01:06 ~1 min tests 📄log
✔️ f2ea4b3 #8 2023-08-31 16:01:15 ~1 min nix-flake 📄log
✔️ f2ea4b3 #8 2023-08-31 16:03:04 ~3 min android 📦tgz
✔️ f2ea4b3 #8 2023-08-31 16:03:27 ~4 min ios 📦tgz
✔️ 6629ba4 #9 2023-08-31 19:22:44 ~35 sec linux 📦deb
✖️ 6629ba4 #9 2023-08-31 19:23:10 ~1 min tests 📄log
✔️ 6629ba4 #9 2023-08-31 19:23:24 ~1 min tests 📄log
✔️ 6629ba4 #9 2023-08-31 19:24:01 ~1 min nix-flake 📄log
✔️ 6629ba4 #9 2023-08-31 19:25:35 ~3 min android 📦tgz
✔️ 6629ba4 #9 2023-08-31 19:26:47 ~4 min ios 📦tgz
✔️ bbe4b12 #10 2023-08-31 19:32:11 ~30 sec linux 📦deb
✔️ bbe4b12 #10 2023-08-31 19:32:28 ~45 sec tests 📄log
✔️ bbe4b12 #10 2023-08-31 19:33:24 ~1 min tests 📄log
✔️ bbe4b12 #10 2023-08-31 19:33:34 ~1 min nix-flake 📄log
✔️ bbe4b12 #10 2023-08-31 19:35:09 ~3 min ios 📦tgz
✔️ bbe4b12 #10 2023-08-31 19:35:18 ~3 min android 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ dfe579a #11 2023-08-31 19:33:42 ~32 sec linux 📦deb
✔️ dfe579a #11 2023-08-31 19:35:23 ~1 min tests 📄log
✔️ dfe579a #11 2023-08-31 19:35:41 ~2 min nix-flake 📄log
✔️ dfe579a #11 2023-08-31 19:36:10 ~3 min tests 📄log
✔️ dfe579a #11 2023-08-31 19:37:18 ~4 min ios 📦tgz
✔️ dfe579a #11 2023-08-31 19:38:30 ~3 min android 📦tgz
✔️ b84386b #12 2023-08-31 19:39:17 ~32 sec linux 📦deb
✔️ b84386b #12 2023-08-31 19:40:06 ~1 min tests 📄log
✔️ b84386b #12 2023-08-31 19:40:33 ~1 min tests 📄log
✔️ b84386b #12 2023-08-31 19:40:37 ~1 min nix-flake 📄log
✔️ b84386b #12 2023-08-31 19:41:44 ~2 min android 📦tgz
✔️ b84386b #12 2023-08-31 19:42:13 ~3 min ios 📦tgz

Base automatically changed from rln-by-default to master August 24, 2023 14:48
@richard-ramos richard-ramos force-pushed the refactor/keystore branch 2 times, most recently from 855e84c to fdb2b6d Compare August 24, 2023 16:01
@richard-ramos richard-ramos changed the title refactor: keystore as a data type refactor: keystore as a data type and store credentials into a map Aug 24, 2023
@richard-ramos
Copy link
Member Author

Some things that are pending or need to be verified:
1 - Does the hash used as key have a 0x prefix?
2 - In AddMembershipCredential, is it possible to have different identity credentials within the same SHA? (probably not)
3 - In AddMembershipCredential, replace newIdentityCredential and newMembershipGroup by a single MembershipCredentials parameter

@richard-ramos richard-ramos force-pushed the refactor/keystore branch 2 times, most recently from 1fb18bb to fc8521a Compare August 29, 2023 22:51
@richard-ramos richard-ramos marked this pull request as ready for review August 29, 2023 22:55
@richard-ramos
Copy link
Member Author

I updated this PR with the format for the key sha256(chainId|contractAddress|treeIndex) from waku-org/nwaku#1956 and it's now ready for review!

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

waku/v2/protocol/rln/keystore/keystore.go Outdated Show resolved Hide resolved
waku/v2/protocol/rln/keystore/types.go Outdated Show resolved Hide resolved
@richard-ramos richard-ramos force-pushed the refactor/keystore branch 3 times, most recently from 6629ba4 to bbe4b12 Compare August 31, 2023 19:31
@richard-ramos richard-ramos merged commit 9c0bebc into master Aug 31, 2023
1 check passed
@richard-ramos richard-ramos deleted the refactor/keystore branch August 31, 2023 19:42
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.

3 participants