From e7b0777d2599e9d33f407dca8de2b1791bdf8320 Mon Sep 17 00:00:00 2001 From: Aaryamann Challani <43716372+rymnc@users.noreply.github.com> Date: Fri, 17 May 2024 14:48:29 +0530 Subject: [PATCH] feat(rln-relay): use arkzkey variant of zerokit (#2681) --- Makefile | 2 +- scripts/build_rln.sh | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 777fb5757..4a22552b8 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ clean: | clean-libbacktrace LIBRLN_BUILDDIR := $(CURDIR)/vendor/zerokit ifeq ($(RLN_V2),true) -LIBRLN_VERSION := v0.4.3 +LIBRLN_VERSION := v0.4.4 else LIBRLN_VERSION := v0.3.7 endif diff --git a/scripts/build_rln.sh b/scripts/build_rln.sh index aa86ad6c5..2a7d9ed38 100755 --- a/scripts/build_rln.sh +++ b/scripts/build_rln.sh @@ -17,17 +17,28 @@ output_filename=$3 # Get the host triplet host_triplet=$(rustc --version --verbose | awk '/host:/{print $2}') +tarball="${host_triplet}" + +# use arkzkey feature for v0.4.4 +# TODO: update this script in the future when arkzkey is default +if [[ "${rln_version}" == "v0.4.4" ]]; then + tarball+="-arkzkey-rln.tar.gz" +else + tarball+="-rln.tar.gz" +fi + + # Download the prebuilt rln library if it is available if curl --silent --fail-with-body -L \ - "https://github.com/vacp2p/zerokit/releases/download/$rln_version/${host_triplet}-rln.tar.gz" \ - -o "${host_triplet}-rln.tar.gz"; + "https://github.com/vacp2p/zerokit/releases/download/$rln_version/$tarball" \ + -o "${tarball}"; then - echo "Downloaded ${host_triplet}-rln.tar.gz" - tar -xzf "${host_triplet}-rln.tar.gz" + echo "Downloaded ${tarball}" + tar -xzf "${tarball}" mv "release/librln.a" "${output_filename}" - rm -rf "${host_triplet}-rln.tar.gz" release + rm -rf "${tarball}" release else - echo "Failed to download ${host_triplet}-rln.tar.gz" + echo "Failed to download ${tarball}" # Build rln instead # first, check if submodule version = version in Makefile cargo metadata --format-version=1 --no-deps --manifest-path "${build_dir}/rln/Cargo.toml"