diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1334f63..ec5310e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: runs-on: ${{ matrix.platform }} timeout-minutes: 60 - name: test - ${{ matrix.crate }} - ${{ matrix.platform }} + name: Test - ${{ matrix.crate }} - ${{ matrix.platform }} steps: - name: Checkout sources uses: actions/checkout@v4 @@ -48,11 +48,11 @@ jobs: matrix: platform: [ubuntu-latest, macos-latest] crate: [rln] - feature: ["default", "arkzkey", "stateless"] + feature: ["default", "stateless"] runs-on: ${{ matrix.platform }} timeout-minutes: 60 - name: test - ${{ matrix.crate }} - ${{ matrix.platform }} - ${{ matrix.feature }} + name: Test - ${{ matrix.crate }} - ${{ matrix.platform }} - ${{ matrix.feature }} steps: - name: Checkout sources uses: actions/checkout@v4 @@ -75,11 +75,11 @@ jobs: matrix: platform: [ubuntu-latest, macos-latest] crate: [rln-wasm] - feature: ["default", "arkzkey"] + feature: ["default"] runs-on: ${{ matrix.platform }} timeout-minutes: 60 - name: test - ${{ matrix.crate }} - ${{ matrix.platform }} - ${{ matrix.feature }} + name: Test - ${{ matrix.crate }} - ${{ matrix.platform }} - ${{ matrix.feature }} steps: - uses: actions/checkout@v4 - name: Install stable toolchain @@ -117,11 +117,11 @@ jobs: # matrix: # platform: [ubuntu-latest, macos-latest] # crate: [rln-wasm] - # feature: ["parallel", "parallel_arkzkey"] + # feature: ["parallel"] # runs-on: ${{ matrix.platform }} # timeout-minutes: 60 - # name: test - ${{ matrix.crate }} - ${{ matrix.platform }} - ${{ matrix.feature }} + # name: Test - ${{ matrix.crate }} - ${{ matrix.platform }} - ${{ matrix.feature }} # steps: # - uses: actions/checkout@v4 # - name: Install nightly toolchain @@ -208,7 +208,7 @@ jobs: # we run benchmark tests only on ubuntu platform: [ubuntu-latest] crate: [rln] - feature: ["default", "arkzkey"] + feature: ["default"] runs-on: ${{ matrix.platform }} timeout-minutes: 60 diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 0da40a0..83e15a2 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -6,17 +6,22 @@ on: jobs: linux: + name: Linux build + runs-on: ubuntu-latest strategy: matrix: - feature: ["default", "arkzkey", "stateless"] + feature: + - "stateless" + - "stateless,parallel" + - "pmtree-ft" + - "pmtree-ft,parallel" + - "fullmerkletree" + - "fullmerkletree,parallel" + - "optimalmerkletree" + - "optimalmerkletree,parallel" target: - x86_64-unknown-linux-gnu - aarch64-unknown-linux-gnu - include: - - feature: stateless - cargo_args: --exclude rln-cli - name: Linux build - runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@v4 @@ -27,13 +32,14 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install dependencies run: make installdeps - - name: cross build + - name: Cross build run: | - cross build --release --target ${{ matrix.target }} --features ${{ matrix.feature }} --workspace ${{ matrix.cargo_args }} + FEATURES="${{ matrix.feature }}" + + cross build --release --target ${{ matrix.target }} --features $FEATURES --workspace --exclude rln-cli mkdir release cp target/${{ matrix.target }}/release/librln* release/ tar -czvf ${{ matrix.target }}-${{ matrix.feature }}-rln.tar.gz release/ - - name: Upload archive artifact uses: actions/upload-artifact@v4 with: @@ -46,13 +52,18 @@ jobs: runs-on: macos-latest strategy: matrix: - feature: ["default", "arkzkey", "stateless"] + feature: + - "stateless" + - "stateless,parallel" + - "pmtree-ft" + - "pmtree-ft,parallel" + - "fullmerkletree" + - "fullmerkletree,parallel" + - "optimalmerkletree" + - "optimalmerkletree,parallel" target: - x86_64-apple-darwin - aarch64-apple-darwin - include: - - feature: stateless - cargo_args: --exclude rln-cli steps: - name: Checkout sources uses: actions/checkout@v4 @@ -63,13 +74,14 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install dependencies run: make installdeps - - name: cross build + - name: Cross build run: | - cross build --release --target ${{ matrix.target }} --features ${{ matrix.feature }} --workspace ${{ matrix.cargo_args }} + FEATURES="${{ matrix.feature }}" + + cross build --release --target ${{ matrix.target }} --features $FEATURES --workspace --exclude rln-cli mkdir release cp target/${{ matrix.target }}/release/librln* release/ tar -czvf ${{ matrix.target }}-${{ matrix.feature }}-rln.tar.gz release/ - - name: Upload archive artifact uses: actions/upload-artifact@v4 with: @@ -78,29 +90,73 @@ jobs: retention-days: 2 browser-rln-wasm: - name: Browser build (RLN WASM) + name: Browser build runs-on: ubuntu-latest + strategy: + matrix: + feature: + - "default" + - "parallel" steps: - name: Checkout sources uses: actions/checkout@v4 - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + - name: Install nightly toolchain + uses: dtolnay/rust-toolchain@nightly + with: + targets: wasm32-unknown-unknown + components: rust-src - uses: Swatinem/rust-cache@v2 + with: + key: wasm-${{ matrix.feature }} - name: Install dependencies run: make installdeps - - name: cross make build + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install binaryen run: | - cross make build - mkdir release - cp pkg/** release/ - tar -czvf browser-rln-wasm.tar.gz release/ - working-directory: rln-wasm + sudo apt-get update + sudo apt-get install -y binaryen + - name: Build wasm package + run: | + FEATURES="${{ matrix.feature }}" + if [[ "$FEATURES" == *"parallel"* ]]; then + env RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals" \ + rustup run nightly wasm-pack build --release --target web --scope waku \ + --features $FEATURES -Z build-std=panic_abort,std + + wasm-bindgen --target web --split-linked-modules --out-dir ./pkg \ + ./target/wasm32-unknown-unknown/release/rln_wasm.wasm + + find ./pkg/snippets -name "workerHelpers.worker.js" \ + -exec sed -i.bak 's|from '\''\.\.\/\.\.\/\.\.\/'\'';|from "../../../rln_wasm.js";|g' {} \; \ + -exec rm -f {}.bak \; + + find ./pkg/snippets -name "workerHelpers.worker.js" \ + -exec sed -i.bak 's|await initWbg(module, memory);|await initWbg({ module, memory });|g' {} \; \ + -exec rm -f {}.bak \; + else + wasm-pack build --release --target web --scope waku --features $FEATURES + fi + + sed -i.bak 's/rln-wasm/zerokit-rln-wasm/g' pkg/package.json && rm pkg/package.json.bak + + wasm-opt pkg/rln_wasm_bg.wasm -Oz --strip-debug --strip-dwarf \ + --remove-unused-module-elements --vacuum -o pkg/rln_wasm_bg.wasm + + mkdir release + cp -r pkg/* release/ + tar -czvf browser-rln-wasm-${{ matrix.feature }}.tar.gz release/ + working-directory: rln-wasm - name: Upload archive artifact uses: actions/upload-artifact@v4 with: - name: browser-rln-wasm-archive - path: rln-wasm/browser-rln-wasm.tar.gz + name: Browser-${{ matrix.feature }}-rln-wasm-archive + path: rln-wasm/browser-${{ matrix.feature }}-rln-wasm.tar.gz retention-days: 2 prepare-prerelease: @@ -114,7 +170,6 @@ jobs: ref: master - name: Download artifacts uses: actions/download-artifact@v4 - - name: Delete tag uses: dev-drprasad/delete-tag-and-release@v0.2.1 with: @@ -122,7 +177,6 @@ jobs: tag_name: nightly env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create prerelease run: | start_tag=$(gh release list -L 2 --exclude-drafts | grep -v nightly | cut -d$'\t' -f3 | sed -n '1p') @@ -134,7 +188,6 @@ jobs: *-archive/*.tar.gz \ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Delete artifacts uses: geekyeggo/delete-artifact@v5 with: diff --git a/.gitignore b/.gitignore index 0f2b6ea..f81eff8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ rln-cli/database # Generated by Cargo # will have compiled files and executables -debug/ -target/ +/target +/Cargo.lock # Generated by Nix result diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index bd79957..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,2354 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "alloy-rlp" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" -dependencies = [ - "arrayvec", - "bytes", -] - -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstream" -version = "0.6.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" - -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys", -] - -[[package]] -name = "anyhow" -version = "1.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" - -[[package]] -name = "ark-bn254" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" -dependencies = [ - "ark-ec", - "ark-ff 0.5.0", - "ark-r1cs-std", - "ark-std 0.5.0", -] - -[[package]] -name = "ark-crypto-primitives" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" -dependencies = [ - "ahash", - "ark-crypto-primitives-macros", - "ark-ec", - "ark-ff 0.5.0", - "ark-relations", - "ark-serialize 0.5.0", - "ark-snark", - "ark-std 0.5.0", - "blake2", - "derivative", - "digest 0.10.7", - "fnv", - "merlin", - "rayon", - "sha2", -] - -[[package]] -name = "ark-crypto-primitives-macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "ark-ec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-poly", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown", - "itertools 0.13.0", - "num-bigint", - "num-integer", - "num-traits", - "rayon", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" -dependencies = [ - "ark-ff-asm 0.3.0", - "ark-ff-macros 0.3.0", - "ark-serialize 0.3.0", - "ark-std 0.3.0", - "derivative", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.3.3", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.4.1", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" -dependencies = [ - "ark-ff-asm 0.5.0", - "ark-ff-macros 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "arrayvec", - "digest 0.10.7", - "educe", - "itertools 0.13.0", - "num-bigint", - "num-traits", - "paste", - "rayon", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-asm" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" -dependencies = [ - "quote", - "syn 2.0.104", -] - -[[package]] -name = "ark-ff-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" -dependencies = [ - "num-bigint", - "num-traits", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "ark-groth16" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" -dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff 0.5.0", - "ark-poly", - "ark-relations", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "rayon", -] - -[[package]] -name = "ark-poly" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown", - "rayon", -] - -[[package]] -name = "ark-r1cs-std" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" -dependencies = [ - "ark-ec", - "ark-ff 0.5.0", - "ark-relations", - "ark-std 0.5.0", - "educe", - "num-bigint", - "num-integer", - "num-traits", - "tracing", -] - -[[package]] -name = "ark-relations" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" -dependencies = [ - "ark-ff 0.5.0", - "ark-std 0.5.0", - "tracing", - "tracing-subscriber 0.2.25", -] - -[[package]] -name = "ark-serialize" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" -dependencies = [ - "ark-std 0.3.0", - "digest 0.9.0", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-std 0.4.0", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-serialize" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" -dependencies = [ - "ark-serialize-derive", - "ark-std 0.5.0", - "arrayvec", - "digest 0.10.7", - "num-bigint", - "rayon", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "ark-snark" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" -dependencies = [ - "ark-ff 0.5.0", - "ark-relations", - "ark-serialize 0.5.0", - "ark-std 0.5.0", -] - -[[package]] -name = "ark-std" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "ark-std" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" -dependencies = [ - "num-traits", - "rand 0.8.5", - "rayon", -] - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "auto_impl" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" - -[[package]] -name = "byte-slice-cast" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "4.5.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "clap_lex" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" - -[[package]] -name = "color-eyre" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "const_format" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "criterion" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf7af66b0989381bd0be551bd7cc91912a655a58c6918420c9527b1fd8b4679" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "itertools 0.13.0", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "educe" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "enum-ordinalize" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" -dependencies = [ - "enum-ordinalize-derive", -] - -[[package]] -name = "enum-ordinalize-derive" -version = "4.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrlp" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "fastrlp" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.1+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "half" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" -dependencies = [ - "allocator-api2", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.174" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" - -[[package]] -name = "libm" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "memchr" -version = "2.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" - -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" - -[[package]] -name = "oorandom" -version = "11.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" - -[[package]] -name = "owo-colors" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" - -[[package]] -name = "parity-scale-codec" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "const_format", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "rustversion", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pest" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "plotters" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" - -[[package]] -name = "plotters-svg" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro2" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" -dependencies = [ - "bitflags 2.9.1", - "lazy_static", - "num-traits", - "rand 0.9.1", - "rand_chacha 0.9.0", - "rand_xorshift", - "regex-syntax", - "unarray", -] - -[[package]] -name = "prost" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" -dependencies = [ - "anyhow", - "itertools 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.16", -] - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom 0.3.3", -] - -[[package]] -name = "rand_xorshift" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" -dependencies = [ - "rand_core 0.9.3", -] - -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rln" -version = "0.8.0" -dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff 0.5.0", - "ark-groth16", - "ark-poly", - "ark-relations", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "byteorder", - "cfg-if", - "criterion", - "document-features", - "lazy_static", - "num-bigint", - "num-traits", - "once_cell", - "prost", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rayon", - "ruint", - "serde", - "serde_json", - "thiserror", - "tiny-keccak", - "zeroize", - "zerokit_utils", -] - -[[package]] -name = "rln-cli" -version = "0.4.0" -dependencies = [ - "clap", - "color-eyre", - "rln", - "serde", - "serde_json", - "zerokit_utils", -] - -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rustc-hex", -] - -[[package]] -name = "ruint" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11256b5fe8c68f56ac6f39ef0720e592f33d2367a4782740d9c9142e889c7fb4" -dependencies = [ - "alloy-rlp", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "bytes", - "fastrlp 0.3.1", - "fastrlp 0.4.0", - "num-bigint", - "num-integer", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", - "rand 0.8.5", - "rand 0.9.1", - "rlp", - "ruint-macro", - "serde", - "valuable", - "zeroize", -] - -[[package]] -name = "ruint-macro" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" - -[[package]] -name = "rustc-demangle" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.26", -] - -[[package]] -name = "rustversion" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" - -[[package]] -name = "semver-parser" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" -dependencies = [ - "pest", -] - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "serde_json" -version = "1.0.140" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "sled" -version = "0.34.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" -dependencies = [ - "crc32fast", - "crossbeam-epoch", - "crossbeam-utils", - "fs2", - "fxhash", - "libc", - "log", - "parking_lot", -] - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "thiserror" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "thread_local" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "tracing-core" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" -dependencies = [ - "tracing", - "tracing-subscriber 0.3.19", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "vacp2p_pmtree" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632293f506ca10d412dbe1d427295317b4c794fa9ddfd66fbd2fa971de88c1f6" -dependencies = [ - "rayon", -] - -[[package]] -name = "valuable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.104", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" -dependencies = [ - "memchr", -] - -[[package]] -name = "wit-bindgen-rt" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags 2.9.1", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "zerokit_utils" -version = "0.6.0" -dependencies = [ - "ark-bn254", - "ark-ff 0.5.0", - "criterion", - "hex", - "hex-literal", - "lazy_static", - "num-bigint", - "num-traits", - "rayon", - "serde_json", - "sled", - "thiserror", - "tiny-keccak", - "vacp2p_pmtree", -] diff --git a/README.md b/README.md index fcb41c2..ad1550b 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,6 @@ Zerokit currently focuses on RLN (Rate-Limiting Nullifier) implementation using ## Build and Test -> [!IMPORTANT] -> For WASM support or x32 architecture builds, use version `0.6.1`. The current version has dependency issues for these platforms. WASM support will return in a future release. - ### Install Dependencies ```bash @@ -75,8 +72,8 @@ The execution graph file used by this code has been generated by means of the sa > [!IMPORTANT] > The circom-witnesscalc code fragments have been borrowed instead of depending on this crate, - because its types of input and output data were incompatible with the corresponding zerokit code fragments, - and circom-witnesscalc has some dependencies, which are redundant for our purpose. +> because its types of input and output data were incompatible with the corresponding zerokit code fragments, +> and circom-witnesscalc has some dependencies, which are redundant for our purpose. ## Documentation diff --git a/flake.nix b/flake.nix index ea61f17..2cfa7fa 100644 --- a/flake.nix +++ b/flake.nix @@ -31,9 +31,7 @@ buildPackage = pkgs.callPackage ./nix/default.nix; buildRln = (buildPackage { src = self; project = "rln"; }).override; in rec { - rln = buildRln { - features = "arkzkey"; - }; + rln = buildRln rln-linux-arm64 = buildRln { target-platform = "aarch64-multiplatform"; diff --git a/nix/default.nix b/nix/default.nix index 4c4acc0..a3081ca 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,7 +4,6 @@ project, src ? ../., release ? true, - features ? "arkzkey", target-platform ? null, rust-target ? null, }: diff --git a/rln-cli/Cargo.toml b/rln-cli/Cargo.toml index fd0d59a..6a3e1fd 100644 --- a/rln-cli/Cargo.toml +++ b/rln-cli/Cargo.toml @@ -17,10 +17,9 @@ rln = { path = "../rln", version = "0.8.0", default-features = true } zerokit_utils = { path = "../utils", version = "0.6.0", default-features = false } clap = { version = "4.5.41", features = ["cargo", "derive", "env"] } color-eyre = "0.6.5" -serde_json = "1.0" +serde_json = "1.0.141" serde = { version = "1.0", features = ["derive"] } [features] default = [] -arkzkey = ["rln/arkzkey"] stateless = ["rln/stateless"] diff --git a/rln-cli/README.md b/rln-cli/README.md index fbe1105..6a6a7d3 100644 --- a/rln-cli/README.md +++ b/rln-cli/README.md @@ -27,16 +27,6 @@ If the configuration file is empty, default settings will be used, but the tree We recommend using the example config, as all commands (except `new` and `create-with-params`) require an initialized RLN instance. -## Feature Flags - -The CLI supports optional features. To enable the **arkzkey** feature, run: - -```bash -cargo run --features arkzkey -- [OPTIONS] -``` - -For more details, refer to the [Zerokit RLN Module](../rln/README.md) documentation. - ## Relay Example The following [Example](src/examples/relay.rs) demonstrates how RLN enables spam prevention in anonymous environments for multple users. @@ -47,12 +37,6 @@ You can run the example using the following command: cargo run --example relay ``` -or with the **arkzkey** feature flag: - -```bash -cargo run --example relay --features arkzkey -``` - You can also change **MESSAGE_LIMIT** and **TREEE_HEIGHT** in the [relay.rs](src/examples/relay.rs) file to see how the RLN instance behaves with different parameters. The customize **TREEE_HEIGHT** constant differs from the default value of `20` should follow [Custom Circuit Compilation](../rln/README.md#advanced-custom-circuit-compilation) instructions. @@ -69,12 +53,6 @@ You can run the example using the following command: cargo run --example stateless --features stateless ``` -or with the **arkzkey** feature flag: - -```bash -cargo run --example stateless --features stateless,arkzkey -``` - ## CLI Commands ### Instance Management diff --git a/rln-cli/src/examples/relay.rs b/rln-cli/src/examples/relay.rs index 46a0923..925dc7e 100644 --- a/rln-cli/src/examples/relay.rs +++ b/rln-cli/src/examples/relay.rs @@ -69,10 +69,7 @@ impl RLNSystem { fn new() -> Result { let mut resources: Vec> = Vec::new(); let resources_path: PathBuf = format!("../rln/resources/tree_height_{TREEE_HEIGHT}").into(); - #[cfg(feature = "arkzkey")] let filenames = ["rln_final.arkzkey", "graph.bin"]; - #[cfg(not(feature = "arkzkey"))] - let filenames = ["rln_final.zkey", "graph.bin"]; for filename in filenames { let fullpath = resources_path.join(Path::new(filename)); let mut file = File::open(&fullpath)?; diff --git a/rln-cli/src/main.rs b/rln-cli/src/main.rs index 0d2a546..dd4d551 100644 --- a/rln-cli/src/main.rs +++ b/rln-cli/src/main.rs @@ -51,10 +51,7 @@ fn main() -> Result<()> { resources_path, }) => { let mut resources: Vec> = Vec::new(); - #[cfg(feature = "arkzkey")] let filenames = ["rln_final.arkzkey", "graph.bin"]; - #[cfg(not(feature = "arkzkey"))] - let filenames = ["rln_final.zkey", "graph.bin"]; for filename in filenames { let fullpath = resources_path.join(Path::new(filename)); let mut file = File::open(&fullpath)?; diff --git a/rln-wasm/Cargo.toml b/rln-wasm/Cargo.toml index aace111..1cc2ecc 100644 --- a/rln-wasm/Cargo.toml +++ b/rln-wasm/Cargo.toml @@ -10,6 +10,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] rln = { path = "../rln", version = "0.8.0", default-features = false, features = [ "stateless", + "fullmerkletree", ] } zerokit_utils = { path = "../utils", version = "0.6.0", default-features = false } num-bigint = { version = "0.4.6", default-features = false } @@ -28,7 +29,7 @@ console_error_panic_hook = { version = "0.1.7", optional = true } getrandom = { version = "0.2.16", features = ["js"] } [dev-dependencies] -serde_json = "1.0" +serde_json = "1.0.141" wasm-bindgen-test = "0.3.50" wasm-bindgen-futures = "0.4.50" @@ -38,7 +39,6 @@ features = ["Window", "Navigator"] [features] default = ["console_error_panic_hook"] -arkzkey = ["rln/arkzkey"] parallel = ["rln/parallel", "wasm-bindgen-rayon"] [package.metadata.docs.rs] diff --git a/rln-wasm/Makefile.toml b/rln-wasm/Makefile.toml index 567bd1f..10b9467 100644 --- a/rln-wasm/Makefile.toml +++ b/rln-wasm/Makefile.toml @@ -2,10 +2,6 @@ clear = true dependencies = ["pack_build", "pack_rename", "pack_resize"] -[tasks.build_arkzkey] -clear = true -dependencies = ["pack_build_arkzkey", "pack_rename", "pack_resize"] - [tasks.build_parallel] clear = true dependencies = [ @@ -15,32 +11,10 @@ dependencies = [ "pack_resize", ] -[tasks.build_parallel_arkzkey] -clear = true -dependencies = [ - "pack_build_parallel_arkzkey", - "post_build_parallel", - "pack_rename", - "pack_resize", -] - [tasks.pack_build] command = "wasm-pack" args = ["build", "--release", "--target", "web", "--scope", "waku"] -[tasks.pack_build_arkzkey] -command = "wasm-pack" -args = [ - "build", - "--release", - "--target", - "web", - "--scope", - "waku", - "--features", - "arkzkey", -] - [tasks.pack_build_parallel] command = "env" args = [ @@ -61,26 +35,6 @@ args = [ "build-std=panic_abort,std", ] -[tasks.pack_build_parallel_arkzkey] -command = "env" -args = [ - "RUSTFLAGS=-C target-feature=+atomics,+bulk-memory,+mutable-globals", - "rustup", - "run", - "nightly", - "wasm-pack", - "build", - "--release", - "--target", - "web", - "--scope", - "waku", - "--features", - "parallel,arkzkey", - "-Z", - "build-std=panic_abort,std", -] - [tasks.post_build_parallel] script = ''' wasm-bindgen --target web --split-linked-modules --out-dir ./pkg ./target/wasm32-unknown-unknown/release/rln_wasm.wasm && \ @@ -117,21 +71,6 @@ args = [ ] dependencies = ["build"] -[tasks.test_arkzkey] -command = "wasm-pack" -args = [ - "test", - "--release", - "--node", - "--target", - "wasm32-unknown-unknown", - "--features", - "arkzkey", - "--", - "--nocapture", -] -dependencies = ["build_arkzkey"] - [tasks.test_browser] command = "wasm-pack" args = [ @@ -148,24 +87,6 @@ args = [ ] dependencies = ["build"] -[tasks.test_browser_arkzkey] -command = "wasm-pack" -args = [ - "test", - "--release", - "--chrome", - # "--firefox", - # "--safari", - "--headless", - "--target", - "wasm32-unknown-unknown", - "--features", - "arkzkey", - "--", - "--nocapture", -] -dependencies = ["build_arkzkey"] - [tasks.test_parallel] command = "env" args = [ @@ -191,31 +112,6 @@ args = [ ] dependencies = ["build_parallel"] -[tasks.test_parallel_arkzkey] -command = "env" -args = [ - "RUSTFLAGS=-C target-feature=+atomics,+bulk-memory,+mutable-globals", - "rustup", - "run", - "nightly", - "wasm-pack", - "test", - "--release", - "--chrome", - # "--firefox", - # "--safari", - "--headless", - "--target", - "wasm32-unknown-unknown", - "--features", - "parallel,arkzkey", - "-Z", - "build-std=panic_abort,std", - "--", - "--nocapture", -] -dependencies = ["build_parallel_arkzkey"] - [tasks.bench] disabled = true diff --git a/rln-wasm/README.md b/rln-wasm/README.md index d8ce75b..2607644 100644 --- a/rln-wasm/README.md +++ b/rln-wasm/README.md @@ -72,29 +72,16 @@ Compile zerokit for `wasm32-unknown-unknown`: cargo make build ``` -Or compile with the **arkzkey** feature enabled - -```bash -cargo make build_arkzkey -``` - ## Running tests and benchmarks ```bash cargo make test ``` -Or test with the **arkzkey** feature enabled - -```bash -cargo make test_arkzkey -``` - If you want to run the tests in browser headless mode, you can use the following command: ```bash cargo make test_browser -cargo make test_browser_arkzkey ``` ## Parallel computation @@ -128,12 +115,6 @@ To enable parallel computation for WebAssembly threads, you can use the followin cargo make build_parallel ``` -Or with the **arkzkey** feature enabled: - -```bash -cargo make build_parallel_arkzkey -``` - ### WebAssembly Threading Support Most modern browsers support WebAssembly threads, diff --git a/rln-wasm/tests/browser.rs b/rln-wasm/tests/browser.rs index 6c209f2..4e6369e 100644 --- a/rln-wasm/tests/browser.rs +++ b/rln-wasm/tests/browser.rs @@ -64,11 +64,8 @@ mod tests { const WITNESS_CALCULATOR_JS: &str = include_str!("../resources/witness_calculator_browser.js"); - #[cfg(feature = "arkzkey")] - const ZKEY_BYTES: &[u8] = + const ARKZKEY_BYTES: &[u8] = include_bytes!("../../rln/resources/tree_height_20/rln_final.arkzkey"); - #[cfg(not(feature = "arkzkey"))] - const ZKEY_BYTES: &[u8] = include_bytes!("../../rln/resources/tree_height_20/rln_final.zkey"); const CIRCOM_BYTES: &[u8] = include_bytes!("../../rln/resources/tree_height_20/rln.wasm"); @@ -98,7 +95,7 @@ mod tests { let mut results = String::from("\nbenchmarks:\n"); let iterations = 10; - let zkey = readFile(&ZKEY_BYTES).expect("Failed to read zkey file"); + let zkey = readFile(&ARKZKEY_BYTES).expect("Failed to read zkey file"); // Benchmark wasm_new let start_wasm_new = Date::now(); diff --git a/rln-wasm/tests/node.rs b/rln-wasm/tests/node.rs index 2c8386a..8ddfdb0 100644 --- a/rln-wasm/tests/node.rs +++ b/rln-wasm/tests/node.rs @@ -51,10 +51,7 @@ mod tests { async fn calculateWitness(circom_path: &str, input: Object) -> Result; } - #[cfg(feature = "arkzkey")] - const ZKEY_PATH: &str = "../rln/resources/tree_height_20/rln_final.arkzkey"; - #[cfg(not(feature = "arkzkey"))] - const ZKEY_PATH: &str = "../rln/resources/tree_height_20/rln_final.zkey"; + const ARKZKEY_PATH: &str = "../rln/resources/tree_height_20/rln_final.arkzkey"; const CIRCOM_PATH: &str = "../rln/resources/tree_height_20/rln.wasm"; @@ -63,7 +60,7 @@ mod tests { let mut results = String::from("\nbenchmarks:\n"); let iterations = 10; - let zkey = readFile(&ZKEY_PATH).expect("Failed to read zkey file"); + let zkey = readFile(&ARKZKEY_PATH).expect("Failed to read zkey file"); // Benchmark wasm_new let start_wasm_new = Date::now(); diff --git a/rln/Cargo.toml b/rln/Cargo.toml index 2ebefaf..1629638 100644 --- a/rln/Cargo.toml +++ b/rln/Cargo.toml @@ -46,7 +46,7 @@ utils = { package = "zerokit_utils", version = "0.6.0", path = "../utils", defau # serialization prost = "0.14.1" -serde_json = "1.0" +serde_json = "1.0.141" serde = { version = "1.0", features = ["derive"] } document-features = { version = "0.2.11", optional = true } @@ -56,6 +56,7 @@ criterion = { version = "0.6.0", features = ["html_reports"] } [features] default = ["parallel", "pmtree-ft"] +stateless = [] parallel = [ "utils/parallel", "ark-ff/parallel", @@ -66,21 +67,10 @@ parallel = [ "ark-serialize/parallel", ] fullmerkletree = [] -stateless = [] -arkzkey = [] - +optimalmerkletree = [] # Note: pmtree feature is still experimental pmtree-ft = ["utils/pmtree-ft"] -[[bench]] -name = "circuit_loading_arkzkey_benchmark" -harness = false -required-features = ["arkzkey"] - -[[bench]] -name = "circuit_loading_benchmark" -harness = false - [[bench]] name = "pmtree_benchmark" harness = false diff --git a/rln/Makefile.toml b/rln/Makefile.toml index 22bfdaf..f0b0f5f 100644 --- a/rln/Makefile.toml +++ b/rln/Makefile.toml @@ -10,10 +10,6 @@ args = ["test", "--release", "--", "--nocapture"] command = "cargo" args = ["test", "--release", "--features", "stateless"] -[tasks.test_arkzkey] -command = "cargo" -args = ["test", "--release", "--features", "arkzkey"] - [tasks.bench] command = "cargo" args = ["bench"] diff --git a/rln/README.md b/rln/README.md index 6ff121c..a38b27a 100644 --- a/rln/README.md +++ b/rln/README.md @@ -31,9 +31,8 @@ rln = { git = "https://github.com/vacp2p/zerokit" } The RLN object constructor requires the following files: +- `rln_final.arkzkey`: The proving key in arkzkey format. - `graph.bin`: The graph file built for the input tree size -- `rln_final.zkey` or `rln_final_uncompr.arkzkey`: The proving key -- `verification_key.arkvkey`: The verification key (optional) Additionally, `rln.wasm` is used for testing in the rln-wasm module. @@ -86,7 +85,7 @@ fn main() { let signal = b"RLN is awesome"; // 6. Prepare input for generate_rln_proof API - // input_data is [ identity_secret<32> | id_index<8> | external_nullifier<32> + // input_data is [ identity_secret<32> | id_index<8> | external_nullifier<32> // | user_message_limit<32> | message_id<32> | signal_len<8> | signal ] let prove_input = prepare_prove_input( identity_secret_hash, @@ -105,7 +104,7 @@ fn main() { .unwrap(); // We get the public outputs returned by the circuit evaluation - // The byte vector `proof_data` is serialized as + // The byte vector `proof_data` is serialized as // `[ zk-proof | tree_root | external_nullifier | share_x | share_y | nullifier ]`. let proof_data = output_buffer.into_inner(); @@ -136,13 +135,11 @@ for one application to be re-used in another one. ### Features -- **Multiple Backend Support**: Choose between different zkey formats with feature flags - - `arkzkey`: Use the optimized Arkworks-compatible zkey format (faster loading) - - `stateless`: For stateless proof verification +- **Stateless Mode**: Allows the use of RLN without maintaining state of the Merkle tree. - **Pre-compiled Circuits**: Ready-to-use circuits with Merkle tree depth of 20 - **Wasm Support**: WebAssembly bindings via rln-wasm crate with features like: - Browser and Node.js compatibility - - Optional multi-threading support using wasm-bindgen-rayon + - Optional parallel feature support using [wasm-bindgen-rayon](https://github.com/RReverser/wasm-bindgen-rayon) - Headless browser testing capabilities ## Building and Testing @@ -164,9 +161,8 @@ cargo make build # Test with default features cargo make test -# Test with specific features -cargo make test_arkzkey # For arkzkey feature -cargo make test_stateless # For stateless feature +# Test with stateless features +cargo make test_stateless ``` ## Advanced: Custom Circuit Compilation @@ -175,9 +171,9 @@ The `rln` () repository, which contains the RLN circuit implementation is using for pre-compiled RLN circuit for zerokit RLN. If you want to compile your own RLN circuit, you can follow the instructions below. -### 1. Compile ZK Circuits for getting the zkey and verification key files +### 1. Compile ZK Circuits for getting the zkey file -This script actually generates not only the zkey and verification key files for the RLN circuit, +This script actually generates not only the zkey file for the RLN circuit, but also the execution wasm file used for witness calculation. However, the wasm file is not needed for the `rln` module, because current implementation uses the iden3 graph file for witness calculation. @@ -271,11 +267,11 @@ cargo run --package circom_witnesscalc --bin build-circuit ../circom-rln/circuit The `rln` module comes with [pre-compiled](https://github.com/vacp2p/zerokit/tree/master/rln/resources) execution graph files for the RLN circuit. -### 3. Generate Arkzkey Representation for zkey and verification key files +### 3. Generate Arkzkey Representation for zkey file For faster loading, compile the zkey file into the arkzkey format using [ark-zkey](https://github.com/seemenkina/ark-zkey). -This is fork of the [original](https://github.com/zkmopro/ark-zkey) repository with the uncompressed zkey support. +This is fork of the [original](https://github.com/zkmopro/ark-zkey) repository with the uncompressed arkzkey support. ```sh # Clone the ark-zkey repository @@ -288,9 +284,22 @@ cd ark-zkey && cargo build cargo run --bin arkzkey-util ``` +This will generate the `rln_final.arkzkey` file, which is used by the `rln` module. + Currently, the `rln` module comes with [pre-compiled](https://github.com/vacp2p/zerokit/tree/master/rln/resources) arkzkey keys for the RLN circuit. +> [!NOTE] +> You can use this [convert_zkey.sh](./convert_zkey.sh) script +> to automate the process of generating the arkzkey file from any zkey file + +Run the script as follows: + +```sh +chmod +x ./convert_zkey.sh +./convert_zkey.sh +``` + ## Get involved Zerokit RLN public and FFI APIs allow interaction with many more features than what briefly showcased above. diff --git a/rln/benches/circuit_loading_arkzkey_benchmark.rs b/rln/benches/circuit_loading_arkzkey_benchmark.rs deleted file mode 100644 index f466908..0000000 --- a/rln/benches/circuit_loading_arkzkey_benchmark.rs +++ /dev/null @@ -1,25 +0,0 @@ -use criterion::{criterion_group, criterion_main, Criterion}; -use rln::circuit::{read_arkzkey_from_bytes_uncompressed, ARKZKEY_BYTES}; - -pub fn uncompressed_bench(c: &mut Criterion) { - let arkzkey = ARKZKEY_BYTES.to_vec(); - let size = arkzkey.len() as f32; - println!( - "Size of uncompressed arkzkey: {:.2?} MB", - size / 1024.0 / 1024.0 - ); - - c.bench_function("arkzkey::arkzkey_from_raw_uncompressed", |b| { - b.iter(|| { - let r = read_arkzkey_from_bytes_uncompressed(&arkzkey); - assert!(r.is_ok()); - }) - }); -} - -criterion_group! { - name = benches; - config = Criterion::default().sample_size(10); - targets = uncompressed_bench -} -criterion_main!(benches); diff --git a/rln/benches/circuit_loading_benchmark.rs b/rln/benches/circuit_loading_benchmark.rs deleted file mode 100644 index 69276d5..0000000 --- a/rln/benches/circuit_loading_benchmark.rs +++ /dev/null @@ -1,24 +0,0 @@ -use criterion::{criterion_group, criterion_main, Criterion}; -use rln::circuit::zkey::read_zkey; -use std::io::Cursor; - -pub fn zkey_load_benchmark(c: &mut Criterion) { - let zkey = rln::circuit::ZKEY_BYTES.to_vec(); - let size = zkey.len() as f32; - println!("Size of zkey: {:.2?} MB", size / 1024.0 / 1024.0); - - c.bench_function("zkey::zkey_from_raw", |b| { - b.iter(|| { - let mut reader = Cursor::new(zkey.clone()); - let r = read_zkey(&mut reader); - assert!(r.is_ok()); - }) - }); -} - -criterion_group! { - name = benches; - config = Criterion::default().sample_size(10); - targets = zkey_load_benchmark -} -criterion_main!(benches); diff --git a/rln/convert_zkey.sh b/rln/convert_zkey.sh new file mode 100755 index 0000000..69c50ae --- /dev/null +++ b/rln/convert_zkey.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Convert zkey to arkzkey using /tmp directory +# Usage: ./convert.sh + +set -e + +# Check input +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +ZKEY_FILE="$1" + +if [ ! -f "$ZKEY_FILE" ]; then + echo "Error: File '$ZKEY_FILE' does not exist" + exit 1 +fi + +# Get absolute path before changing directories +ZKEY_ABSOLUTE_PATH=$(realpath "$ZKEY_FILE") + +# Create temp directory in /tmp +TEMP_DIR="/tmp/ark-zkey-$$" +echo "Using temp directory: $TEMP_DIR" + +# Cleanup function +cleanup() { + echo "Cleaning up temp directory: $TEMP_DIR" + rm -rf "$TEMP_DIR" +} + +# Setup cleanup trap +trap cleanup EXIT + +# Create temp directory and clone ark-zkey +mkdir -p "$TEMP_DIR" +cd "$TEMP_DIR" +git clone https://github.com/seemenkina/ark-zkey.git +cd ark-zkey +cargo build + +# Convert +cargo run --bin arkzkey-util "$ZKEY_ABSOLUTE_PATH" + +# Check if arkzkey file was created (tool creates it in same directory as input) +ARKZKEY_FILE="${ZKEY_ABSOLUTE_PATH%.zkey}.arkzkey" + +if [ ! -f "$ARKZKEY_FILE" ]; then + echo "Could not find generated .arkzkey file at $ARKZKEY_FILE" + exit 1 +fi \ No newline at end of file diff --git a/rln/resources/tree_height_20/rln_final.zkey b/rln/resources/tree_height_20/rln_final.zkey deleted file mode 100644 index 46489a1..0000000 Binary files a/rln/resources/tree_height_20/rln_final.zkey and /dev/null differ diff --git a/rln/src/circuit/mod.rs b/rln/src/circuit/mod.rs index 5d41dc2..cd5c62b 100644 --- a/rln/src/circuit/mod.rs +++ b/rln/src/circuit/mod.rs @@ -3,7 +3,6 @@ pub mod error; pub mod iden3calc; pub mod qap; -pub mod zkey; use ::lazy_static::lazy_static; use ark_bn254::{ @@ -12,37 +11,22 @@ use ark_bn254::{ }; use ark_groth16::ProvingKey; use ark_relations::r1cs::ConstraintMatrices; -use cfg_if::cfg_if; use crate::circuit::error::ZKeyReadError; use crate::circuit::iden3calc::calc_witness; -#[cfg(feature = "arkzkey")] use {ark_ff::Field, ark_serialize::CanonicalDeserialize, ark_serialize::CanonicalSerialize}; use crate::utils::FrOrSecret; -#[cfg(not(feature = "arkzkey"))] -use {crate::circuit::zkey::read_zkey, std::io::Cursor}; -#[cfg(feature = "arkzkey")] pub const ARKZKEY_BYTES: &[u8] = include_bytes!("../../resources/tree_height_20/rln_final.arkzkey"); -pub const ZKEY_BYTES: &[u8] = include_bytes!("../../resources/tree_height_20/rln_final.zkey"); - #[cfg(not(target_arch = "wasm32"))] const GRAPH_BYTES: &[u8] = include_bytes!("../../resources/tree_height_20/graph.bin"); lazy_static! { - static ref ZKEY: (ProvingKey, ConstraintMatrices) = { - cfg_if! { - if #[cfg(feature = "arkzkey")] { - read_arkzkey_from_bytes_uncompressed(ARKZKEY_BYTES).expect("Failed to read arkzkey") - } else { - let mut reader = Cursor::new(ZKEY_BYTES); - read_zkey(&mut reader).expect("Failed to read zkey") - } - } - }; + static ref ARKZKEY: (ProvingKey, ConstraintMatrices) = + read_arkzkey_from_bytes_uncompressed(ARKZKEY_BYTES).expect("Failed to read arkzkey"); } pub const TEST_TREE_HEIGHT: usize = 20; @@ -66,15 +50,7 @@ pub fn zkey_from_raw( return Err(ZKeyReadError::EmptyBytes); } - let proving_key_and_matrices = match () { - #[cfg(feature = "arkzkey")] - () => read_arkzkey_from_bytes_uncompressed(zkey_data)?, - #[cfg(not(feature = "arkzkey"))] - () => { - let mut reader = Cursor::new(zkey_data); - read_zkey(&mut reader)? - } - }; + let proving_key_and_matrices = read_arkzkey_from_bytes_uncompressed(zkey_data)?; Ok(proving_key_and_matrices) } @@ -82,7 +58,7 @@ pub fn zkey_from_raw( // Loads the proving key #[cfg(not(target_arch = "wasm32"))] pub fn zkey_from_folder() -> &'static (ProvingKey, ConstraintMatrices) { - &ZKEY + &ARKZKEY } pub fn calculate_rln_witness)>>( @@ -102,11 +78,9 @@ pub fn graph_from_folder() -> &'static [u8] { // without print and allow to choose between compressed and uncompressed arkzkey //////////////////////////////////////////////////////// -#[cfg(feature = "arkzkey")] #[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug, PartialEq)] pub struct SerializableProvingKey(pub ProvingKey); -#[cfg(feature = "arkzkey")] #[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug, PartialEq)] pub struct SerializableConstraintMatrices { pub num_instance_variables: usize, @@ -120,13 +94,11 @@ pub struct SerializableConstraintMatrices { pub c: SerializableMatrix, } -#[cfg(feature = "arkzkey")] #[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug, PartialEq)] pub struct SerializableMatrix { pub data: Vec>, } -#[cfg(feature = "arkzkey")] pub fn read_arkzkey_from_bytes_uncompressed( arkzkey_data: &[u8], ) -> Result<(ProvingKey, ConstraintMatrices), ZKeyReadError> { diff --git a/rln/src/circuit/zkey.rs b/rln/src/circuit/zkey.rs deleted file mode 100644 index 6de17d7..0000000 --- a/rln/src/circuit/zkey.rs +++ /dev/null @@ -1,371 +0,0 @@ -// This file is based on the code by arkworks. Its preimage can be found here: -// https://github.com/arkworks-rs/circom-compat/blob/3c95ed98e23a408b4d99a53e483a9bba39685a4e/src/zkey.rs - -//! ZKey Parsing -//! -//! Each ZKey file is broken into sections: -//! Header(1) -//! Prover Type 1 Groth -//! HeaderGroth(2) -//! n8q -//! q -//! n8r -//! r -//! NVars -//! NPub -//! DomainSize (multiple of 2 -//! alpha1 -//! beta1 -//! delta1 -//! beta2 -//! gamma2 -//! delta2 -//! IC(3) -//! Coefs(4) -//! PointsA(5) -//! PointsB1(6) -//! PointsB2(7) -//! PointsC(8) -//! PointsH(9) -//! Contributions(10) -use ark_ff::{BigInteger256, PrimeField}; -use ark_relations::r1cs::ConstraintMatrices; -use ark_serialize::{CanonicalDeserialize, SerializationError}; -use ark_std::log2; -use byteorder::{LittleEndian, ReadBytesExt}; - -use std::{ - collections::HashMap, - io::{Read, Seek, SeekFrom}, -}; - -use ark_bn254::{Bn254, Fq, Fq2, Fr, G1Affine, G2Affine}; -use ark_groth16::{ProvingKey, VerifyingKey}; -use num_traits::Zero; - -type IoResult = Result; - -#[derive(Clone, Debug)] -struct Section { - position: u64, - #[allow(dead_code)] - size: usize, -} - -/// Reads a SnarkJS ZKey file into an Arkworks ProvingKey. -pub fn read_zkey( - reader: &mut R, -) -> IoResult<(ProvingKey, ConstraintMatrices)> { - let mut binfile = BinFile::new(reader)?; - let proving_key = binfile.proving_key()?; - let matrices = binfile.matrices()?; - Ok((proving_key, matrices)) -} - -#[derive(Debug)] -struct BinFile<'a, R> { - #[allow(dead_code)] - ftype: String, - #[allow(dead_code)] - version: u32, - sections: HashMap>, - reader: &'a mut R, -} - -impl<'a, R: Read + Seek> BinFile<'a, R> { - fn new(reader: &'a mut R) -> IoResult { - let mut magic = [0u8; 4]; - reader.read_exact(&mut magic)?; - - let version = reader.read_u32::()?; - - let num_sections = reader.read_u32::()?; - - let mut sections = HashMap::new(); - for _ in 0..num_sections { - let section_id = reader.read_u32::()?; - let section_length = reader.read_u64::()?; - - let section = sections.entry(section_id).or_insert_with(Vec::new); - section.push(Section { - position: reader.stream_position()?, - size: section_length as usize, - }); - - reader.seek(SeekFrom::Current(section_length as i64))?; - } - - Ok(Self { - ftype: std::str::from_utf8(&magic[..]).unwrap().to_string(), - version, - sections, - reader, - }) - } - - fn proving_key(&mut self) -> IoResult> { - let header = self.groth_header()?; - let ic = self.ic(header.n_public)?; - - let a_query = self.a_query(header.n_vars)?; - let b_g1_query = self.b_g1_query(header.n_vars)?; - let b_g2_query = self.b_g2_query(header.n_vars)?; - let l_query = self.l_query(header.n_vars - header.n_public - 1)?; - let h_query = self.h_query(header.domain_size as usize)?; - - let vk = VerifyingKey:: { - alpha_g1: header.verifying_key.alpha_g1, - beta_g2: header.verifying_key.beta_g2, - gamma_g2: header.verifying_key.gamma_g2, - delta_g2: header.verifying_key.delta_g2, - gamma_abc_g1: ic, - }; - - let pk = ProvingKey:: { - vk, - beta_g1: header.verifying_key.beta_g1, - delta_g1: header.verifying_key.delta_g1, - a_query, - b_g1_query, - b_g2_query, - h_query, - l_query, - }; - - Ok(pk) - } - - fn get_section(&self, id: u32) -> Section { - self.sections.get(&id).unwrap()[0].clone() - } - - fn groth_header(&mut self) -> IoResult { - let section = self.get_section(2); - let header = HeaderGroth::new(&mut self.reader, §ion)?; - Ok(header) - } - - fn ic(&mut self, n_public: usize) -> IoResult> { - // the range is non-inclusive so we do +1 to get all inputs - self.g1_section(n_public + 1, 3) - } - - /// Returns the [`ConstraintMatrices`] corresponding to the zkey - pub fn matrices(&mut self) -> IoResult> { - let header = self.groth_header()?; - - let section = self.get_section(4); - self.reader.seek(SeekFrom::Start(section.position))?; - let num_coeffs: u32 = self.reader.read_u32::()?; - - // insantiate AB - let mut matrices = vec![vec![vec![]; header.domain_size as usize]; 2]; - let mut max_constraint_index = 0; - for _ in 0..num_coeffs { - let matrix: u32 = self.reader.read_u32::()?; - let constraint: u32 = self.reader.read_u32::()?; - let signal: u32 = self.reader.read_u32::()?; - - let value: Fr = deserialize_field_fr(&mut self.reader)?; - max_constraint_index = std::cmp::max(max_constraint_index, constraint); - matrices[matrix as usize][constraint as usize].push((value, signal as usize)); - } - - let num_constraints = max_constraint_index as usize - header.n_public; - // Remove the public input constraints, Arkworks adds them later - matrices.iter_mut().for_each(|m| { - m.truncate(num_constraints); - }); - // This is taken from Arkworks' to_matrices() function - let a = matrices[0].clone(); - let b = matrices[1].clone(); - let a_num_non_zero: usize = a.iter().map(|lc| lc.len()).sum(); - let b_num_non_zero: usize = b.iter().map(|lc| lc.len()).sum(); - let matrices = ConstraintMatrices { - num_instance_variables: header.n_public + 1, - num_witness_variables: header.n_vars - header.n_public, - num_constraints, - - a_num_non_zero, - b_num_non_zero, - c_num_non_zero: 0, - - a, - b, - c: vec![], - }; - - Ok(matrices) - } - - fn a_query(&mut self, n_vars: usize) -> IoResult> { - self.g1_section(n_vars, 5) - } - - fn b_g1_query(&mut self, n_vars: usize) -> IoResult> { - self.g1_section(n_vars, 6) - } - - fn b_g2_query(&mut self, n_vars: usize) -> IoResult> { - self.g2_section(n_vars, 7) - } - - fn l_query(&mut self, n_vars: usize) -> IoResult> { - self.g1_section(n_vars, 8) - } - - fn h_query(&mut self, n_vars: usize) -> IoResult> { - self.g1_section(n_vars, 9) - } - - fn g1_section(&mut self, num: usize, section_id: usize) -> IoResult> { - let section = self.get_section(section_id as u32); - self.reader.seek(SeekFrom::Start(section.position))?; - deserialize_g1_vec(self.reader, num as u32) - } - - fn g2_section(&mut self, num: usize, section_id: usize) -> IoResult> { - let section = self.get_section(section_id as u32); - self.reader.seek(SeekFrom::Start(section.position))?; - deserialize_g2_vec(self.reader, num as u32) - } -} - -#[derive(Default, Clone, Debug, CanonicalDeserialize)] -pub struct ZVerifyingKey { - alpha_g1: G1Affine, - beta_g1: G1Affine, - beta_g2: G2Affine, - gamma_g2: G2Affine, - delta_g1: G1Affine, - delta_g2: G2Affine, -} - -impl ZVerifyingKey { - fn new(reader: &mut R) -> IoResult { - let alpha_g1 = deserialize_g1(reader)?; - let beta_g1 = deserialize_g1(reader)?; - let beta_g2 = deserialize_g2(reader)?; - let gamma_g2 = deserialize_g2(reader)?; - let delta_g1 = deserialize_g1(reader)?; - let delta_g2 = deserialize_g2(reader)?; - - Ok(Self { - alpha_g1, - beta_g1, - beta_g2, - gamma_g2, - delta_g1, - delta_g2, - }) - } -} - -#[derive(Clone, Debug)] -struct HeaderGroth { - #[allow(dead_code)] - n8q: u32, - #[allow(dead_code)] - q: BigInteger256, - #[allow(dead_code)] - n8r: u32, - #[allow(dead_code)] - r: BigInteger256, - - n_vars: usize, - n_public: usize, - - domain_size: u32, - #[allow(dead_code)] - power: u32, - - verifying_key: ZVerifyingKey, -} - -impl HeaderGroth { - fn new(reader: &mut R, section: &Section) -> IoResult { - reader.seek(SeekFrom::Start(section.position))?; - Self::read(reader) - } - - fn read(mut reader: &mut R) -> IoResult { - // TODO: Impl From in Arkworks - let n8q: u32 = u32::deserialize_uncompressed(&mut reader)?; - // group order r of Bn254 - let q = BigInteger256::deserialize_uncompressed(&mut reader)?; - - let n8r: u32 = u32::deserialize_uncompressed(&mut reader)?; - // Prime field modulus - let r = BigInteger256::deserialize_uncompressed(&mut reader)?; - - let n_vars = u32::deserialize_uncompressed(&mut reader)? as usize; - let n_public = u32::deserialize_uncompressed(&mut reader)? as usize; - - let domain_size: u32 = u32::deserialize_uncompressed(&mut reader)?; - let power = log2(domain_size as usize); - - let verifying_key = ZVerifyingKey::new(&mut reader)?; - - Ok(Self { - n8q, - q, - n8r, - r, - n_vars, - n_public, - domain_size, - power, - verifying_key, - }) - } -} - -// need to divide by R, since snarkjs outputs the zkey with coefficients -// multiplieid by R^2 -fn deserialize_field_fr(reader: &mut R) -> IoResult { - let bigint = BigInteger256::deserialize_uncompressed(reader)?; - Ok(Fr::new_unchecked(Fr::new_unchecked(bigint).into_bigint())) -} - -// skips the multiplication by R because Circom points are already in Montgomery form -fn deserialize_field(reader: &mut R) -> IoResult { - let bigint = BigInteger256::deserialize_uncompressed(reader)?; - // if you use Fq::new it multiplies by R - Ok(Fq::new_unchecked(bigint)) -} - -pub fn deserialize_field2(reader: &mut R) -> IoResult { - let c0 = deserialize_field(reader)?; - let c1 = deserialize_field(reader)?; - Ok(Fq2::new(c0, c1)) -} - -fn deserialize_g1(reader: &mut R) -> IoResult { - let x = deserialize_field(reader)?; - let y = deserialize_field(reader)?; - let infinity = x.is_zero() && y.is_zero(); - if infinity { - Ok(G1Affine::identity()) - } else { - Ok(G1Affine::new(x, y)) - } -} - -fn deserialize_g2(reader: &mut R) -> IoResult { - let f1 = deserialize_field2(reader)?; - let f2 = deserialize_field2(reader)?; - let infinity = f1.is_zero() && f2.is_zero(); - if infinity { - Ok(G2Affine::identity()) - } else { - Ok(G2Affine::new(f1, f2)) - } -} - -fn deserialize_g1_vec(reader: &mut R, n_vars: u32) -> IoResult> { - (0..n_vars).map(|_| deserialize_g1(reader)).collect() -} - -fn deserialize_g2_vec(reader: &mut R, n_vars: u32) -> IoResult> { - (0..n_vars).map(|_| deserialize_g2(reader)).collect() -} diff --git a/rln/src/poseidon_tree.rs b/rln/src/poseidon_tree.rs index 4b9a652..b9772b2 100644 --- a/rln/src/poseidon_tree.rs +++ b/rln/src/poseidon_tree.rs @@ -4,34 +4,26 @@ use cfg_if::cfg_if; -// The zerokit RLN default Merkle tree implementation is the OptimalMerkleTree. -// To switch to FullMerkleTree implementation, it is enough to enable the fullmerkletree feature +// The zerokit RLN default Merkle tree implementation is the PMTree from the vacp2p_pmtree crate +// To switch to FullMerkleTree or OptimalMerkleTree, enable the corresponding feature in the Cargo.toml file cfg_if! { if #[cfg(feature = "fullmerkletree")] { - - use utils::{ - FullMerkleTree, - FullMerkleProof, - }; + use utils::{FullMerkleTree, FullMerkleProof}; use crate::hashers::PoseidonHash; pub type PoseidonTree = FullMerkleTree; pub type MerkleProof = FullMerkleProof; - } else if #[cfg(feature = "pmtree-ft")] { - use crate::pm_tree_adapter::{PmTree, PmTreeProof}; - - pub type PoseidonTree = PmTree; - pub type MerkleProof = PmTreeProof; - } else { - - use crate::hashers::{PoseidonHash}; - use utils::{ - OptimalMerkleTree, - OptimalMerkleProof, - }; + } else if #[cfg(feature = "optimalmerkletree")] { + use utils::{OptimalMerkleTree, OptimalMerkleProof}; + use crate::hashers::PoseidonHash; pub type PoseidonTree = OptimalMerkleTree; pub type MerkleProof = OptimalMerkleProof; + } else { + use crate::pm_tree_adapter::{PmTree, PmTreeProof}; + + pub type PoseidonTree = PmTree; + pub type MerkleProof = PmTreeProof; } } diff --git a/rln/src/public.rs b/rln/src/public.rs index acb6bc4..7ea276e 100644 --- a/rln/src/public.rs +++ b/rln/src/public.rs @@ -135,7 +135,7 @@ impl RLN { /// /// Input parameters are /// - `tree_height`: the height of the internal Merkle tree - /// - `zkey_vec`: a byte vector containing to the proving key (`rln_final.zkey`) or (`rln_final.arkzkey`) as binary file + /// - `zkey_vec`: a byte vector containing to the proving key (`rln_final.arkzkey`) as binary file /// - `graph_data`: a byte vector containing the graph data (`graph.bin`) as binary file /// - `tree_config_input`: a reader for a string containing a json with the merkle tree configuration /// @@ -148,7 +148,7 @@ impl RLN { /// let resources_folder = "./resources/tree_height_20/"; /// /// let mut resources: Vec> = Vec::new(); - /// for filename in ["rln_final.zkey", "graph.bin"] { + /// for filename in ["rln_final.arkzkey", "graph.bin"] { /// let fullpath = format!("{resources_folder}{filename}"); /// let mut file = File::open(&fullpath).expect("no file found"); /// let metadata = std::fs::metadata(&fullpath).expect("unable to read metadata"); @@ -206,7 +206,7 @@ impl RLN { /// Creates a new stateless RLN object by passing circuit resources as byte vectors. /// /// Input parameters are - /// - `zkey_vec`: a byte vector containing to the proving key (`rln_final.zkey`) or (`rln_final.arkzkey`) as binary file + /// - `zkey_vec`: a byte vector containing to the proving key (`rln_final.arkzkey`) as binary file /// - `graph_data`: a byte vector containing the graph data (`graph.bin`) as binary file /// /// Example: @@ -217,7 +217,7 @@ impl RLN { /// let resources_folder = "./resources/tree_height_20/"; /// /// let mut resources: Vec> = Vec::new(); - /// for filename in ["rln_final.zkey", "graph.bin"] { + /// for filename in ["rln_final.arkzkey", "graph.bin"] { /// let fullpath = format!("{resources_folder}{filename}"); /// let mut file = File::open(&fullpath).expect("no file found"); /// let metadata = std::fs::metadata(&fullpath).expect("unable to read metadata"); @@ -246,14 +246,14 @@ impl RLN { /// Creates a new stateless RLN object by passing circuit resources as a byte vector. /// /// Input parameters are - /// - `zkey_vec`: a byte vector containing the proving key (`rln_final.zkey`) or (`rln_final.arkzkey`) as binary file + /// - `zkey_vec`: a byte vector containing the proving key (`rln_final.arkzkey`) as binary file /// /// Example: /// ``` /// use std::fs::File; /// use std::io::Read; /// - /// let zkey_path = "./resources/tree_height_20/rln_final.zkey"; + /// let zkey_path = "./resources/tree_height_20/rln_final.arkzkey"; /// /// let mut file = File::open(zkey_path).expect("Failed to open file"); /// let metadata = std::fs::metadata(zkey_path).expect("Failed to read metadata"); diff --git a/rln/tests/ffi.rs b/rln/tests/ffi.rs index 662f8d8..8a9d489 100644 --- a/rln/tests/ffi.rs +++ b/rln/tests/ffi.rs @@ -414,10 +414,7 @@ mod test { // We obtain the root from the RLN instance let root_rln_folder = get_tree_root(rln_pointer); - #[cfg(feature = "arkzkey")] let zkey_path = "./resources/tree_height_20/rln_final.arkzkey"; - #[cfg(not(feature = "arkzkey"))] - let zkey_path = "./resources/tree_height_20/rln_final.zkey"; let mut zkey_file = File::open(zkey_path).expect("no file found"); let metadata = std::fs::metadata(zkey_path).expect("unable to read metadata"); let mut zkey_buffer = vec![0; metadata.len() as usize]; diff --git a/utils/Cargo.toml b/utils/Cargo.toml index c6c43c7..ca8d65c 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -16,7 +16,7 @@ ark-ff = { version = "0.5.0", default-features = false } num-bigint = { version = "0.4.6", default-features = false } pmtree = { package = "vacp2p_pmtree", version = "2.0.2", optional = true } sled = "0.34.7" -serde_json = "1.0" +serde_json = "1.0.141" lazy_static = "1.5.0" hex = "0.4.3" rayon = "1.7.0"