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

Use Zerokit RLN module in nwaku #1030

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
564e5ed
Update zerokit submodule to master
s1fr0 Jun 30, 2022
e5be52a
Update .gitmodules
s1fr0 Jun 30, 2022
9547f6c
Update zerokit submodule
s1fr0 Jun 30, 2022
1b91a2a
refactor(rln): replace kilic's RLN module with zerokit RLN
s1fr0 Jun 30, 2022
e0daa25
fix(rln): update hardcoded values for zerokit RLN Bn254
s1fr0 Jun 30, 2022
9054ab9
fix(rln): fix serialization order
s1fr0 Jun 30, 2022
05ca701
fix(rln): allow more time for proof generation
s1fr0 Jun 30, 2022
765e8c5
Merge branch 'master' into zerokit-rln-integration
s1fr0 Jun 30, 2022
80dddff
fix(rln): update comment for rln API
s1fr0 Jul 6, 2022
e5c4a65
refactor(rln): add release compilation flag, change zerokit branch
s1fr0 Jul 26, 2022
b05d485
Removed submodule zerokit
s1fr0 Jul 26, 2022
bb01e2b
chore(rln): switch to zerokit rln improved circuit loading branch
s1fr0 Jul 26, 2022
ccc2724
fix(rln): restore timeouts to previous values
s1fr0 Jul 26, 2022
175d961
fix(rln): remove unnecessary comments
s1fr0 Jul 26, 2022
08a68be
Merge branch 'master' into zerokit-rln-integration
s1fr0 Jul 26, 2022
d28030b
refactor(rln): add RLNZEROKIT compiler flag to switch RLN module
s1fr0 Jul 26, 2022
794c93f
chore(rln): select only rln tests
s1fr0 Jul 26, 2022
80b3c79
fix(rln): add zerokit submodule
s1fr0 Jul 26, 2022
0d2b847
fix(rln): solve resolve conflicts with when define
s1fr0 Jul 26, 2022
537cdee
fix(rln): restore correct endianess in contract registration
s1fr0 Jul 26, 2022
56b30a5
fix(rln): disable RLNZEROKIT in CI make; restore all tests
s1fr0 Jul 26, 2022
5047e6c
Merge branch 'zerokit-compiler-flag' into zerokit-rln-integration
s1fr0 Jul 26, 2022
1d6904f
fix(rln): fix previously wrong rebase
s1fr0 Jul 27, 2022
2c4b2b3
fix(rln): add correct when defined to avoid conflicts with rlnzerokit
s1fr0 Jul 27, 2022
ae4711a
Merge branch 'master' into zerokit-rln-integration
s1fr0 Jul 28, 2022
831d3cf
fix(rln): update zerokit module branch
s1fr0 Jul 29, 2022
32bea0d
Merge branch 'master' into zerokit-rln-integration
s1fr0 Jul 29, 2022
311fc25
Merge branch 'master' into zerokit-rln-integration
s1fr0 Aug 1, 2022
4cf80df
Merge branch 'master' into zerokit-rln-integration
s1fr0 Aug 3, 2022
67282a2
Merge branch 'master' into zerokit-rln-integration
s1fr0 Aug 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,7 @@
url = https://github.com/status-im/nim-presto.git
ignore = untracked
branch = master
[submodule "vendor/zerokit"]
path = vendor/zerokit
url = https://github.com/vacp2p/zerokit.git
branch = master
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ else ifeq ($(CI), true)
NIM_PARAMS := $(NIM_PARAMS) -d:rln
endif

# control rln code compilation
ifeq ($(RLNZEROKIT), true)
NIM_PARAMS := $(NIM_PARAMS) -d:rlnzerokit
#To avoid redefinition conflicts, we disable rln zerokit default compilation in CI
#else ifeq ($(CI), true)
#NIM_PARAMS := $(NIM_PARAMS) -d:rlnzerokit
endif

# detecting the os
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
detected_OS := Windows
Expand Down Expand Up @@ -103,7 +111,7 @@ NIM_PARAMS := $(NIM_PARAMS) -d:discv5_protocol_id:d5waku
GIT_VERSION := "$(shell git describe --abbrev=6 --always --tags)"
NIM_PARAMS := $(NIM_PARAMS) -d:git_version:\"$(GIT_VERSION)\"

deps: | deps-common nat-libs waku.nims rlnlib
deps: | deps-common nat-libs waku.nims rlnlib rlnzerokitlib
ifneq ($(USE_LIBBACKTRACE), 0)
deps: | libbacktrace
endif
Expand Down Expand Up @@ -173,6 +181,15 @@ else ifeq ($(CI), true)
cargo build --manifest-path vendor/rln/Cargo.toml
endif


rlnzerokitlib:
ifeq ($(RLNZEROKIT), true)
cargo build --manifest-path vendor/zerokit/rln/Cargo.toml --release
#To avoid redefinition conflicts, we disable rln zerokit default compilation in CI
#else ifeq ($(CI), true)
# cargo build --manifest-path vendor/zerokit/rln/Cargo.toml --release
endif

test2: | build deps installganache
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim test2 $(NIM_PARAMS) waku.nims
Expand Down Expand Up @@ -228,11 +245,16 @@ ifneq ($(USE_LIBBACKTRACE), 0)
+ $(MAKE) -C vendor/nim-libbacktrace clean $(HANDLE_OUTPUT)
endif
cargo clean --manifest-path vendor/rln/Cargo.toml
cargo clean --manifest-path vendor/zerokit/rln/Cargo.toml

# clean the rln build (forces recompile of old crates on next build)
cleanrln:
cargo clean --manifest-path vendor/rln/Cargo.toml

# clean the rln build (forces recompile of old crates on next build)
cleanrlnzerokit:
cargo clean --manifest-path vendor/zerokit/rln/Cargo.toml

endif # "variables.mk" was not included

libwaku.so: | build deps
Expand Down
4 changes: 4 additions & 0 deletions tests/all_tests_v2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ when defined(rln):
when defined(onchain_rln):
import ./v2/test_waku_rln_relay_onchain

when defined(rlnzerokit):
import ./v2/test_waku_rln_relay_zerokit
when defined(onchain_rln):
import ./v2/test_waku_rln_relay_onchain_zerokit

# TODO Only enable this once swap module is integrated more nicely as a dependency, i.e. as submodule with CI etc
# For PoC execute it manually and run separate module here: https://github.com/vacp2p/swap-contracts-module
Expand Down
Loading