From 29c64b340d217f775a7d1cfd1263bb1a7cde2c15 Mon Sep 17 00:00:00 2001 From: Arseniy Klempner Date: Thu, 28 May 2026 10:53:36 -0600 Subject: [PATCH] feat: mix+LEZ+RLN chat over the testnet via 2-phase gifter Chat-side integration of the LEZ-backed RLN mix protocol: - src/chat/delivery/waku_client.nim: mount waku_mix with onchain RLN spam protection wired to logos_core_client fetchers; gate the first publish on (a) gifter status confirmation, (b) cushion of 2 poll intervals after confirmation, and (c) proof root stability in the local valid_roots window; wrap mix lightpush in withTimeout so vanished SURB replies surface as Err instead of pinning the send coroutine. - src/chat/client.nim: surface sendBytes errors via asyncSpawn wrapped try/except instead of discarding the future (was hiding every mix-publish failure). - chat-side gifter client invocation (RLN membership service wire format, EIP-191 ethereum-allowlist auth). - Background membership status watcher that reconciles the optimistic leaf returned by the gifter against the chain's authoritative leaf via the status RPC. Simulation harness (simulations/mix_lez_chat/): - Spin up sequencer + run_setup + 4 mix nodes (one of which runs the gifter service) + chat sender + chat receiver. - SIM_NETWORK={local,testnet}, SIM_SLIM for testnet (reuses shipped config_account + cached payment_account), Docker image + GHCR for cross-platform testing. - Strict mix-pool readiness gate, kademlia + RLN root activity checks, gifter EIP-191 auth fixture, slim-mode submodule minimization. - TREE_ID_HEX pinned to the canonical testnet deployment. Submodule bumps: - vendor/nwaku to 8e6ba04 (LEZ-backed RLN mix + 2-phase gifter). - vendor/logos-lez-rln to 950f287 (SPEL RLN program + mix sim infrastructure + canonical testnet deploy). Docs: - RUN_SLIM_TESTNET.md: slim sim recipe. - cleanup/MODE_A_GIFTER_SLOT_BUG.md: per-signer nonce collision postmortem driving the queue+worker fix. --- .dockerignore | 3 + .github/Dockerfile.sim | 170 + .gitignore | 3 + .gitmodules | 8 +- Makefile | 33 +- RESTORE.md | 66 + RUN_SLIM_TESTNET.md | 29 + cleanup/MODE_A_GIFTER_SLOT_BUG.md | 190 + library/api/client_api.nim | 39 +- library/declare_lib.nim | 38 + library/liblogoschat.h | 36 + nix/default.nix | 36 +- rust-bundle/Cargo.lock | 4052 +---------------- rust-bundle/Cargo.toml | 2 +- scripts/fix_mix_librln_dupes.sh | 41 + scripts/run_in_docker.sh | 127 + simulations/mix_lez_chat/INSTRUCTIONS.md | 77 + simulations/mix_lez_chat/README.md | 229 + .../fixtures/gifter_auth/addresses.env | 6 + .../fixtures/gifter_auth/keys.env | 9 + simulations/mix_lez_chat/run_simulation.sh | 685 +++ simulations/mix_lez_chat/setup_and_run.sh | 108 + src/chat/client.nim | 13 +- src/chat/delivery/waku_client.nim | 431 +- vendor/logos-lez-rln | 1 + vendor/nwaku | 2 +- 26 files changed, 2352 insertions(+), 4082 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/Dockerfile.sim create mode 100644 RESTORE.md create mode 100644 RUN_SLIM_TESTNET.md create mode 100644 cleanup/MODE_A_GIFTER_SLOT_BUG.md create mode 100755 scripts/fix_mix_librln_dupes.sh create mode 100755 scripts/run_in_docker.sh create mode 100644 simulations/mix_lez_chat/INSTRUCTIONS.md create mode 100644 simulations/mix_lez_chat/README.md create mode 100644 simulations/mix_lez_chat/fixtures/gifter_auth/addresses.env create mode 100644 simulations/mix_lez_chat/fixtures/gifter_auth/keys.env create mode 100755 simulations/mix_lez_chat/run_simulation.sh create mode 100755 simulations/mix_lez_chat/setup_and_run.sh create mode 160000 vendor/logos-lez-rln diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fc11a47 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +# Everything — the Dockerfile doesn't COPY from the build context. +# Guest binaries are staged via docker cp separately. +* diff --git a/.github/Dockerfile.sim b/.github/Dockerfile.sim new file mode 100644 index 0000000..6e0d548 --- /dev/null +++ b/.github/Dockerfile.sim @@ -0,0 +1,170 @@ +# =========================================================================== +# Stage 1: Builder — build everything, package runtime closure +# =========================================================================== +FROM catthehacker/ubuntu:act-latest AS builder + +RUN apt-get update -qq && apt-get install -y -qq \ + build-essential pkg-config libssl-dev git curl docker.io xxd \ + && rm -rf /var/lib/apt/lists/* + +# Nix +RUN curl -L https://nixos.org/nix/install | bash -s -- --daemon --yes +RUN mkdir -p /root/.config/nix && \ + printf 'experimental-features = nix-command flakes\nsandbox = false\n' > /root/.config/nix/nix.conf +RUN rmdir /homeless-shelter 2>/dev/null || true + +# Rust + cargo-risczero +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN cargo install cargo-risczero + +RUN git config --global url."https://github.com/".insteadOf "git@github.com:" + +SHELL ["/bin/bash", "-lc"] + +# logos-blockchain-circuits (architecture-aware) +RUN ARCH=$(uname -m | sed 's/arm64/aarch64/') && \ + CIRCUITS_URL="https://github.com/logos-blockchain/logos-blockchain-circuits/releases/download/v0.4.2/logos-blockchain-circuits-v0.4.2-linux-${ARCH}.tar.gz" && \ + echo "Downloading circuits: $CIRCUITS_URL" && \ + mkdir -p /root/.logos-blockchain-circuits && \ + curl -sL "$CIRCUITS_URL" | tar xz -C /root/.logos-blockchain-circuits && \ + mv /root/.logos-blockchain-circuits/logos-blockchain-circuits-*/* /root/.logos-blockchain-circuits/ 2>/dev/null || true && \ + rmdir /root/.logos-blockchain-circuits/logos-blockchain-circuits-* 2>/dev/null || true + +# --- LEZ modules --- + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root && \ + git clone -b feat/mix-rln-gifter-sim https://github.com/logos-co/logos-lez-rln.git && \ + cd logos-lez-rln && \ + git submodule update --init && \ + (cd logos-delivery-module && git submodule update --init --recursive) + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root/logos-lez-rln && \ + nix build .#logos-rln-module -o logos-rln-module/result-rln + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root/logos-lez-rln && \ + (cd logos-execution-zone-module && \ + RISC0_SKIP_BUILD_KERNELS=1 nix build --impure \ + --override-input logos-execution-zone "git+file://$(pwd)/../lssa" \ + -o ../logos-rln-module/result-wallet) + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + nix build github:logos-co/logos-liblogos/7df6195 \ + --override-input logos-cpp-sdk github:logos-co/logos-cpp-sdk/a4bd66c \ + -o /root/logoscore-result + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root/logos-lez-rln/logos-delivery-module/vendor/logos-delivery && \ + make -j1 liblogosdelivery 2>&1 | tail -5 + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root/logos-lez-rln && \ + SDK_PATH=$(nix build github:logos-co/logos-cpp-sdk/a4bd66c --no-link --print-out-paths 2>/dev/null) && \ + LIBLOGOS_PATH=$(nix build github:logos-co/logos-liblogos/7df6195 \ + --override-input logos-cpp-sdk github:logos-co/logos-cpp-sdk/a4bd66c \ + --no-link --print-out-paths 2>/dev/null) && \ + QT_BASE=$(find /nix/store -maxdepth 1 -name "*qtbase-6*" -type d 2>/dev/null | head -1) && \ + QT_RO=$(find /nix/store -maxdepth 1 -name "*qtremoteobjects-6*" -type d 2>/dev/null | head -1) && \ + DELIVERY_MOD="$PWD/logos-delivery-module" && \ + cd logos-delivery-module && rm -rf build_plugin && mkdir build_plugin && cd build_plugin && \ + mkdir -p delivery_root/bin delivery_root/liblogosdelivery && \ + cp "$DELIVERY_MOD/vendor/logos-delivery/build/liblogosdelivery."* delivery_root/bin/ 2>/dev/null || true && \ + cp "$DELIVERY_MOD/vendor/logos-delivery/liblogosdelivery/liblogosdelivery.h" delivery_root/liblogosdelivery/ && \ + nix-shell -p cmake ninja pkg-config postgresql --run " \ + cmake .. -GNinja \ + -DLOGOS_CPP_SDK_ROOT=$SDK_PATH \ + -DLOGOS_LIBLOGOS_ROOT=$LIBLOGOS_PATH \ + -DLOGOS_DELIVERY_ROOT=\$PWD/delivery_root \ + -DLOGOS_MESSAGING_MODULE_USE_VENDOR=OFF \ + -DCMAKE_PREFIX_PATH=\"$QT_BASE;$QT_RO\" \ + -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH=$QT_RO && \ + ninja" 2>&1 | tail -5 + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + CLANG_SO=$(find /nix/store -maxdepth 3 -name 'libclang.so' 2>/dev/null | head -1) && \ + export LIBCLANG_PATH=$(dirname "$CLANG_SO") && \ + STDBOOL=$(find "$LIBCLANG_PATH" -maxdepth 5 -name 'stdbool.h' 2>/dev/null | head -1) && \ + [ -n "$STDBOOL" ] && export BINDGEN_EXTRA_CLANG_ARGS="-I$(dirname $STDBOOL)" ; \ + cd /root/logos-lez-rln/lssa && \ + cargo build --features standalone -p sequencer_service 2>&1 | tail -5 + +# Build run_setup binary (deploys LEZ programs to sequencer at sim runtime) +RUN cd /root/logos-lez-rln/lez-rln && \ + cargo build --bin run_setup 2>&1 | tail -5 + +# --- logos-chat (liblogoschat) --- + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root && \ + git clone -b feat/logos-delivery https://github.com/adklempner/logos-chat.git && \ + cd logos-chat && \ + git submodule update --init --depth 1 && \ + (cd vendor/nwaku && git submodule update --init --recursive --depth 1) && \ + (cd vendor/nimbus-build-system && git submodule update --init --recursive --depth 1) && \ + make update && make liblogoschat 2>&1 | tail -5 + +# --- logos-chat-module (chat_module_plugin) --- + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + cd /root && \ + git clone -b feat/logos-delivery https://github.com/adklempner/logos-chat-module.git && \ + cd logos-chat-module && nix build 2>&1 | tail -5 + +# --- Package runtime closure --- + +RUN source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ + { \ + nix-store -qR /root/logos-lez-rln/logos-rln-module/result-rln; \ + nix-store -qR /root/logos-lez-rln/logos-rln-module/result-wallet; \ + nix-store -qR /root/logoscore-result; \ + nix-store -qR /root/logos-chat-module/result; \ + } | sort -u > /tmp/nix-closure-paths.txt && \ + tar cf /tmp/nix-closure.tar -T /tmp/nix-closure-paths.txt && \ + echo "Closure: $(wc -l < /tmp/nix-closure-paths.txt) paths, $(du -sh /tmp/nix-closure.tar | cut -f1)" + + + + +# =========================================================================== +# Stage 2: Runtime — minimal image, no nix/Rust/cargo needed +# =========================================================================== +FROM catthehacker/ubuntu:act-latest + +RUN apt-get update -qq && apt-get install -y -qq \ + build-essential pkg-config libssl-dev git curl xxd netcat-openbsd lsof \ + clang libclang-dev \ + && rm -rf /var/lib/apt/lists/* + +# Rust + r0vm (needed for: sequencer build + risc0 dev prover) +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN cargo install cargo-risczero + +RUN git config --global url."https://github.com/".insteadOf "git@github.com:" + +# Import runtime nix closure from builder +COPY --from=builder /tmp/nix-closure.tar /tmp/ +# Import nix store runtime closure from builder. These are loaded by +# direct path (not via nix), so no nix DB registration needed. +# The runtime nix has its own clean DB for nix-shell package downloads. +RUN mkdir -p /nix/store && tar xf /tmp/nix-closure.tar -C / && rm /tmp/nix-closure.tar + +# Pre-built LEZ module outputs +COPY --from=builder /root/logos-lez-rln/logos-rln-module/result-rln /root/lez-modules/result-rln +COPY --from=builder /root/logos-lez-rln/logos-rln-module/result-wallet /root/lez-modules/result-wallet +COPY --from=builder /root/logos-lez-rln/logos-delivery-module/build_plugin/modules/ /root/lez-modules/delivery-plugin/ +COPY --from=builder /root/logos-lez-rln/logos-delivery-module/vendor/logos-delivery/build/ /root/lez-modules/delivery-build/ +# NOTE: sequencer + run_setup are NOT pre-built. Binaries compiled in the +# builder stage crash at runtime due to library mismatch between Docker stages. +# They're built from source at runtime with system clang (~1.5 min). +# The lssa source is cloned at runtime via setup_and_run.sh submodule init. +COPY --from=builder /root/logoscore-result /root/lez-modules/logoscore-result +COPY --from=builder /root/.logos-blockchain-circuits /root/.logos-blockchain-circuits +COPY --from=builder /root/logos-lez-rln/dev /root/lez-modules/dev + +# Pre-built logos-chat outputs +COPY --from=builder /root/logos-chat/build/liblogoschat.so /root/lez-modules/liblogoschat.so +COPY --from=builder /root/logos-chat-module/result /root/lez-modules/chat-module-result diff --git a/.gitignore b/.gitignore index 24f5980..bc7b031 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,9 @@ nimble.paths /metrics/prometheus /metrics/waku-sim-all-nodes-grafana-dashboard.json +# Simulation runtime state (logs, keystores, configs generated per run) +/simulations/**/.sim_state/ + *.log /package-lock.json /package.json diff --git a/.gitmodules b/.gitmodules index 34eaae6..a049175 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,9 +3,9 @@ url = https://github.com/status-im/nimbus-build-system.git [submodule "vendor/nwaku"] path = vendor/nwaku - url = https://github.com/waku-org/nwaku.git + url = https://github.com/adklempner/logos-delivery.git ignore = untracked - branch = master + branch = feat/rln-gifter-sim [submodule "vendor/nim-protobuf-serialization"] path = vendor/nim-protobuf-serialization url = https://github.com/status-im/nim-protobuf-serialization.git @@ -28,3 +28,7 @@ path = vendor/nim-ffi url = https://github.com/logos-messaging/nim-ffi.git branch = master +[submodule "vendor/logos-lez-rln"] + path = vendor/logos-lez-rln + url = https://github.com/logos-co/logos-lez-rln.git + branch = feat/mix-rln-gifter-sim diff --git a/Makefile b/Makefile index 2ee05d0..07a4930 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ export BUILD_SYSTEM_DIR := vendor/nimbus-build-system export EXCLUDED_NIM_PACKAGES := vendor/nwaku/vendor/nim-dnsdisc/vendor \ vendor/nwaku/vendor/nimbus-build-system \ - vendor/nim-sds/vendor + vendor/nwaku/vendor/nim-ffi \ + vendor/nim-sds/vendor \ + vendor/logos-lez-rln LINK_PCRE := 0 FORMAT_MSG := "\\x1B[95mFormatting:\\x1B[39m" # we don't want an error here, so we can handle things later, in the ".DEFAULT" target @@ -69,7 +71,7 @@ TARGET ?= prod ## Git version GIT_VERSION ?= $(shell git describe --abbrev=6 --always --tags) ## Compilation parameters. If defined in the CLI the assignments won't be executed -NIM_PARAMS := $(NIM_PARAMS) -d:git_version=\"$(GIT_VERSION)\" +NIM_PARAMS := $(NIM_PARAMS) -d:git_version=\"$(GIT_VERSION)\" -d:libp2p_mix_experimental_exit_is_dest ################## ## Dependencies ## @@ -78,6 +80,25 @@ NIM_PARAMS := $(NIM_PARAMS) -d:git_version=\"$(GIT_VERSION)\" CARGO_TARGET_DIR ?= rust-bundle/target RUST_BUNDLE_LIB := $(CARGO_TARGET_DIR)/release/liblogoschat_rust_bundle.a +# Mix RLN spam protection library (separate zerokit build for mix-rln-spam-protection-plugin) +MIX_LIBRLN_VERSION ?= v2.0.0 +MIX_LIBRLN_FILE ?= $(CURDIR)/build/librln_mix_$(MIX_LIBRLN_VERSION).a +MIX_LIBRLN_NIM_PARAMS := --passL:$(MIX_LIBRLN_FILE) --passL:-lm +ifneq ($(detected_OS),Darwin) + MIX_LIBRLN_NIM_PARAMS += --passL:"-Wl,--allow-multiple-definition" +endif + +.PHONY: mix-librln +mix-librln: | $(MIX_LIBRLN_FILE) + +$(MIX_LIBRLN_FILE): + echo -e $(BUILD_MSG) "$@" && \ + $(CURDIR)/vendor/nwaku/scripts/build_rln_mix.sh \ + $(CURDIR)/build/zerokit_$(MIX_LIBRLN_VERSION) \ + $(MIX_LIBRLN_VERSION) \ + $(MIX_LIBRLN_FILE) && \ + $(CURDIR)/scripts/fix_mix_librln_dupes.sh $(MIX_LIBRLN_FILE) $(RUST_BUNDLE_LIB) + # libchat and rln each embed Rust std when built as staticlibs; linking both # causes duplicate-symbol errors. rust-bundle/ links them as rlibs so std # is emitted once. [1] @@ -107,9 +128,9 @@ tests: | build-rust-bundle build-waku-nat logos_chat.nims ########## # Ensure there is a nimble task with a name that matches the target -tui bot_echo pingpong: | build-rust-bundle build-waku-nat logos_chat.nims +tui bot_echo pingpong: | build-rust-bundle build-waku-nat mix-librln logos_chat.nims echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim $@ $(NIM_PARAMS) \ + $(ENV_SCRIPT) nim $@ $(NIM_PARAMS) $(MIX_LIBRLN_NIM_PARAMS) \ --passL:$(RUST_BUNDLE_LIB) --passL:-lm \ --path:src logos_chat.nims @@ -129,9 +150,9 @@ endif LIBLOGOSCHAT := build/liblogoschat.$(LIBLOGOSCHAT_EXT) .PHONY: liblogoschat -liblogoschat: | build-rust-bundle build-waku-nat logos_chat.nims +liblogoschat: | build-rust-bundle build-waku-nat mix-librln logos_chat.nims echo -e $(BUILD_MSG) "$(LIBLOGOSCHAT)" && \ - $(ENV_SCRIPT) nim liblogoschat $(NIM_PARAMS) \ + $(ENV_SCRIPT) nim liblogoschat $(NIM_PARAMS) $(MIX_LIBRLN_NIM_PARAMS) \ --passL:$(RUST_BUNDLE_LIB) --passL:-lm \ --path:src logos_chat.nims && \ echo -e "\n\x1B[92mLibrary built successfully:\x1B[39m" && \ diff --git a/RESTORE.md b/RESTORE.md new file mode 100644 index 0000000..292fb30 --- /dev/null +++ b/RESTORE.md @@ -0,0 +1,66 @@ +# Restore point: working testnet sim — 2026-05-17 + +Snapshot taken before consolidation / refactoring. Reproduces a passing +testnet sim run in two modes: + +- **Default**: `SIM_NETWORK=testnet ./simulations/mix_lez_chat/run_simulation.sh --fresh` + — runs `run_setup` to create a fresh per-dev payment account, registers + all 5 sim participants on the deployed RLN tree, delivers test messages. +- **Slim**: `SIM_NETWORK=testnet SIM_SLIM=1 ./simulations/mix_lez_chat/run_simulation.sh --fresh` + — skips `run_setup`; uses the shared payment account shipped in the + submodule. Useful for fresh-clone devs who don't want to build the + `lez-rln/run_setup` Rust binary. + +Both modes pass at ~2/3 reliability (intermittent mix-routing / QtRO flake; +re-run with `--fresh` if a single attempt stalls). + +## Pinned commits (per repo) + +Each repo carries both an annotated tag and a branch named +`restore/working-2026-05-17` at the listed commit. Either can be used to +recover the state if HEAD moves during consolidation. + +| Repo | Branch when tagged | Commit | +|---|---|---| +| `.` (logos-chat) | `feat/sim-rln-gifter-auth-v2` | `b6f094e` | +| `vendor/nwaku` | `feat/sim-rln-gifter-auth` | `60e875f3` | +| `vendor/logos-lez-rln` | `feat/eip191-gifter-auth` | `ed88c8f8` | +| `vendor/logos-lez-rln/logos-delivery-module` | `feat/eip191-gifter-auth` | `94173a3d` | +| `vendor/logos-lez-rln/logos-delivery-module/vendor/logos-delivery` | `feat/eip191-gifter-auth` | `e2799efe` | + +## Restore + +```bash +# From the outer repo root: +for r in . vendor/nwaku vendor/logos-lez-rln \ + vendor/logos-lez-rln/logos-delivery-module \ + vendor/logos-lez-rln/logos-delivery-module/vendor/logos-delivery; do + git -C "$r" checkout restore/working-2026-05-17 +done +``` + +After checkout, rebuild affected nim/Rust artifacts: + +```bash +# Rebuild liblogosdelivery (used by sim's delivery_module_plugin) +( cd vendor/logos-lez-rln/logos-delivery-module/vendor/logos-delivery && make liblogosdelivery ) + +# Rebuild run_setup (only needed for default mode, not slim) +( cd vendor/logos-lez-rln/lez-rln && cargo build --bin run_setup ) +``` + +## What's in this state + +- TREE_ID `…1a05100200000000` (2026-05-16 deploy #2) — programs deployed on + testnet, `is_initialized=true`. +- `vendor/logos-lez-rln/testnet/storage.json.seed` ships full post-deploy + wallet state (10 accounts: 2 roots + 3 deploy publics + intermediate + + shared payment + 4 preconfigured). +- `vendor/logos-lez-rln/testnet/{supply_holding,payment_account,config_account}.txt` + for the slim-mode bootstrap. +- Gifter (mix node 0) self-registers as a mix relay at startup + (eliminates the "Plugin not ready" forwarding drop when sender's + circuit routes through it). +- FFI aligned with SPEL `ConfigState` (240-byte borsh) + 4-field Register + instruction. +- Cross-thread Nim heap-string race fix in `mix_lez_client`. diff --git a/RUN_SLIM_TESTNET.md b/RUN_SLIM_TESTNET.md new file mode 100644 index 0000000..ed92efe --- /dev/null +++ b/RUN_SLIM_TESTNET.md @@ -0,0 +1,29 @@ +# Slim sim against latest testnet deployment + +```bash +git clone -b feat/sim-rln-gifter-auth-v2 git@github.com:logos-messaging/logos-chat.git +cd logos-chat && git submodule update --init --recursive +SIM_NETWORK=testnet SIM_SLIM=1 SIM_DELIVERY_TIMEOUT=1800 \ + bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +~15-25 min depending on testnet block timing. Pass: **ALL 15 CHECKS PASSED**. + +Slim mode reuses the on-chain RLN programs at the shipped `TREE_ID` (committed in `vendor/logos-lez-rln/testnet/`) — no fresh deploy. The shipped payment account holds 1B RLNTOK (~1000 registrations) drawn from a 10B supply, refilled by re-running `vendor/logos-lez-rln/lez-rln/target/debug/run_setup` against testnet when needed. + +`SIM_DELIVERY_TIMEOUT=1800` (30 min) is required: the gifter now serializes registrations through a single-writer worker that awaits chain confirmation between submissions to avoid per-signer nonce collisions. With testnet's ~60-90 s block cadence and up to ~6 jobs ahead in the queue, the chat sender (last in line) needs the longer delivery window. The default 300 s value would expire before its registration confirms. + +If a run still fails after a clean retry: the most likely cause is a stale `~/.logos-lez-rln/payment_account_.txt` cache from a previous shipped TREE_ID. Wipe with: + +```bash +rm -f ~/.logos-lez-rln/payment_account_*.txt \ + ~/.logos-lez-rln/supply_holding_*.txt \ + vendor/logos-lez-rln/testnet/storage.json \ + vendor/logos-lez-rln/testnet/wallet_config.json +``` + +and re-run — `seed_copy` will then re-seed from the shipped sidecars. + +If you haven't built the modules on this machine before, run `bash simulations/mix_lez_chat/setup_and_run.sh` once first to build the dylibs. + +Background on the bug class this used to hit: `cleanup/MODE_A_GIFTER_SLOT_BUG.md`. diff --git a/cleanup/MODE_A_GIFTER_SLOT_BUG.md b/cleanup/MODE_A_GIFTER_SLOT_BUG.md new file mode 100644 index 0000000..93d1f52 --- /dev/null +++ b/cleanup/MODE_A_GIFTER_SLOT_BUG.md @@ -0,0 +1,190 @@ +# Mode A — per-signer nonce collision in the gifter's wallet submission path + +**Status:** Open. Root cause identified and reproduced locally on 2026-05-27. Fix sits in the LEZ wallet (`lssa/wallet/`), not in the gifter, not in the chat sender, not in the on-chain `Register` handler. + +**Captured evidence:** +- Local reproduction (this session): `/tmp/sim_state_local_NONCE_REPRO/` — full end-to-end repro with `sequencer.log` containing 4 `"Nonce mismatch"` rejections. +- Testnet failures: `/tmp/sim_state_testnet_postfix/`, `/tmp/sim_state_cleanwallet/`. + +## TL;DR + +When the gifter fires several `register_member` calls within a single sequencer block window, **all of them fetch the same chain-side nonce N**, sign with N, and submit. The first commits and the signer's nonce advances to N+1; the remaining 2–4 fail `validate_on_state` with `"Nonce mismatch"` and are silently dropped at the sequencer (logged but not returned to the caller). The wallet has no per-signer nonce serialization, the mempool has no dedup, and `get_transaction(tx_hash)` cannot distinguish "rejected" from "still pending." + +Consequence: `tree_main.next_index` advances by ~1 per block window instead of by the number of submissions. Every requester's `register_member` keeps reading the same stale `next_index` (because the chain genuinely hasn't moved past it) and keeps returning the same optimistic `leaf_index`. Each client's gifter-status watcher polls `is_member_registered`, which keeps returning `false` (the chain never wrote their PDA). The chat-sender's 180 s confirmation deadline expires, it publishes against the optimistic-but-incorrect leaf, the rln crate computes a proof root from `(pathElements_for_someone_else, our_creds)`, and self-verify rejects with `rootInOurWindow=false`. + +The duplicate `leaf=6` / `leaf=178` readings in earlier captures are **symptoms** of zero registrations committing, not evidence of a gifter slot-allocator defect. The on-chain Register handler reads `tree_main.next_index` from live state and serializes correctly when txns commit — confirmed by sequencer-core re-execution model (`sequencer/core/src/lib.rs:243-254`). + +## Reproduction (local, deterministic) + +The local sim's default config (`vendor/logos-lez-rln/lssa/sequencer/service/configs/debug/sequencer_config.json`: `max_num_tx_in_block=20`, `block_create_timeout="15s"`) **masks** the bug because all concurrent registrations pack into a single block — they get distinct nonces from `get_accounts_nonces` between blocks and each commits at the right slot. + +To expose the race, widen the block window past the natural registration cadence: + +```jsonc +"max_num_tx_in_block": 1, // force one tx per block +"block_create_timeout": "90s" // longer than the ~25-30s gap between mix-node registrations +``` + +Then: + +```bash +SIM_NETWORK=local ./simulations/mix_lez_chat/run_simulation.sh --fresh +grep -E "Nonce mismatch" simulations/mix_lez_chat/.sim_state/sequencer.log +``` + +This is a diagnostic-only change. **Do not commit it.** + +## Evidence + +### 1. Local reproduction (this session, 2026-05-27 17:48 UTC) + +`sequencer.log`: +``` +[17:51:00 ERROR sequencer_core] Transaction with hash 6b69eb67… failed execution check with error: InvalidInput("Nonce mismatch"), skipping it +[17:51:00 ERROR sequencer_core] Transaction with hash 17d209c5… failed execution check with error: InvalidInput("Nonce mismatch"), skipping it +[17:51:00 ERROR sequencer_core] Transaction with hash c33c7543… failed execution check with error: InvalidInput("Nonce mismatch"), skipping it +[17:52:30 ERROR sequencer_core] Transaction with hash 12e9bcc7… failed execution check with error: InvalidInput("Nonce mismatch"), skipping it +``` + +`node0.log` (gifter) — leaf returned per request: +``` +11:48:11 Gifter self-registered leafIndex=0 +11:48:33 RLN gifter registration succeeded leafIndex=0 requestId=cd6dd33… +11:48:57 RLN gifter registration succeeded leafIndex=0 requestId=40b442b… +11:49:22 RLN gifter registration succeeded leafIndex=0 requestId=0740625… +11:50:20 RLN gifter registration succeeded leafIndex=1 requestId=ea051b2… ← block window rolled +11:50:54 RLN gifter registration succeeded leafIndex=1 requestId=cf37418… +``` + +Four requesters got `leaf=0`, then the next block let exactly one tx commit (advancing to leaf=1), and the next two requesters again collided on leaf=1. End-to-end the chat sender's failure was the canonical Mode A: + +`chat_sender.log`: +``` +11:50:54 RLN membership granted leafIndex=1 +11:54:05 WRN Membership confirmation did not arrive within deadline +11:54:25 ERR Self-verify of generated proof errored + err="Verification error: Expected one of the provided roots" + proofRoot=28c9607887077a3c… rootInOurWindow=false +11:54:40 ERR Failed to publish via mix + err="…mix send failed: Failed to generate spam protection proof…" +``` + +Tally: 1 FAILED, 14 passed. Identical signature to the testnet captures. + +### 2. Pre-clean-wallet testnet failure (`/tmp/sim_state_testnet_postfix/`) + +Five requesters all got `leafIndex=178`; 6 unrelated `KeyNotFoundError` lines in node0 from a stale `~/.logos-lez-rln/payment_account_*.txt` (separate environmental bug — sidecar staleness, see "Environmental footguns" below). Even when that was fixed, the slot-collision pattern persisted. + +### 3. Post-clean-wallet testnet failure (`/tmp/sim_state_cleanwallet/`) + +Five requesters all got `leafIndex=6`; zero `KeyNotFoundError`; same `Self-verify ... rootInOurWindow=false` self-verify rejection on the chat sender; same 180 s confirmation timeout. + +## Code path + +### Wallet — refetches nonce every call, no cache + +`vendor/logos-lez-rln/lssa/wallet/src/lib.rs:294-326` — `send_public_transaction`: + +```rust +// line 301-304 +let nonces = self.sequencer_client.get_accounts_nonces(vec![signer]).await?; +let signer_nonce = nonces.get(&signer).copied().unwrap_or(0); +``` + +Nonce is fetched fresh from the sequencer on every call. No local cache, no auto-increment, no awareness of in-flight submissions. + +### Mempool — no per-signer dedup + +`vendor/logos-lez-rln/lssa/mempool/src/lib.rs:1-61` — plain async queue. `send_transaction` does a stateless signature check (line 67), then pushes into the FIFO buffer. Two txns from the same signer with the same nonce both accepted into the mempool. + +### Sequencer — silent drop with logged-only feedback + +`vendor/logos-lez-rln/lssa/nssa/src/validated_state_diff.rs:73-78` (public tx) and `:340-344` (privacy-preserving) — `validate_on_state` enforces `current_nonce == *nonce`; mismatch returns `Err(InvalidInput("Nonce mismatch"))`. + +`vendor/logos-lez-rln/lssa/sequencer/core/src/lib.rs:243-254` — on validation error during block building, sequencer logs `"Transaction with hash {tx_hash} failed execution check with error: ..., skipping it"` and silently continues to the next mempool entry. The rejected tx is consumed from the mempool; **no notification flows back to the submitter.** + +### Status polling — cannot distinguish dropped from pending + +`vendor/logos-lez-rln/lssa/wallet/src/poller.rs:33-64` — `get_transaction(tx_hash)` returns `Ok(tx)` only if the tx is found in a committed block. Otherwise after polling timeout: `bail!("Transaction not found")`. A nonce-rejected tx and a still-pending tx are indistinguishable from the client's perspective. + +### Gifter — submit-and-return-optimistic + +`vendor/logos-lez-rln/logos-rln-module/src/logos_rln_module.cpp:316-486` — `register_member`: + +1. Read `tree_main` (line 367-371). +2. `rln_ffi_register_plan` → `plan.next_leaf_index` (line 376-388). This is `tree_main.next_index` at read time. +3. Build instruction (line 425-437). The instruction itself carries only `tree_id, id_commitment, rate_limit, subtree_id` — **no `leaf_index`**; the on-chain handler derives it from live state. +4. Submit via wallet — fire-and-forget (line 462-469). +5. Return `plan.next_leaf_index` to caller, with `pending: true`. + +The in-line comment at line 471-484 is candid that `plan.next_leaf_index` is "a pre-submit snapshot — it can be wrong if our tx loses a race." What that comment did not anticipate is that the more common failure mode is the tx not committing at all (silent nonce drop), not the tx committing at a different slot. + +### Note on the on-chain side (where there is **not** a bug) + +The Register handler reads `tree_main.next_index` from live state and assigns a leaf at execution time. The sequencer re-executes each public tx serially against the current state (`sequencer/core/src/lib.rs:243-254`). When two registrations commit sequentially, they get distinct leaves automatically — no program-level CAS is needed. + +There is a narrow latent correctness hole at subtree boundaries: `plan.subtree_account_id` is part of the tx's account list and is derived from the planned leaf, so if a registration is retried after the chain has crossed a subtree boundary, the account list points at the wrong subtree account and the tx will fail. This is a separate, lower-priority concern from the nonce bug — flagged here for follow-up but **not** the cause of the current Mode A failures. + +## Why the existing mitigations don't close it + +| Layer | Mitigation | Why it's insufficient | +|---|---|---| +| Chat sender — Phase 1 cushion | Wait `2 × pollInterval` after `markMembershipConfirmed()` | If `is_member_registered` never returns true (because the tx was nonce-dropped, never committed), the 180 s deadline expires and sender publishes anyway. | +| Chat sender — Phase 2 root-stability gate | Wait until `proofRoot()` is in rootTracker for `stableMs` | Tracks `cachedProof.root` for our optimistic `membershipIndex`. If that index belongs to someone else's commitment (or to no one — slot empty), `cachedProof` is still set to *some* root and Phase 2 passes. | +| Watcher background poll | Poll `is_member_registered` every 30 s, fire `onConfirmed` | Useless when the chain never wrote our PDA because our submitting tx was nonce-dropped. | +| `register_member` idempotency precheck | Skip resubmit if PDA already populated | Only handles **re-registration**, not first registration. | +| `Self-verify` in `spam_protection.generateProof` | Reject the proof locally when `rootInOurWindow=false` | Catches the symptom (we shipped this earlier in the session and it correctly fails fast). Doesn't recover the send. | +| Visibility fixes shipped this session | Surface `mix send failed` in chat sender logs | Turns a silent 14/15 into a visible 14/15. Doesn't change the failure rate. | + +All these mitigations assumed a benign "leaf was reassigned" race that the watcher would clean up. The actual mechanism is "the tx never committed in the first place," which renders each mitigation a no-op. + +## Recommended fixes — in priority order, in the right layer + +### A. Wallet-side per-signer nonce serialization (smallest correct fix) + +`vendor/logos-lez-rln/lssa/wallet/src/lib.rs:294-326` — replace the bare `get_accounts_nonces` refetch with: + +1. Maintain a per-signer `nextNonce: Map` in wallet state. +2. On `send_public_transaction`: `let nonce = max(chain_nonce_for_signer, nextNonce[signer]); nextNonce[signer] = nonce + 1`. +3. After tx confirmation (success or failure): reconcile `nextNonce[signer]` against the chain's authoritative nonce — on rejection, decrement and let the caller retry; on commit, advance only if needed. + +Trade-off: wallet becomes stateful. On restart it can rebuild `nextNonce` from chain by re-fetching once per signer. Lost in-flight txns become rejections that the caller has to retry — which requires (B). + +### B. Surface tx-status distinguishably + +`vendor/logos-lez-rln/lssa/wallet/src/poller.rs` + an additive sequencer RPC: have `get_transaction(tx_hash)` return one of `{committed(block), pending, rejected(reason)}`. The sequencer already logs the rejection reason at `sequencer/core/src/lib.rs:243-254` — that information just needs to flow back instead of being log-only. Without this, even a wallet that knows it should retry has no signal to act on. + +### C. Gifter retry on nonce rejection (after A+B land) + +Once the wallet can detect a rejected submission, the gifter's `register_member` can re-submit transparently: refetch the chain nonce, rebuild the instruction (the `plan.next_leaf_index` will have advanced), and retry. Wraps the existing fire-and-forget into a confirm-or-retry loop. Keeps the client-side optimistic flow simple. + +### Strike-through: gifter-side optimistic counter + +An earlier draft of this doc proposed a gifter in-process `Map` counter to hand out distinct optimistic leaves. **This was wrong.** It would print nicer-looking leaf numbers while the underlying tx submissions continue to silently drop. The chain wouldn't advance any faster, `is_member_registered` would still return `false`, and Mode A would persist. The fix has to address the actual submission failure, not the cosmetic returned value. + +## Environmental footguns hit during this investigation + +Documented for the next session — not related to the nonce bug but cost a couple of failed runs to diagnose: + +1. **Stale `~/.logos-lez-rln/payment_account_.txt`** caused `KeyNotFoundError` on every gifter `send_public_transaction` against testnet. The sim's `seed_copy` (`simulations/mix_lez_chat/run_simulation.sh:226-247`) has a `[ -f "$dst" ] && return 0` guard, so once a stale sidecar is cached it never gets refreshed. Workaround: `rm ~/.logos-lez-rln/payment_account_*.txt ~/.logos-lez-rln/supply_holding_*.txt vendor/logos-lez-rln/testnet/storage.json vendor/logos-lez-rln/testnet/wallet_config.json` before re-running. Cleaner fix: change the guard to refresh when the shipped source is newer than the cached destination. + +2. **Stale dylib path mismatch** between loose `vendor/logos-lez-rln/logos-delivery/build/` and canonical submodule path `vendor/logos-lez-rln/logos-delivery-module/vendor/logos-delivery/build/`. Documented in `cleanup/FRESH_CLONE_RESULTS.md`'s caveat section. + +## Open questions / follow-ups + +1. **Confirm against hosted testnet.** The local repro mechanism is identical to what we'd see on testnet (same wallet + sequencer code path). But because we cannot reach the hosted testnet's sequencer logs, we can't directly observe the `"Nonce mismatch"` lines there. One way to close the loop: add a temporary log line in the gifter's `register_member` that records the tx_hash returned by `send_public_transaction`, then add a follow-up `get_transaction(tx_hash)` poll right after submission to detect commit-vs-not. If testnet runs show that none of the gifter's tx_hashes ever appear committed, the nonce hypothesis is corroborated. + +2. **Subtree-boundary retry-time hole.** Mentioned above — the planned `subtree_account_id` is leaf-dependent. A retry after the tree has grown past a subtree boundary will submit a tx whose account list points at the wrong subtree. Independent of the nonce bug, but worth catching before the LEZ user count grows past the first few subtree boundaries. + +3. **Per-signer mempool ordering.** Even after wallet-side nonce serialization, two `register_member` calls submitting from the same signer back-to-back may land in the mempool in arbitrary order if the wallet doesn't preserve submission order. The sequencer drains mempool FIFO, so out-of-order arrivals with sequentially-advanced nonces would all fail validation. A wallet fix needs to either (a) preserve order on submission or (b) batch into a single transaction. + +## What this session shipped + +The following commits are independent of the nonce bug — they make Mode A *visible* instead of silent, which is what enabled this investigation. Worth keeping regardless of how/when the wallet fix lands: + +- `692a467` `fix(chat): surface sendBytes errors instead of swallowing via discard` +- `d36cee09` `fix(lightpush): surface mix-dialer write failures as Result error` (in `vendor/nwaku`) +- `a555e5f` `chore: bump nwaku to surface mix-dialer write failures` +- `49dbb22` `fix(chat): timeout mix lightpush so vanished-reply hangs surface as Err` + +Without these, the local repro would have hung or silently passed 14/15 with no explanatory error line, and the testnet captures would not have surfaced the `Self-verify ... rootInOurWindow=false` pattern that pointed us at the right layer. diff --git a/library/api/client_api.nim b/library/api/client_api.nim index 3f0f6fc..24b80ce 100644 --- a/library/api/client_api.nim +++ b/library/api/client_api.nim @@ -50,7 +50,22 @@ proc createChatClient( wakuCfg.staticPeers = @[] for peer in config["staticPeers"]: wakuCfg.staticPeers.add(peer.getStr()) - + + if config.hasKey("mixEnabled"): + wakuCfg.mixEnabled = config["mixEnabled"].getBool(false) + if config.hasKey("mixNodes"): + wakuCfg.mixNodes = @[] + for node in config["mixNodes"]: + wakuCfg.mixNodes.add(node.getStr()) + if config.hasKey("destPeerAddr"): + wakuCfg.destPeerAddr = config["destPeerAddr"].getStr("") + if config.hasKey("minMixPoolSize"): + wakuCfg.minMixPoolSize = config["minMixPoolSize"].getInt(4) + if config.hasKey("gifterNodeAddr"): + wakuCfg.gifterNodeAddr = config["gifterNodeAddr"].getStr("") + if config.hasKey("gifterAuthKey"): + wakuCfg.gifterAuthKey = config["gifterAuthKey"].getStr("") + # Create Waku client let wakuClient = initWakuClient(wakuCfg) @@ -117,6 +132,28 @@ proc chat_get_id( let clientId = ctx.myLib[].getId() return ok(clientId) +################################################# +# Mix Protocol Status +################################################# + +proc chat_get_mix_status( + ctx: ptr FFIContext[ChatClient], + callback: FFICallBack, + userData: pointer +) {.ffi.} = + let client = ctx.myLib[] + let mixEnabled = client.ds.cfg.mixEnabled + var poolSize = 0 + if mixEnabled: + poolSize = client.ds.getMixPoolSize() + let status = %*{ + "mixEnabled": mixEnabled, + "mixReady": client.ds.mixReady, + "mixPoolSize": poolSize, + "minPoolSize": client.ds.cfg.minMixPoolSize + } + return ok($status) + ################################################# # Conversation List Operations ################################################# diff --git a/library/declare_lib.nim b/library/declare_lib.nim index 3d8573d..5b0e479 100644 --- a/library/declare_lib.nim +++ b/library/declare_lib.nim @@ -1,5 +1,6 @@ import ffi import src/chat/client +import waku/waku_mix/logos_core_client as mix_rln_client declareLibrary("logoschat") @@ -11,3 +12,40 @@ proc set_event_callback( ctx[].eventCallback = cast[pointer](callback) ctx[].eventUserData = userData +proc chat_set_rln_fetcher( + ctx: ptr FFIContext[ChatClient], fetcher: mix_rln_client.RlnFetcherFunc, fetcherData: pointer +) {.dynlib, exportc, cdecl.} = + if fetcher.isNil: + echo "error: nil fetcher in chat_set_rln_fetcher" + return + mix_rln_client.setRlnFetcher(fetcher, fetcherData) + +proc chat_set_rln_config( + ctx: ptr FFIContext[ChatClient], configAccountId: cstring, leafIndex: cint +): cint {.dynlib, exportc, cdecl.} = + if configAccountId.isNil: + return RET_ERR + mix_rln_client.setRlnConfig($configAccountId, leafIndex.int) + return RET_OK + +proc chat_set_rln_identity( + ctx: ptr FFIContext[ChatClient], idSecretHashHex: cstring +) {.dynlib, exportc, cdecl.} = + if idSecretHashHex.isNil: + return + mix_rln_client.setRlnIdentity($idSecretHashHex) + +proc chat_push_roots( + ctx: ptr FFIContext[ChatClient], rootsJson: cstring +) {.dynlib, exportc, cdecl.} = + if rootsJson.isNil: + return + mix_rln_client.pushRoots($rootsJson) + +proc chat_push_proof( + ctx: ptr FFIContext[ChatClient], proofJson: cstring +) {.dynlib, exportc, cdecl.} = + if proofJson.isNil: + return + mix_rln_client.pushProof($proofJson) + diff --git a/library/liblogoschat.h b/library/liblogoschat.h index 487a903..26f7b22 100644 --- a/library/liblogoschat.h +++ b/library/liblogoschat.h @@ -30,6 +30,10 @@ typedef void (*FFICallBack)(int callerRet, const char *msg, size_t len, // - "clusterId": int - Waku cluster ID (optional) // - "shardId": int - Waku shard ID (optional) // - "staticPeers": array of strings - static peer multiaddrs (optional) +// - "mixEnabled": bool - enable mix protocol for sender anonymity (default: false) +// - "mixNodes": array of strings - mix bootstrap nodes as "multiaddr:mixPubKeyHex" +// - "destPeerAddr": string - lightpush destination peer "multiaddr/p2p/peerId" +// - "minMixPoolSize": int - minimum mix pool size before sending via mix (default: 4) void *chat_new(const char *configJson, FFICallBack callback, void *userData); // Start the chat client and begin listening for messages @@ -97,6 +101,38 @@ int chat_get_identity(void *ctx, FFICallBack callback, void *userData); // Returns the intro bundle as an ASCII string (format: logos_chatintro__) int chat_create_intro_bundle(void *ctx, FFICallBack callback, void *userData); +////////////////////////////////////////////////////////////////////////////// +// Mix Protocol Status +////////////////////////////////////////////////////////////////////////////// + +// Get mix protocol status +// Returns JSON: {"mixEnabled":bool,"mixReady":bool,"mixPoolSize":int,"minPoolSize":int} +int chat_get_mix_status(void *ctx, FFICallBack callback, void *userData); + +////////////////////////////////////////////////////////////////////////////// +// RLN Integration (for logos-core module wiring) +////////////////////////////////////////////////////////////////////////////// + +// RLN fetcher callback type: C++ implements this, Nim calls it to get +// roots/proofs from the RLN module via LogosAPI IPC. +typedef int (*RlnFetcherFunc)(const char *method, const char *params, + FFICallBack callback, void *callbackData, void *fetcherData); + +// Register the RLN fetcher callback (called by C++ plugin during init) +void chat_set_rln_fetcher(void *ctx, RlnFetcherFunc fetcher, void *fetcherData); + +// Set RLN configuration (account ID + leaf index in the on-chain tree) +int chat_set_rln_config(void *ctx, const char *configAccountId, int leafIndex); + +// Set RLN identity credential (seed hex for proof generation) +void chat_set_rln_identity(void *ctx, const char *idSecretHashHex); + +// Push valid merkle roots from RLN module events +void chat_push_roots(void *ctx, const char *rootsJson); + +// Push merkle proof from RLN module events +void chat_push_proof(void *ctx, const char *proofJson); + #ifdef __cplusplus } #endif diff --git a/nix/default.nix b/nix/default.nix index 12fd439..508adcd 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, nim, which, pkg-config, writeScriptBin, - openssl, miniupnpc, libnatpmp, + openssl, miniupnpc, libnatpmp, rustPlatform, fetchFromGitHub, darwin ? {}, src, # logos-chat source (self from flake, with submodules=1) rustBundleDrv }: # result of rust_bundle.nix @@ -13,20 +13,50 @@ assert lib.assertMsg ((src.submodules or false) == true) let revision = lib.substring 0 8 (src.rev or "dirty"); + logosChatSrc = src; + + zerokitMixSrc = fetchFromGitHub { + owner = "vacp2p"; + repo = "zerokit"; + rev = "v2.0.0"; + hash = "sha256-5a2cL26uw7NdLCD0gCA3tS7uX8W9yxRGqcPhWNevstM="; + }; + + mixRlnLib = rustPlatform.buildRustPackage { + pname = "librln-mix"; + version = "2.0.0"; + src = zerokitMixSrc; + cargoHash = "sha256-SoMl0QBBgTG1b4UhOlErlzWmg3J6G0xOC0tNDddOptA="; + buildAndTestSubdir = "rln"; + buildType = "release"; + nativeBuildInputs = lib.optionals stdenv.isDarwin [ darwin.cctools ]; + doCheck = false; + installPhase = '' + mkdir -p $out/lib + find target -name "librln.a" -exec cp {} $out/lib/librln_mix_v2.0.0.a \; + ls $out/lib/librln_mix_v2.0.0.a + '' + lib.optionalString stdenv.isDarwin '' + bash ${logosChatSrc}/scripts/fix_mix_librln_dupes.sh $out/lib/librln_mix_v2.0.0.a ${rustBundleDrv}/lib/liblogoschat_rust_bundle.a + ''; + }; in stdenv.mkDerivation { pname = "liblogoschat"; version = "0.1.0"; inherit src; - NIMFLAGS = lib.concatStringsSep " " [ + NIMFLAGS = lib.concatStringsSep " " ([ "--passL:${rustBundleDrv}/lib/liblogoschat_rust_bundle.a" + "--passL:${mixRlnLib}/lib/librln_mix_v2.0.0.a" "--passL:-lm" "-d:miniupnpcUseSystemLibs" "-d:libnatpmpUseSystemLibs" "--passL:-lminiupnpc" "--passL:-lnatpmp" "-d:git_version=${revision}" - ]; + "-d:libp2p_mix_experimental_exit_is_dest" + ] ++ lib.optionals stdenv.isLinux [ + "--passL:-Wl,--allow-multiple-definition" + ]); nativeBuildInputs = let fakeGit = writeScriptBin "git" '' diff --git a/rust-bundle/Cargo.lock b/rust-bundle/Cargo.lock index 06c2420..7aace84 100644 --- a/rust-bundle/Cargo.lock +++ b/rust-bundle/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli 0.32.3", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - [[package]] name = "aead" version = "0.5.2" @@ -27,17 +12,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.17", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.12" @@ -45,21 +19,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.3.4", "once_cell", "version_check", "zerocopy", ] -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -76,12 +40,6 @@ dependencies = [ "bytes", ] -[[package]] -name = "any_ascii" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" - [[package]] name = "anyhow" version = "1.0.102" @@ -100,42 +58,13 @@ dependencies = [ "ark-std 0.5.0", ] -[[package]] -name = "ark-circom" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ebc2533f01222bf1ea7158ff32cb90102824f1e3b2c74415194ebfead6d2f34" -dependencies = [ - "ark-bn254", - "ark-crypto-primitives", - "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", - "color-eyre", - "ethers-core", - "fnv", - "hex", - "num", - "num-bigint", - "num-traits", - "thiserror 1.0.69", - "wasmer", - "wasmer-wasix", -] - [[package]] name = "ark-crypto-primitives" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ - "ahash 0.8.12", + "ahash", "ark-crypto-primitives-macros", "ark-ec", "ark-ff 0.5.0", @@ -169,7 +98,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ - "ahash 0.8.12", + "ahash", "ark-ff 0.5.0", "ark-poly", "ark-serialize 0.5.0", @@ -334,7 +263,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ - "ahash 0.8.12", + "ahash", "ark-ff 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", @@ -370,7 +299,7 @@ dependencies = [ "ark-ff 0.5.0", "ark-std 0.5.0", "tracing", - "tracing-subscriber 0.2.25", + "tracing-subscriber", ] [[package]] @@ -462,44 +391,12 @@ dependencies = [ "rayon", ] -[[package]] -name = "arrayref" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" - [[package]] name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "async-trait" -version = "0.1.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "auto_impl" version = "1.3.0" @@ -517,27 +414,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - [[package]] name = "base64" version = "0.22.1" @@ -550,15 +426,6 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -592,20 +459,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "blake3" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", - "cpufeatures", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -615,50 +468,12 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "bstr" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - [[package]] name = "byte-slice-cast" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -670,18 +485,6 @@ name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" -dependencies = [ - "serde", -] - -[[package]] -name = "bytesize" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" -dependencies = [ - "serde", -] [[package]] name = "cc" @@ -699,12 +502,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chacha20" version = "0.9.1" @@ -734,43 +531,7 @@ name = "chat-proto" version = "0.1.0" source = "git+https://github.com/logos-messaging/chat_proto#44d5360c41d721a011d20ee69a75a85357b33b0e" dependencies = [ - "prost 0.14.3", -] - -[[package]] -name = "chrono" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" -dependencies = [ - "num-traits", -] - -[[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", + "prost", ] [[package]] @@ -784,45 +545,6 @@ dependencies = [ "zeroize", ] -[[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 = "const-hex" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9a108e542ddf1de36743a6126e94d6659dccda38fc8a77e80b915102ac784a" -dependencies = [ - "cfg-if", - "cpufeatures", - "proptest", - "serde_core", -] - [[package]] name = "const-oid" version = "0.9.6" @@ -849,47 +571,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "constant_time_eq" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" - -[[package]] -name = "cooked-waker" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147be55d677052dabc6b22252d5dd0fd4c29c8c27aa4f2fbef0f94aa003b406f" - -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "corosensei" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e" -dependencies = [ - "autocfg", - "cfg-if", - "libc", - "scopeguard", - "windows-sys 0.33.0", -] - [[package]] name = "cpufeatures" version = "0.2.17" @@ -899,89 +580,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" -dependencies = [ - "arrayvec", - "bumpalo", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-egraph", - "cranelift-entity", - "cranelift-isle", - "gimli 0.26.2", - "log", - "regalloc2", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" - -[[package]] -name = "cranelift-egraph" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" -dependencies = [ - "cranelift-entity", - "fxhash", - "hashbrown 0.12.3", - "indexmap 1.9.3", - "log", - "smallvec", -] - -[[package]] -name = "cranelift-entity" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" - -[[package]] -name = "cranelift-frontend" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-isle" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" - [[package]] name = "crc32fast" version = "1.5.0" @@ -991,21 +589,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crossbeam-channel" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -1025,15 +608,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-queue" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.21" @@ -1055,24 +629,12 @@ dependencies = [ "hkdf", "rand_core 0.6.4", "sha2", - "thiserror 2.0.18", + "thiserror", "x25519-dalek", "xeddsa", "zeroize", ] -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-common" version = "0.1.7" @@ -1111,89 +673,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - -[[package]] -name = "darling" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" -dependencies = [ - "darling_core 0.21.3", - "darling_macro 0.21.3", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" -dependencies = [ - "darling_core 0.21.3", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "dashmap" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core 0.9.12", -] - [[package]] name = "der" version = "0.7.10" @@ -1204,15 +683,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", -] - [[package]] name = "derivative" version = "2.2.0" @@ -1224,37 +694,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.20" @@ -1266,26 +705,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "digest" version = "0.9.0" @@ -1302,31 +721,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", - "const-oid", "crypto-common", "subtle", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - [[package]] name = "double-ratchets" version = "0.0.1" @@ -1339,37 +737,11 @@ dependencies = [ "safer-ffi", "serde", "storage", - "thiserror 2.0.18", + "thiserror", "x25519-dalek", "zeroize", ] -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "dyn-clone" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - [[package]] name = "ed25519" version = "2.2.3" @@ -1412,45 +784,6 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array 0.14.7", - "group", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "enum-iterator" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enum-ordinalize" version = "4.3.2" @@ -1471,27 +804,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "enumset" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b07a8dfbbbfc0064c0a6bdf9edcf966de6b1c33ce344bdeca3b41615452634" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e744e4ea338060faee68ed933e46e722fb7f3617e722a5772d7e856d8b3ce" -dependencies = [ - "darling 0.21.3", - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -1505,82 +817,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "ethabi" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" -dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3", - "thiserror 1.0.69", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] - -[[package]] -name = "ethers-core" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" -dependencies = [ - "arrayvec", - "bytes", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", - "generic-array 0.14.7", - "k256", - "num_enum 0.7.5", - "open-fastrlp", - "rand 0.8.5", - "rlp", - "serde", - "serde_json", - "strum", - "tempfile", - "thiserror 1.0.69", - "tiny-keccak", - "unicode-xid", + "windows-sys", ] [[package]] @@ -1618,22 +855,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320bea982e85d42441eb25c49b41218e7eaa2657e8f90bc4eca7437376751e23" -[[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 = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -1674,33 +895,12 @@ dependencies = [ "bytes", ] -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "fiat-crypto" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" -[[package]] -name = "filetime" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" -dependencies = [ - "cfg-if", - "libc", - "libredox", -] - [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -1719,22 +919,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1747,30 +931,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - [[package]] name = "fs2" version = "0.4.3" @@ -1781,106 +941,12 @@ dependencies = [ "winapi", ] -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "funty" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-executor" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" - -[[package]] -name = "futures-macro" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "futures-sink" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - [[package]] name = "fxhash" version = "0.2.1" @@ -1898,7 +964,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", ] [[package]] @@ -1918,10 +983,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1931,11 +994,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", - "js-sys", "libc", "r-efi", "wasip2", - "wasm-bindgen", ] [[package]] @@ -1951,82 +1012,6 @@ dependencies = [ "wasip3", ] -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -dependencies = [ - "fallible-iterator 0.2.0", - "indexmap 1.9.3", - "stable_deref_trait", -] - -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - -[[package]] -name = "globset" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "half" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" -dependencies = [ - "cfg-if", - "crunchy", - "zerocopy", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hashbrown" version = "0.15.5" @@ -2052,40 +1037,12 @@ dependencies = [ "hashbrown 0.15.5", ] -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32", - "rustc_version 0.4.1", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - [[package]] name = "hex" version = "0.4.3" @@ -2110,252 +1067,12 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "http" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "hyper" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "pin-utils", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" -dependencies = [ - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "base64", - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "ipnet", - "libc", - "percent-encoding", - "pin-project-lite", - "socket2 0.6.2", - "tokio", - "tower-service", - "tracing", -] - -[[package]] -name = "icu_collections" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" -dependencies = [ - "displaydoc", - "potential_utf", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" -dependencies = [ - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" - -[[package]] -name = "icu_properties" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" - -[[package]] -name = "icu_provider" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" -dependencies = [ - "displaydoc", - "icu_locale_core", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - [[package]] name = "id-arena" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "ignore" -version = "0.4.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "impl-codec" version = "0.6.0" @@ -2365,24 +1082,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.3" @@ -2394,23 +1093,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "indenter" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.13.0" @@ -2441,22 +1123,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "ipnet" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" - -[[package]] -name = "iri-string" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "itertools" version = "0.10.5" @@ -2490,29 +1156,6 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" -[[package]] -name = "js-sys" -version = "0.3.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dc6f6450b3f6d4ed5b16327f38fed626d375a886159ca555bd7822c0c3a5a6" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "k256" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "sha2", -] - [[package]] name = "keccak" version = "0.1.6" @@ -2528,27 +1171,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "leb128fmt" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" -[[package]] -name = "lexical-sort" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09e4591611e231daf4d4c685a66cb0410cc1e502027a20ae55f2bb9e997207a" -dependencies = [ - "any_ascii", -] - [[package]] name = "libc" version = "0.2.182" @@ -2565,10 +1193,10 @@ dependencies = [ "crypto", "double-ratchets", "hex", - "prost 0.14.3", + "prost", "rand_core 0.6.4", "safer-ffi", - "thiserror 2.0.18", + "thiserror", "x25519-dalek", ] @@ -2578,17 +1206,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" -[[package]] -name = "libredox" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" -dependencies = [ - "bitflags 2.11.0", - "libc", - "redox_syscall 0.7.3", -] - [[package]] name = "libsqlite3-sys" version = "0.33.0" @@ -2601,45 +1218,12 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linked_hash_set" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "984fb35d06508d1e69fc91050cceba9c0b748f983e6739fa2c7a9237154c52c8" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" -[[package]] -name = "litemap" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" - -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - [[package]] name = "lock_api" version = "0.4.14" @@ -2655,30 +1239,6 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -[[package]] -name = "lru-slab" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" - -[[package]] -name = "lz4_flex" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a" -dependencies = [ - "twox-hash", -] - -[[package]] -name = "mach2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" -dependencies = [ - "libc", -] - [[package]] name = "macro_rules_attribute" version = "0.1.3" @@ -2695,36 +1255,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" -[[package]] -name = "managed" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" - [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" -[[package]] -name = "memmap2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "merlin" version = "3.0.0" @@ -2737,65 +1273,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - -[[package]] -name = "native-tls" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -2804,24 +1281,8 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", - "rand 0.8.5", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" - [[package]] name = "num-integer" version = "0.1.46" @@ -2831,28 +1292,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -2863,68 +1302,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - -[[package]] -name = "num_enum" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" -dependencies = [ - "num_enum_derive 0.7.5", - "rustversion", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" -dependencies = [ - "proc-macro-crate 3.4.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -2937,63 +1314,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", -] - -[[package]] -name = "open-fastrlp-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "openssl" -version = "0.10.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" -dependencies = [ - "bitflags 2.11.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - [[package]] name = "openssl-src" version = "300.5.5+3.5.5" @@ -3016,12 +1336,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "owo-colors" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" - [[package]] name = "parity-scale-codec" version = "3.7.5" @@ -3044,7 +1358,7 @@ version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ - "proc-macro-crate 3.4.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.117", @@ -3058,7 +1372,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.6", + "parking_lot_core", ] [[package]] @@ -3070,42 +1384,17 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "winapi", ] -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.18", - "smallvec", - "windows-link", -] - [[package]] name = "paste" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "path-clean" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - [[package]] name = "pest" version = "2.8.6" @@ -3116,48 +1405,12 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap 2.13.0", -] - -[[package]] -name = "pin-project" -version = "1.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkcs8" version = "0.10.2" @@ -3185,21 +1438,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "potential_utf" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.21" @@ -3237,53 +1475,16 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", "uint", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.23.10+spec-1.0.0", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit", ] [[package]] @@ -3310,16 +1511,6 @@ dependencies = [ "unarray", ] -[[package]] -name = "prost" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" -dependencies = [ - "bytes", - "prost-derive 0.13.5", -] - [[package]] name = "prost" version = "0.14.3" @@ -3327,20 +1518,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" dependencies = [ "bytes", - "prost-derive 0.14.3", -] - -[[package]] -name = "prost-derive" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" -dependencies = [ - "anyhow", - "itertools 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.117", + "prost-derive", ] [[package]] @@ -3356,92 +1534,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "pulldown-cmark" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" -dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", -] - -[[package]] -name = "quinn" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" -dependencies = [ - "bytes", - "cfg_aliases", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2 0.6.2", - "thiserror 2.0.18", - "tokio", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-proto" -version = "0.11.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" -dependencies = [ - "bytes", - "getrandom 0.3.4", - "lru-slab", - "rand 0.9.2", - "ring", - "rustc-hash", - "rustls", - "rustls-pki-types", - "slab", - "thiserror 2.0.18", - "tinyvec", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-udp" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" -dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2 0.6.2", - "tracing", - "windows-sys 0.60.2", -] - [[package]] name = "quote" version = "1.0.44" @@ -3533,9 +1625,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -3560,219 +1652,41 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.11.0", -] - -[[package]] -name = "redox_syscall" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" -dependencies = [ - "bitflags 2.11.0", -] - -[[package]] -name = "regalloc2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" -dependencies = [ - "fxhash", - "log", - "slice-group-by", - "smallvec", -] - -[[package]] -name = "regex" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - [[package]] name = "regex-syntax" version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" -[[package]] -name = "region" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" -dependencies = [ - "bitflags 1.3.2", - "libc", - "mach2", - "windows-sys 0.52.0", -] - -[[package]] -name = "rend" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "replace_with" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51743d3e274e2b18df81c4dc6caf8a5b8e15dbe799e0dca05c7617380094e884" - -[[package]] -name = "reqwest" -version = "0.12.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" -dependencies = [ - "base64", - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "js-sys", - "log", - "native-tls", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tokio-util", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.17", - "libc", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rkyv" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "indexmap 1.9.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rln" -version = "0.7.0" +version = "0.9.0" dependencies = [ "ark-bn254", - "ark-circom", "ark-ec", "ark-ff 0.5.0", "ark-groth16", - "ark-r1cs-std", + "ark-poly", "ark-relations", "ark-serialize 0.5.0", "ark-std 0.5.0", "byteorder", "cfg-if", - "color-eyre", "lazy_static", "num-bigint", "num-traits", "once_cell", - "prost 0.13.5", + "prost", "rand 0.8.5", "rand_chacha 0.3.1", + "rayon", "ruint", "serde", "serde_json", - "thiserror 2.0.18", + "tempfile", + "thiserror", "tiny-keccak", + "zeroize", "zerokit_utils", ] @@ -3783,21 +1697,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", - "rlp-derive", "rustc-hex", ] -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "ruint" version = "1.17.2" @@ -3839,7 +1741,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a22715a5d6deef63c637207afbe68d0c72c3f8d0022d7cf9714c442d6157606b" dependencies = [ "bitflags 2.11.0", - "fallible-iterator 0.3.0", + "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", @@ -3854,18 +1756,6 @@ dependencies = [ "rln", ] -[[package]] -name = "rustc-demangle" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" - -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - [[package]] name = "rustc-hex" version = "2.1.0" @@ -3890,19 +1780,6 @@ dependencies = [ "semver 1.0.27", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.11.0", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.4" @@ -3912,43 +1789,8 @@ dependencies = [ "bitflags 2.11.0", "errno", "libc", - "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", -] - -[[package]] -name = "rustls" -version = "0.23.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pki-types" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" -dependencies = [ - "web-time", - "zeroize", -] - -[[package]] -name = "rustls-webpki" -version = "0.103.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", + "linux-raw-sys", + "windows-sys", ] [[package]] @@ -3957,25 +1799,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" -[[package]] -name = "rusty_pool" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ed36cdb20de66d89a17ea04b8883fc7a386f2cf877aaedca5005583ce4876ff" -dependencies = [ - "crossbeam-channel", - "futures", - "futures-channel", - "futures-executor", - "num_cpus", -] - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - [[package]] name = "safer-ffi" version = "0.1.13" @@ -4007,128 +1830,12 @@ dependencies = [ "syn 1.0.109", ] -[[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 = "scale-info" -version = "2.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" -dependencies = [ - "cfg-if", - "derive_more 1.0.0", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" -dependencies = [ - "proc-macro-crate 3.4.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "schannel" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.117", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array 0.14.7", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "security-framework" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" -dependencies = [ - "bitflags 2.11.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "self_cell" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89" - [[package]] name = "semver" version = "0.11.0" @@ -4143,10 +1850,6 @@ name = "semver" version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" -dependencies = [ - "serde", - "serde_core", -] [[package]] name = "semver-parser" @@ -4167,17 +1870,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_core" version = "1.0.228" @@ -4198,17 +1890,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "serde_json" version = "1.0.149" @@ -4222,40 +1903,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap 2.13.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha2" version = "0.10.9" @@ -4273,79 +1920,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[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 = "shared-buffer" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" -dependencies = [ - "bytes", - "memmap2", -] - [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - [[package]] name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", "rand_core 0.6.4", ] -[[package]] -name = "simd-adler32" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" - -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - [[package]] name = "sled" version = "0.34.7" @@ -4362,58 +1951,12 @@ dependencies = [ "parking_lot", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -[[package]] -name = "smoltcp" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee34c1e1bfc7e9206cc0fb8030a90129b4e319ab53856249bb27642cab914fb3" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "managed", -] - -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socket2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" -dependencies = [ - "libc", - "windows-sys 0.60.2", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.7.3" @@ -4452,19 +1995,13 @@ version = "36.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eecb7ec5611ec93ec79d120fbe55f31bea234dc1bed1001d4a071bb688651615" dependencies = [ - "proc-macro-crate 3.4.0", + "proc-macro-crate", "proc-macro2", "quote", "rand 0.8.5", "syn 1.0.109", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - [[package]] name = "static_assertions" version = "1.1.0" @@ -4476,35 +2013,7 @@ name = "storage" version = "0.1.0" dependencies = [ "rusqlite", - "thiserror 2.0.18", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.117", + "thiserror", ] [[package]] @@ -4535,49 +2044,12 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "tap" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "tar" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "tempfile" version = "3.26.0" @@ -4587,36 +2059,8 @@ dependencies = [ "fastrand", "getrandom 0.4.1", "once_cell", - "rustix 1.1.4", - "windows-sys 0.61.2", -] - -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix 0.38.44", - "windows-sys 0.48.0", -] - -[[package]] -name = "termios" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" -dependencies = [ - "libc", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", + "rustix", + "windows-sys", ] [[package]] @@ -4625,18 +2069,7 @@ version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.18", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "thiserror-impl", ] [[package]] @@ -4650,46 +2083,6 @@ dependencies = [ "syn 2.0.117", ] -[[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 = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "time-macros" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -4699,124 +2092,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinystr" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" -dependencies = [ - "bytes", - "libc", - "mio", - "pin-project-lite", - "signal-hook-registry", - "socket2 0.6.2", - "tokio-macros", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-macros" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_edit 0.22.27", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", -] - [[package]] name = "toml_datetime" version = "0.7.5+spec-1.1.0" @@ -4826,41 +2101,16 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.13.0", - "toml_datetime 0.6.11", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap 2.13.0", - "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_write", - "winnow 0.7.14", -] - [[package]] name = "toml_edit" version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ - "indexmap 2.13.0", - "toml_datetime 0.7.5+spec-1.1.0", + "indexmap", + "toml_datetime", "toml_parser", - "winnow 0.7.14", + "winnow", ] [[package]] @@ -4869,67 +2119,15 @@ version = "1.0.9+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" dependencies = [ - "winnow 0.7.14", + "winnow", ] -[[package]] -name = "toml_write" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" - -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-http" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" -dependencies = [ - "bitflags 2.11.0", - "bytes", - "futures-util", - "http", - "http-body", - "iri-string", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4956,16 +2154,6 @@ dependencies = [ "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.22", -] - [[package]] name = "tracing-subscriber" version = "0.2.25" @@ -4975,29 +2163,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-subscriber" -version = "0.3.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "twox-hash" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" - [[package]] name = "typenum" version = "1.19.0" @@ -5028,39 +2193,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicase" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" - [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-normalization" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -5086,67 +2224,17 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "unwind_safe" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0976c77def3f1f75c4ef892a292c31c0bbe9e3d0702c63044d7c76db298171a3" -[[package]] -name = "url" -version = "2.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", - "serde_derive", -] - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "uuid" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "vacp2p_pmtree" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632293f506ca10d412dbe1d427295317b4c794fa9ddfd66fbd2fa971de88c1f6" -dependencies = [ - "rayon", -] +checksum = "47145034d8885c2f7ff7562c504ee8be6e78b564a60cc26fc174f861c61bdec2" [[package]] name = "valuable" @@ -5166,170 +2254,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "virtual-fs" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b992915c23b482788a8ad0acfade931ea1e048ab9abfd2f6fe0b167bf0c59d49" -dependencies = [ - "anyhow", - "async-trait", - "bytes", - "dashmap", - "derivative", - "dunce", - "filetime", - "fs_extra", - "futures", - "getrandom 0.2.17", - "indexmap 1.9.3", - "lazy_static", - "libc", - "pin-project-lite", - "replace_with", - "shared-buffer", - "slab", - "thiserror 1.0.69", - "tokio", - "tracing", - "webc", -] - -[[package]] -name = "virtual-mio" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6b09cfbcff87ffd8407b8533f8fec3bc55dc091ca3ff9fc3e58d5ee172f3ba" -dependencies = [ - "async-trait", - "bytes", - "derivative", - "futures", - "mio", - "serde", - "socket2 0.5.10", - "thiserror 1.0.69", - "tracing", -] - -[[package]] -name = "virtual-net" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b926dd0e0bb2f75aa1956706932dbe627cf69c132208d51b7fd6f071c0f2c274" -dependencies = [ - "anyhow", - "async-trait", - "base64", - "bincode", - "bytecheck", - "bytes", - "derivative", - "futures-util", - "libc", - "mio", - "pin-project-lite", - "rkyv", - "serde", - "smoltcp", - "socket2 0.5.10", - "thiserror 1.0.69", - "tokio", - "tracing", - "virtual-mio", -] - -[[package]] -name = "wai-bindgen-gen-core" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa3dc41b510811122b3088197234c27e08fcad63ef936306dd8e11e2803876c" -dependencies = [ - "anyhow", - "wai-parser", -] - -[[package]] -name = "wai-bindgen-gen-rust" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc05e8380515c4337c40ef03b2ff233e391315b178a320de8640703d522efe" -dependencies = [ - "heck 0.3.3", - "wai-bindgen-gen-core", -] - -[[package]] -name = "wai-bindgen-gen-rust-wasm" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f35ce5e74086fac87f3a7bd50f643f00fe3559adb75c88521ecaa01c8a6199" -dependencies = [ - "heck 0.3.3", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust", -] - -[[package]] -name = "wai-bindgen-rust" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5601c6f448c063e83a5e931b8fefcdf7e01ada424ad42372c948d2e3d67741" -dependencies = [ - "bitflags 1.3.2", - "wai-bindgen-rust-impl", -] - -[[package]] -name = "wai-bindgen-rust-impl" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdeeb5c1170246de8425a3e123e7ef260dc05ba2b522a1d369fe2315376efea4" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust-wasm", -] - -[[package]] -name = "wai-parser" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd0acb6d70885ea0c343749019ba74f015f64a9d30542e66db69b49b7e28186" -dependencies = [ - "anyhow", - "id-arena", - "pulldown-cmark", - "unicode-normalization", - "unicode-xid", -] - -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - -[[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 = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -5354,74 +2278,6 @@ dependencies = [ "wit-bindgen", ] -[[package]] -name = "wasm-bindgen" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60722a937f594b7fde9adb894d7c092fc1bb6612897c46368d18e7a20208eff2" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a89f4650b770e4521aa6573724e2aed4704372151bd0de9d16a3bbabb87441a" -dependencies = [ - "cfg-if", - "futures-util", - "js-sys", - "once_cell", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac8c6395094b6b91c4af293f4c79371c163f9a6f56184d2c9a85f5a95f3950" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3fabce6159dc20728033842636887e4877688ae94382766e00b180abac9d60" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 2.0.117", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0e091bdb824da87dc01d967388880d017a0a9bc4f3bdc0d86ee9f9336e3bb5" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-encoder" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba64e81215916eaeb48fee292f29401d69235d62d8b8fd92a7b2844ec5ae5f7" -dependencies = [ - "leb128", -] - [[package]] name = "wasm-encoder" version = "0.244.0" @@ -5429,7 +2285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" dependencies = [ "leb128fmt", - "wasmparser 0.244.0", + "wasmparser", ] [[package]] @@ -5439,334 +2295,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", - "indexmap 2.13.0", - "wasm-encoder 0.244.0", - "wasmparser 0.244.0", -] - -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmer" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d920d06243e9f456c336c428a34560357dedf59d9febaae14f1995ac120cff6" -dependencies = [ - "bytes", - "cfg-if", - "derivative", - "indexmap 1.9.3", - "js-sys", - "more-asserts", - "rustc-demangle", - "serde", - "serde-wasm-bindgen", - "shared-buffer", - "target-lexicon", - "thiserror 1.0.69", - "tracing", - "wasm-bindgen", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-derive", - "wasmer-types", - "wasmer-vm", - "wat", - "windows-sys 0.59.0", -] - -[[package]] -name = "wasmer-compiler" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e01832173aa52345e480965f18c638a8a5a9e5e4d85a48675bdf1964147dc7f" -dependencies = [ - "backtrace", - "bytes", - "cfg-if", - "enum-iterator", - "enumset", - "lazy_static", - "leb128", - "libc", - "memmap2", - "more-asserts", - "region", - "rkyv", - "self_cell", - "shared-buffer", - "smallvec", - "thiserror 1.0.69", - "wasmer-types", - "wasmer-vm", - "wasmparser 0.121.2", - "windows-sys 0.59.0", - "xxhash-rust", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1618f53b492cf6649beeb372930e376e0f52d9842c0c5eb5aa2b548251dab6" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.2", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-config" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644b7e3547bd7e796d92220f60bf57734914254c6cee56607e80177a3e8a28da" -dependencies = [ - "anyhow", - "bytesize", - "ciborium", - "derive_builder", - "hex", - "indexmap 2.13.0", - "schemars", - "semver 1.0.27", - "serde", - "serde_json", - "serde_yaml", - "thiserror 1.0.69", - "toml", - "url", -] - -[[package]] -name = "wasmer-config" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9740e3256d3836c8c267d6bb281a8f904d2827514269ab697177147f336b7a81" -dependencies = [ - "anyhow", - "bytesize", - "ciborium", - "derive_builder", - "hex", - "indexmap 2.13.0", - "schemars", - "semver 1.0.27", - "serde", - "serde_json", - "serde_yaml", - "thiserror 1.0.69", - "toml", - "url", -] - -[[package]] -name = "wasmer-derive" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5875633aea92153b6a561cb07363785ca9e07792ca6cd7c1cc371761001d8f" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wasmer-journal" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f281d37be566faeb5e18869e613546fdd3b3c9fcb3d2c1e63e3761b26f272e2" -dependencies = [ - "anyhow", - "async-trait", - "base64", - "bincode", - "bytecheck", - "bytes", - "derivative", - "lz4_flex", - "num_enum 0.5.11", - "rkyv", - "serde", - "serde_json", - "shared-buffer", - "thiserror 1.0.69", - "tracing", - "virtual-fs", - "virtual-net", - "wasmer", - "wasmer-wasix-types", -] - -[[package]] -name = "wasmer-types" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb32f0d231b591e4c8a65e81d4647fa3180496d71a123d4948dba8551bba9c2" -dependencies = [ - "bytecheck", - "enum-iterator", - "enumset", - "getrandom 0.2.17", - "hex", - "indexmap 1.9.3", - "more-asserts", - "rkyv", - "serde", - "sha2", - "target-lexicon", - "thiserror 1.0.69", - "xxhash-rust", -] - -[[package]] -name = "wasmer-vm" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e38e9301f5bb9f18da9cda4002d74d2cb6ac1f36dcf919fd77f91fca321fb1e5" -dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "crossbeam-queue", - "dashmap", - "derivative", - "enum-iterator", - "fnv", - "indexmap 1.9.3", - "lazy_static", - "libc", - "mach2", - "memoffset", - "more-asserts", - "region", - "scopeguard", - "thiserror 1.0.69", - "wasmer-types", - "windows-sys 0.59.0", -] - -[[package]] -name = "wasmer-wasix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6315fcb468bca88cfe77576ac136513a6f2e30903ba6fd5e55e621f13624ec0f" -dependencies = [ - "ahash 0.8.12", - "anyhow", - "async-trait", - "base64", - "bincode", - "blake3", - "bytecheck", - "bytes", - "cfg-if", - "cooked-waker", - "dashmap", - "derivative", - "futures", - "getrandom 0.2.17", - "heapless", - "hex", - "http", - "lazy_static", - "libc", - "linked_hash_set", - "lz4_flex", - "num_enum 0.5.11", - "once_cell", - "petgraph", - "pin-project", - "pin-utils", - "rand 0.8.5", - "reqwest", - "rkyv", - "rusty_pool", - "semver 1.0.27", - "serde", - "serde_derive", - "serde_json", - "serde_yaml", - "sha2", - "shared-buffer", - "tempfile", - "terminal_size", - "termios", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "toml", - "tracing", - "url", - "urlencoding", - "virtual-fs", - "virtual-mio", - "virtual-net", - "waker-fn", - "wasmer", - "wasmer-config 0.9.0", - "wasmer-journal", - "wasmer-types", - "wasmer-wasix-types", - "webc", - "weezl", - "windows-sys 0.59.0", - "xxhash-rust", -] - -[[package]] -name = "wasmer-wasix-types" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d26db9ef6af3c137a3b9ee1822b91e2e3e4f61c989816b0caf5b103a4c335e" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "byteorder", - "cfg-if", - "num_enum 0.5.11", - "serde", - "time", - "tracing", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust", - "wai-bindgen-gen-rust-wasm", - "wai-bindgen-rust", - "wai-parser", - "wasmer", - "wasmer-derive", - "wasmer-types", -] - -[[package]] -name = "wasmparser" -version = "0.121.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" -dependencies = [ - "bitflags 2.11.0", - "indexmap 2.13.0", - "semver 1.0.27", + "indexmap", + "wasm-encoder", + "wasmparser", ] [[package]] @@ -5777,100 +2308,10 @@ checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", - "indexmap 2.13.0", + "indexmap", "semver 1.0.27", ] -[[package]] -name = "wast" -version = "64.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc" -dependencies = [ - "leb128", - "memchr", - "unicode-width", - "wasm-encoder 0.32.0", -] - -[[package]] -name = "wat" -version = "1.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53253d920ab413fca1c7dc2161d601c79b4fdf631d0ba51dd4343bf9b556c3f6" -dependencies = [ - "wast", -] - -[[package]] -name = "web-sys" -version = "0.3.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705eceb4ce901230f8625bd1d665128056ccbe4b7408faa625eec1ba80f59a97" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webc" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdea84cf234555864ca9b7a5084c1a99dbdf2d148035f62a09b19ce5606532c1" -dependencies = [ - "anyhow", - "base64", - "bytes", - "cfg-if", - "ciborium", - "document-features", - "flate2", - "ignore", - "indexmap 1.9.3", - "leb128", - "lexical-sort", - "libc", - "once_cell", - "path-clean", - "rand 0.8.5", - "semver 1.0.27", - "serde", - "serde_json", - "sha2", - "shared-buffer", - "tar", - "tempfile", - "thiserror 1.0.69", - "toml", - "url", - "wasmer-config 0.8.0", -] - -[[package]] -name = "webpki-roots" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "weezl" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" - [[package]] name = "winapi" version = "0.3.9" @@ -5887,15 +2328,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -5908,55 +2340,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-sys" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" -dependencies = [ - "windows_aarch64_msvc 0.33.0", - "windows_i686_gnu 0.33.0", - "windows_i686_msvc 0.33.0", - "windows_x86_64_gnu 0.33.0", - "windows_x86_64_msvc 0.33.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -5966,231 +2349,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[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_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[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_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[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_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[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_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[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_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.7.14" @@ -6216,7 +2374,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" dependencies = [ "anyhow", - "heck 0.5.0", + "heck", "wit-parser", ] @@ -6227,8 +2385,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", - "heck 0.5.0", - "indexmap 2.13.0", + "heck", + "indexmap", "prettyplease 0.2.37", "syn 2.0.117", "wasm-metadata", @@ -6259,14 +2417,14 @@ checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags 2.11.0", - "indexmap 2.13.0", + "indexmap", "log", "serde", "serde_derive", "serde_json", - "wasm-encoder 0.244.0", + "wasm-encoder", "wasm-metadata", - "wasmparser 0.244.0", + "wasmparser", "wit-parser", ] @@ -6278,14 +2436,14 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", - "indexmap 2.13.0", + "indexmap", "log", "semver 1.0.27", "serde", "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.244.0", + "wasmparser", ] [[package]] @@ -6308,12 +2466,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "writeable" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" - [[package]] name = "wyz" version = "0.5.1" @@ -6335,16 +2487,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "xattr" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" -dependencies = [ - "libc", - "rustix 1.1.4", -] - [[package]] name = "xeddsa" version = "1.0.2" @@ -6352,7 +2494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2460c9a9c9d1331ff6801e87badb517faa6b6758e5fb585eb27daf7622c6d5ad" dependencies = [ "curve25519-dalek", - "derive_more 0.99.20", + "derive_more", "ed25519", "ed25519-dalek", "rand 0.8.5", @@ -6361,35 +2503,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "xxhash-rust" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" - -[[package]] -name = "yoke" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" -dependencies = [ - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.8.40" @@ -6410,27 +2523,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "synstructure", -] - [[package]] name = "zeroize" version = "1.8.2" @@ -6453,51 +2545,19 @@ dependencies = [ [[package]] name = "zerokit_utils" -version = "0.5.2" +version = "0.7.0" dependencies = [ "ark-ff 0.5.0", - "color-eyre", "hex", "lazy_static", "num-bigint", - "serde", + "rayon", + "serde_json", "sled", + "thiserror", "vacp2p_pmtree", ] -[[package]] -name = "zerotrie" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "zmij" version = "1.0.21" diff --git a/rust-bundle/Cargo.toml b/rust-bundle/Cargo.toml index 81588d0..f940aad 100644 --- a/rust-bundle/Cargo.toml +++ b/rust-bundle/Cargo.toml @@ -9,4 +9,4 @@ crate-type = ["staticlib"] [dependencies] libchat = { path = "../vendor/libchat/conversations" } -rln = { path = "../vendor/nwaku/vendor/zerokit/rln", features = ["arkzkey"] } +rln = { path = "../vendor/nwaku/vendor/zerokit/rln" } diff --git a/scripts/fix_mix_librln_dupes.sh b/scripts/fix_mix_librln_dupes.sh new file mode 100755 index 0000000..42e040d --- /dev/null +++ b/scripts/fix_mix_librln_dupes.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# Fix duplicate symbols between librln_mix and rust-bundle on macOS. +set -uo pipefail + +LIB="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" +RUST_BUNDLE="${2:-}" +[ -n "$RUST_BUNDLE" ] && RUST_BUNDLE="$(cd "$(dirname "$RUST_BUNDLE")" && pwd)/$(basename "$RUST_BUNDLE")" + +case "$(uname -s)" in + Darwin) + [ -z "$RUST_BUNDLE" ] && echo "Usage: $0 " && exit 0 + + WORK=$(mktemp -d) + trap 'rm -rf "$WORK"' EXIT + + # Match all global symbols (T=text, D=data, S=common, B=BSS, etc — uppercase = global) + (nm "$RUST_BUNDLE" 2>/dev/null || true) | grep " [TDSBCR] " | awk '{print $3}' | sort -u > "$WORK/b.txt" + (nm "$LIB" 2>/dev/null || true) | grep " [TDSBCR] " | awk '{print $3}' | sort -u > "$WORK/m.txt" + comm -12 "$WORK/b.txt" "$WORK/m.txt" > "$WORK/d.txt" + DCOUNT=$(wc -l < "$WORK/d.txt" | tr -d ' ') + [ "$DCOUNT" -eq 0 ] && echo "No duplicates." && exit 0 + echo "Localizing $DCOUNT duplicate symbols in $(basename "$LIB")..." + + mkdir "$WORK/o" && cd "$WORK/o" + ar x "$LIB" + FIXED=0 + for f in *.o; do + # Get this object's global text symbols, intersect with dupes + (nm "$f" 2>/dev/null || true) | grep " [TDSBCR] " | awk '{print $3}' | sort -u > "$WORK/obj.txt" + comm -12 "$WORK/d.txt" "$WORK/obj.txt" > "$WORK/obj_dupes.txt" + if [ -s "$WORK/obj_dupes.txt" ]; then + nmedit -R "$WORK/obj_dupes.txt" "$f" + FIXED=$((FIXED + 1)) + fi + done + rm "$LIB" + ar rcs "$LIB" *.o + echo "Fixed $FIXED objects." + ;; + *) echo "No fix needed on $(uname -s)" ;; +esac diff --git a/scripts/run_in_docker.sh b/scripts/run_in_docker.sh new file mode 100755 index 0000000..66ab84b --- /dev/null +++ b/scripts/run_in_docker.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash +# Run the mix+LEZ chat simulation inside a Docker container (Linux). +# +# The Docker image pre-builds all heavy nix modules. Each sim run clones +# the repo, builds sequencer + run_setup from source (nix-shell), symlinks +# pre-built artifacts, and runs the simulation. +# +# First run: ~60 min (one-time docker build) +# Subsequent runs: ~10 min (clone + sequencer build + sim) +# +# Prerequisites: Docker Desktop running. +# +# Usage: +# bash scripts/run_in_docker.sh +# BRANCH=my-branch bash scripts/run_in_docker.sh +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +DOCKERFILE="$ROOT/.github/Dockerfile.sim" +IMAGE_NAME="${DOCKER_IMAGE:-ghcr.io/adklempner/logos-chat-sim:latest}" +CONTAINER_NAME="logos-chat-sim-run" +BRANCH="${BRANCH:-feat/logos-delivery}" +REPO_URL="${REPO_URL:-https://github.com/adklempner/logos-chat.git}" + +# Build image if it doesn't exist or REBUILD_IMAGE=1 +if [ "${REBUILD_IMAGE:-0}" = "1" ]; then + echo "=== Building Docker image locally (~60 min) ===" + docker build -t "$IMAGE_NAME" -f "$DOCKERFILE" "$ROOT" +elif ! docker image inspect "$IMAGE_NAME" >/dev/null 2>&1; then + echo "=== Pulling Docker image from GHCR ===" + docker pull "$IMAGE_NAME" || { + echo "Pull failed, building locally..." + docker build -t "$IMAGE_NAME" -f "$DOCKERFILE" "$ROOT" + } +else + echo "=== Docker image cached ===" +fi + +docker rm -f "$CONTAINER_NAME" 2>/dev/null || true +trap 'echo "=== Rescuing logs ==="; docker cp "$CONTAINER_NAME:/root/logos-chat/simulations/mix_lez_chat/.sim_state" ./docker-sim-logs 2>/dev/null || true; docker rm -f "$CONTAINER_NAME" 2>/dev/null || true' EXIT + +echo "=== Starting container ===" +docker run -d --name "$CONTAINER_NAME" "$IMAGE_NAME" tail -f /dev/null + +# Stage guest binaries +GUEST_REL="vendor/logos-lez-rln/lez-rln/methods/guest/target/riscv32im-risc0-zkvm-elf/docker" +GUEST_SRC="" +for candidate in \ + "${GUEST_BINARIES_DIR:-}" \ + "$ROOT/$GUEST_REL" \ + "$HOME/Waku/Logos/logos-chat/$GUEST_REL" \ + "../logos-chat/$GUEST_REL"; do + [ -f "$candidate/rln_registration.bin" ] 2>/dev/null && GUEST_SRC="$candidate" && break +done +if [ -n "$GUEST_SRC" ]; then + echo "=== Staging guest binaries ===" + docker exec "$CONTAINER_NAME" mkdir -p "/tmp/guest-bins" + docker cp "$GUEST_SRC/rln_registration.bin" "$CONTAINER_NAME:/tmp/guest-bins/" + docker cp "$GUEST_SRC/incremental_merkle_tree.bin" "$CONTAINER_NAME:/tmp/guest-bins/" +fi + +# Collect SIM_* env vars +SIM_ENVS="" +for var in $(env | grep '^SIM_' | cut -d= -f1); do + SIM_ENVS="${SIM_ENVS}export $var='${!var}'; " +done + +# Write the run script to the container (avoids heredoc escaping issues) +docker exec -i "$CONTAINER_NAME" bash -c "cat > /root/run-sim.sh && chmod +x /root/run-sim.sh" << 'SIMSCRIPT' +#!/bin/bash +set -euo pipefail + +export RISC0_DEV_MODE=1 + +# Clone repo +cd /root +rm -rf logos-chat +git clone --depth 1 -b "$BRANCH" "$REPO_URL" +cd logos-chat + +# Init submodules (lssa needs full history for auto-sync) +git submodule update --init --depth 1 +(cd vendor/logos-lez-rln && git submodule update --init lssa && \ + git submodule update --init --depth 1 logos-delivery logos-delivery-module logos-execution-zone-module && \ + git checkout -- . && \ + for d in lssa logos-delivery logos-delivery-module logos-execution-zone-module; do \ + (cd "$d" && git checkout -- .); \ + done) +(cd vendor/logos-lez-rln/logos-delivery-module && git submodule update --init --depth 1 vendor/logos-delivery) + +# Symlink pre-built nix modules from image +LEZ_DIR=vendor/logos-lez-rln +ln -sf /root/lez-modules/result-rln $LEZ_DIR/logos-rln-module/result-rln +ln -sf /root/lez-modules/result-wallet $LEZ_DIR/logos-rln-module/result-wallet +mkdir -p $LEZ_DIR/logos-delivery-module/build_plugin +cp -r /root/lez-modules/delivery-plugin $LEZ_DIR/logos-delivery-module/build_plugin/modules +mkdir -p $LEZ_DIR/logos-delivery-module/vendor/logos-delivery/build +cp /root/lez-modules/delivery-build/* $LEZ_DIR/logos-delivery-module/vendor/logos-delivery/build/ 2>/dev/null || true +mkdir -p build +cp /root/lez-modules/liblogoschat.so build/ + +# Restore guest binaries +GUEST_DIR="$LEZ_DIR/lez-rln/methods/guest/target/riscv32im-risc0-zkvm-elf/docker" +if [ -f /tmp/guest-bins/rln_registration.bin ]; then + mkdir -p "$GUEST_DIR" + cp /tmp/guest-bins/*.bin "$GUEST_DIR/" +fi + +# Chat module +mkdir -p /root/logos-chat-module +ln -sf /root/lez-modules/chat-module-result /root/logos-chat-module/result + +# Build sequencer + run_setup from source (system clang, r0vm in PATH) +echo "Building sequencer + run_setup..." +export LIBCLANG_PATH=/usr/lib/llvm-18/lib +(cd $LEZ_DIR/lssa && cargo build --features standalone -p sequencer_service 2>&1 | tail -3) +(cd $LEZ_DIR/lez-rln && cargo build --bin run_setup 2>&1 | tail -3) + +export LOGOSCORE="/root/lez-modules/logoscore-result/bin/logoscore" +bash simulations/mix_lez_chat/run_simulation.sh --fresh +SIMSCRIPT + +echo "=== Running simulation ===" +docker exec -e BRANCH="$BRANCH" -e REPO_URL="$REPO_URL" $SIM_ENVS "$CONTAINER_NAME" bash /root/run-sim.sh + +echo "=== Done ===" diff --git a/simulations/mix_lez_chat/INSTRUCTIONS.md b/simulations/mix_lez_chat/INSTRUCTIONS.md new file mode 100644 index 0000000..c6c75ff --- /dev/null +++ b/simulations/mix_lez_chat/INSTRUCTIONS.md @@ -0,0 +1,77 @@ +# Running the Mix + LEZ RLN Chat Simulation + +End-to-end private chat between two logos-chat-module clients over a 4-node mix network with LEZ-backed RLN spam protection. + +Two logoscore instances (sender + receiver) establish an X3DH key agreement via an out-of-band intro bundle, then exchange double-ratchet-encrypted messages routed through 3-hop Sphinx onion routes with per-hop RLN proof generation and verification. Node 0 mounts the rln_gifter service; nodes 1-3 and both chat clients register RLN memberships on-chain via the gifter protocol. The sender publishes via `lightpushPublish(mixify=true)`, the mix exit node verifies the RLN proof before fanning out via gossipsub relay, and the receiver consumes the message via a Waku filter subscription. + +## macOS + +**Prereqs:** nix (with flakes), Docker, cargo-risczero, SSH access to GitHub. + +```bash +git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git +cd logos-chat && bash simulations/mix_lez_chat/setup_and_run.sh +``` + +First run: ~15-25 min. Re-runs: `bash simulations/mix_lez_chat/run_simulation.sh --fresh` (~5 min). + +## Linux (native) + +**Prereqs:** nix (with flakes), Docker, cargo-risczero, SSH access to GitHub. + +```bash +git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git +cd logos-chat && bash simulations/mix_lez_chat/setup_and_run.sh +``` + +Same as macOS. On x86_64 Linux this should work out of the box. On aarch64 Linux, guest zkVM binaries must be pre-built on another platform (rzup doesn't support aarch64-linux) and the wallet module nix build needs `RISC0_SKIP_BUILD_KERNELS=1`. + +## Linux (via Docker) + +**Prereqs:** Docker. + +```bash +git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git +cd logos-chat && bash scripts/run_in_docker.sh +``` + +The pre-built image (`ghcr.io/adklempner/logos-chat-sim`) is pulled automatically (~8.5GB download). Guest zkVM binaries must exist on the host from a previous macOS/x86_64 build, or set `GUEST_BINARIES_DIR`. + +Each sim run: ~10 min (clone + sequencer build + sim). To force a local image rebuild: `REBUILD_IMAGE=1 bash scripts/run_in_docker.sh`. + +## Pass criteria + +**ALL 15 CHECKS PASSED** — 4 mix nodes mounted, gifter service, LEZ RLN active, sender+receiver initialized/started/mix-mounted, intro bundle created, messages sent and received. + +## LEZ backend + +The simulation runs against the SPEL framework (logos-lez-rln `sim-on-spel` branch, based on `feat/spel`). The on-chain RLN programs use SPEL's `#[lez_program]` macro with 32-byte tree IDs, Borsh-encoded state, and PDA-based account derivation via `combine_seeds`. + +## Configuration + +```bash +SIM_LOG_LEVEL=TRACE SIM_KADEMLIA_MIN_WAIT=10 bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +Full list of `SIM_*` variables in `simulations/mix_lez_chat/README.md`. + +## If it fails + +Re-run with fresh state: +```bash +bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +Wallet/sequencer errors: +```bash +rm -f vendor/logos-lez-rln/dev/wallet_config.json vendor/logos-lez-rln/dev/storage.json +rm -f ~/.logos-lez-rln/payment_account_*.txt +``` + +Guest binary errors after updating submodules: +```bash +rm -rf vendor/logos-lez-rln/lez-rln/methods/guest/target +bash simulations/mix_lez_chat/setup_and_run.sh +``` + +Docker logs are rescued to `./docker-sim-logs/` on failure. diff --git a/simulations/mix_lez_chat/README.md b/simulations/mix_lez_chat/README.md new file mode 100644 index 0000000..cfbc91b --- /dev/null +++ b/simulations/mix_lez_chat/README.md @@ -0,0 +1,229 @@ +# Mix + LEZ RLN Chat Simulation + +End-to-end private chat between two logos-chat-module clients over a 4-node mix network with LEZ-backed RLN spam protection. + +Two logoscore instances (sender + receiver) establish an X3DH key agreement via an out-of-band intro bundle, then exchange double-ratchet-encrypted messages routed through 3-hop Sphinx onion routes with per-hop RLN proof generation and verification. Node 0 mounts the rln_gifter service; nodes 1-3 and both chat clients register RLN memberships on-chain via the gifter protocol. The sender publishes via `lightpushPublish(mixify=true)`, the mix exit node verifies the RLN proof before fanning out via gossipsub relay, and the receiver consumes the message via a Waku filter subscription. + +## macOS + +**Prereqs:** nix (with flakes), Docker, cargo-risczero, SSH access to GitHub. + +```bash +git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git +cd logos-chat && bash simulations/mix_lez_chat/setup_and_run.sh +``` + +First run: ~15-25 min. Re-runs: `bash simulations/mix_lez_chat/run_simulation.sh --fresh` (~5 min). + +## Linux (native) + +**Prereqs:** nix (with flakes), Docker, cargo-risczero, SSH access to GitHub. + +```bash +git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git +cd logos-chat && bash simulations/mix_lez_chat/setup_and_run.sh +``` + +Same as macOS. On x86_64 Linux this should work out of the box. On aarch64 Linux, guest zkVM binaries must be pre-built on another platform (rzup doesn't support aarch64-linux) and the wallet module nix build needs `RISC0_SKIP_BUILD_KERNELS=1`. + +## Linux (via Docker) + +**Prereqs:** Docker with 24GB RAM allocated. + +```bash +git clone -b feat/logos-delivery git@github.com:adklempner/logos-chat.git +cd logos-chat && bash scripts/run_in_docker.sh +``` + +The pre-built image (`ghcr.io/adklempner/logos-chat-sim`) is pulled automatically (~8.5GB download). Guest zkVM binaries must exist on the host from a previous macOS/x86_64 build, or set `GUEST_BINARIES_DIR`. + +Each sim run: ~10 min (clone + sequencer build + sim). To force a local image rebuild: `REBUILD_IMAGE=1 bash scripts/run_in_docker.sh`. + +## Pass criteria + +**ALL 15 CHECKS PASSED** — 4 mix nodes mounted, gifter service, LEZ RLN active, sender+receiver initialized/started/mix-mounted, intro bundle created, messages sent and received. + +## Architecture + +``` +logoscore (per mix node) logoscore (per chat client) +├── wallet_module (LEZ wallet) ├── wallet_module (LEZ wallet) +├── liblogos_rln_module (RLN proofs) ├── liblogos_rln_module (RLN proofs) +└── delivery_module (Waku mix relay) └── chat_module (logos-chat-module) + ├── liblogosdelivery.so ├── chat_module_plugin.so + └── mix + relay + filter + gifter └── liblogoschat.so + └── mix client + filter + gifter client +``` + +Node 0 runs the RLN gifter service. Nodes 1-3 register via gifter on startup. Chat clients also register via gifter when `startChat()` runs. + +## Configuration + +Override defaults via environment: + +| Variable | Default | Description | +|---|---|---| +| `SIM_NUM_NODES` | `4` | Number of mix relay nodes | +| `SIM_BASE_TCP_PORT` | `60001` | First node's TCP port (increments per node) | +| `SIM_BASE_DISC_PORT` | `9001` | First node's discv5 UDP port (increments per node) | +| `SIM_CLUSTER_ID` | `99` | Waku cluster ID | +| `SIM_LOG_LEVEL` | `INFO` | Node log level (TRACE, DEBUG, INFO, WARN, ERROR) | +| `SIM_CHAT_RECV_PORT` | `60010` | Chat receiver TCP port | +| `SIM_CHAT_SEND_PORT` | `60011` | Chat sender TCP port | +| `SIM_KADEMLIA_MIN_WAIT` | `30` (local) / `120` (testnet) | Minimum seconds to wait for kademlia propagation | +| `SIM_RECEIVER_MIN_WAIT` | `15` (local) / `60` (testnet) | Minimum seconds to wait for receiver to join mix | +| `SIM_DELIVERY_TIMEOUT` | `120` (local) / `300` (testnet) | Max seconds to wait for message delivery | +| `SIM_NODE_STARTUP_SLEEP` | `10` (local) / `30` (testnet) | Seconds between launching each mix node | +| `SIM_NETWORK` | `local` | `local` runs against a sequencer on `127.0.0.1:3040`; `testnet` runs against `https://testnet.lez.logos.co/` | + +Example — fast iteration with verbose logging: + +```bash +SIM_LOG_LEVEL=TRACE SIM_KADEMLIA_MIN_WAIT=10 SIM_RECEIVER_MIN_WAIT=5 \ + bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +## Running against the public testnet + +```bash +SIM_NETWORK=testnet bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +Effect of `SIM_NETWORK=testnet`: +- Phase 1 (local sequencer launch) is skipped; the script does a one-shot reachability check against `https://testnet.lez.logos.co/` and dies up front if unreachable. +- Wallet config is picked from `vendor/logos-lez-rln/testnet/` instead of `dev/`. The wallet's `storage.json` and the on-chain registration accounts persist across runs. +- `run_setup` deploys + initializes on first run, then short-circuits via `is_initialized` on every run after — see "Config account: …" in the setup output either way. +- Timing floors (`SIM_KADEMLIA_MIN_WAIT`, `SIM_RECEIVER_MIN_WAIT`, `SIM_DELIVERY_TIMEOUT`, `SIM_NODE_STARTUP_SLEEP`) and `LEZ_RLN_BLOCK_SEAL_SECS` default higher to match ~60s testnet block times. + +Prerequisites: +- The gifter mix node's payment account must be funded on testnet. The first successful `SIM_NETWORK=testnet … --fresh` run populates `~/.logos-lez-rln/payment_account_.txt` automatically; subsequent runs reuse it. +- Expected wall-clock runtime: ~20–25 minutes (first run) / ~15 minutes (subsequent runs), vs. ~3 minutes locally. +- Only one developer at a time — concurrent testnet sim runs share the gifter wallet and will collide. + +### Reproducibility on a fresh clone + +The canonical testnet deployment (RLN tree + minted supply) is shared across developers. On first run, the script seeds two artifacts from the submodule so `run_setup` can short-circuit to `create_funded_user`: + +- `vendor/logos-lez-rln/testnet/storage.json.seed` → copied to `vendor/logos-lez-rln/testnet/storage.json` if absent. Contains only the supply holding account + its signing key. +- `vendor/logos-lez-rln/testnet/supply_holding.txt` → copied to `~/.logos-lez-rln/supply_holding_.txt` if absent. Contains the supply `AccountId`. + +What stays shared vs. fresh: + +| Artifact | Shared | Per-dev fresh | +|---|---|---| +| `TREE_ID`, sequencer URL, deployed program IDs (on-chain), gifter EIP-191 auth keys, mix node identity keys | ✓ | | +| Supply holding account + signing key (seeded from submodule) | ✓ | | +| Per-run payment account (`~/.logos-lez-rln/payment_account_.txt`) | | ✓ | +| Working-copy `testnet/storage.json` (gitignored; accumulates payment accounts) | | ✓ | +| Mix + chat RLN credentials (in `.sim_state/rln_keystore_*.json`) | | ✓ | + +**Security:** the supply signing key being in the repo is acceptable only because testnet does not charge gas and the tokens are test tokens with no real value. + +### Slim mode (`SIM_SLIM=1`, testnet only) + +`SIM_SLIM=1 SIM_NETWORK=testnet ./run_simulation.sh --fresh` skips `run_setup` entirely and reuses the shipped `config_account` + cached `payment_account` from `vendor/logos-lez-rln/testnet/`. Two consequences: + +- No `lez-rln/run_setup` binary build is required. Combined with the submodule split below, a fresh clone can run the sim without ever invoking `cargo` from `lez-rln/`. +- All slim-mode runs share one on-chain payment account — concurrent runs across devs will race on its nonce. Use serially. + +**Minimum submodule set for slim mode:** + +```bash +git clone --branch feat/logos-delivery logos-chat +cd logos-chat +git submodule update --init vendor/logos-lez-rln vendor/nwaku vendor/nimbus-build-system vendor/nim-protobuf-serialization vendor/npeg vendor/blake2 vendor/libchat vendor/nim-ffi +(cd vendor/logos-lez-rln && git submodule update --init logos-delivery-module) +(cd vendor/logos-lez-rln/logos-delivery-module && git submodule update --init --recursive vendor/logos-delivery) +``` + +The previously-required `lssa` (~11 GB) and `logos-execution-zone-module` clones are unnecessary for slim mode — both are fetched via nix flake from GitHub when building the wallet/RLN modules. The top-level `vendor/logos-lez-rln/logos-delivery` submodule was removed entirely (the active copy is the nested `logos-delivery-module/vendor/logos-delivery`). + +For the local-sequencer flow (`SIM_NETWORK=local`) or to hack on the wallet/sequencer source, init the extras: `(cd vendor/logos-lez-rln && git submodule update --init lssa logos-execution-zone-module)`. The Docker bootstrap (`setup_and_run.sh`) gates these on `SIM_NETWORK=local` automatically; pass `SIM_FULL_SUBMODS=1` to force the wide init. + +## `--fresh` behavior + +When `--fresh` is passed: +- Kills all existing `logos_host` processes +- Cleans `/tmp/logos_*` Qt RemoteObjects sockets +- Removes `.sim_state/` directory +- On `SIM_NETWORK=local` (default): removes sequencer state (`rocksdb/`, `bedrock_signing_key`), rebuilds and restarts the sequencer, redeploys RLN programs via `run_setup` +- On `SIM_NETWORK=testnet`: leaves on-chain state and the persistent wallet under `vendor/logos-lez-rln/testnet/` intact; `run_setup` short-circuits to `create_funded_user` + +Without `--fresh`, on `SIM_NETWORK=local` it reuses an existing sequencer if port 3040 is already bound. + +## Troubleshooting + +**Re-run with fresh state:** +```bash +bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +**"Sequencer failed to start"** — port 3040 already in use: +```bash +kill $(lsof -ti tcp:3040) && bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +**"run_setup failed" / "Timeout waiting for account"** — stale guest binaries or wallet state: +```bash +rm -rf vendor/logos-lez-rln/lez-rln/methods/guest/target +rm -f vendor/logos-lez-rln/dev/wallet_config.json vendor/logos-lez-rln/dev/storage.json +bash simulations/mix_lez_chat/setup_and_run.sh +``` + +**"Sender started FAIL"** — stale Qt RemoteObjects sockets: +```bash +rm -f /tmp/logos_* +bash simulations/mix_lez_chat/run_simulation.sh --fresh +``` + +Docker logs are rescued to `./docker-sim-logs/` on failure. + +## Adapting for other LEZ programs + +This simulation provides a complete mix network infrastructure that other logos modules can reuse for testing. To test your own module: + +### What the sim provides +- 4 logoscore mix nodes with `delivery_module` (Waku relay + mix + RLN) +- LEZ sequencer with deployed RLN programs +- RLN gifter service on node 0 +- Wallet modules for on-chain transactions + +### What you replace +The chat_module sender/receiver instances (phase 5 of run_simulation.sh). Your module needs: + +1. **A C++ Qt plugin** implementing `PluginInterface` (see `chat_module_plugin.cpp`) + - `initLogos(LogosAPI*)` — receive the LogosAPI instance + - `eventResponse(QString, QVariantList)` signal — mandatory per logos-liblogos contract + - Methods exposed via `LOGOS_METHOD` for logoscore `-c` invocation +2. **A shared library** with your program logic (like `liblogoschat.so`) +3. **RLN integration** — wire `setRlnConfig` to pass RLN credentials from the C++ plugin to your library +4. **EVENT: stderr fallback** — on Linux, Qt signal forwarding from plugin to logoscore doesn't work across the FFI thread boundary. Write event data to stderr in `EVENT:name:data` format (gated by `LOGOS_EVENT_STDERR` env var) for cross-platform reliability. + +### How to stage your module + +```bash +MDIR=$(mktemp -d) +mkdir -p "$MDIR/your_module" +cp your_module_plugin.so "$MDIR/your_module/" +cp libyour_library.so "$MDIR/your_module/" +echo '{"name":"your_module","version":"1.0.0","type":"core",...}' > "$MDIR/your_module/manifest.json" + +logoscore -m "$MDIR" \ + -l "liblogos_execution_zone_wallet_module,liblogos_rln_module,your_module" \ + -c "liblogos_execution_zone_wallet_module.open($WALLET_CONFIG,$WALLET_STORAGE)" \ + -c "your_module.init(@config.json)" \ + -c "your_module.start()" +``` + +### Reference +- `chat_module_plugin.cpp` — complete working example with RLN, gifter, mix, and event emission +- `delivery_module_plugin.cpp` — more complex example with full RLN fetcher integration +- `run_simulation.sh` — orchestration, module staging, and verification patterns + +## Logs + +All logs in `simulations/mix_lez_chat/.sim_state/`: +- `node0.log` – `node3.log` — mix relay nodes +- `chat_receiver.log` — receiver chat module +- `chat_sender.log` — sender chat module +- `sequencer.log` — LEZ sequencer diff --git a/simulations/mix_lez_chat/fixtures/gifter_auth/addresses.env b/simulations/mix_lez_chat/fixtures/gifter_auth/addresses.env new file mode 100644 index 0000000..e332d02 --- /dev/null +++ b/simulations/mix_lez_chat/fixtures/gifter_auth/addresses.env @@ -0,0 +1,6 @@ +# Ethereum addresses derived from keys.env. Keep in sync if those keys change. +ADDR_MIX1=0x8ba6d3237e6f2c84b0e3d71aa57bc5869d3b5218 +ADDR_MIX2=0x8e3d4d0a713087e2263e2fcdec894c283c777dcc +ADDR_MIX3=0xca282bbf8bf3636e15af3ad8caf11cdd38bf35d8 +ADDR_SENDER=0x0b6872aaae7a2d4f3c701793cde57b93337f4d4a +ADDR_RECEIVER=0xb5dda07309f5ab06e0847f6036c305ea9ae26937 diff --git a/simulations/mix_lez_chat/fixtures/gifter_auth/keys.env b/simulations/mix_lez_chat/fixtures/gifter_auth/keys.env new file mode 100644 index 0000000..8771130 --- /dev/null +++ b/simulations/mix_lez_chat/fixtures/gifter_auth/keys.env @@ -0,0 +1,9 @@ +# Test fixtures for the RLN gifter EIP-191 auth path. NOT FOR PRODUCTION. +# Each value is a 64-hex-char secp256k1 private key. addresses.env holds +# the corresponding Ethereum addresses; if these keys change, regenerate +# the addresses (any keccak256(secp256k1 pubkey)[12:] tool will do). +KEY_MIX1=2c974e0a453f65dd2230d403f6981fc18f9a3ad7675afb647910e0798a3eaa4f +KEY_MIX2=b880df1f571109e646f641636794dfe7ffefc2aab19290ba0d720c407758304d +KEY_MIX3=0b1b5e18839a3e15b119519092e4a94a71122acf57d8b2e1014df0121cb6f0ea +KEY_SENDER=5284ac01fed5fcb6b26933ac4a901412b66fcd7ee5b945b799f147a3b42f49ef +KEY_RECEIVER=a5619d6bfde09f54165ec9da55a7be7380f1b258c8279177dbda5ac235d0e904 diff --git a/simulations/mix_lez_chat/run_simulation.sh b/simulations/mix_lez_chat/run_simulation.sh new file mode 100755 index 0000000..62fd07d --- /dev/null +++ b/simulations/mix_lez_chat/run_simulation.sh @@ -0,0 +1,685 @@ +#!/usr/bin/env bash +# Mix + LEZ RLN simulation using logos-chat-module as sender/receiver. +# Reuses the logoscore mix node infrastructure from logos-lez-rln and replaces +# chat2mix with logoscore instances running the chat_module plugin. +# +# Prerequisites: +# - logos-lez-rln repo as sibling or set LEZ_RLN_DIR +# - logos-chat-module built (nix build in ../logos-chat-module) +# - logos-chat built (make liblogoschat in this repo) +# +# Usage: ./run_simulation.sh [--fresh] +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +LOGOS_CHAT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)" +CHAT_MODULE_DIR="${CHAT_MODULE_DIR:-$(cd "$LOGOS_CHAT_DIR/../logos-chat-module" && pwd)}" + +# Use vendored logos-lez-rln submodule, or auto-detect as sibling +LEZ_RLN_DIR="${LEZ_RLN_DIR:-}" +if [ -z "$LEZ_RLN_DIR" ] && [ -d "$LOGOS_CHAT_DIR/vendor/logos-lez-rln/lez-rln" ]; then + LEZ_RLN_DIR="$LOGOS_CHAT_DIR/vendor/logos-lez-rln" +fi +for candidate in "$LOGOS_CHAT_DIR/.." "$LOGOS_CHAT_DIR/../logos-lez-rln"; do + [ -n "$LEZ_RLN_DIR" ] && break + [ -d "$candidate/lez-rln" ] && LEZ_RLN_DIR="$(cd "$candidate" && pwd)" && break +done +[ -z "$LEZ_RLN_DIR" ] && { echo "FATAL: Cannot find logos-lez-rln repo. Set LEZ_RLN_DIR or run: git submodule update --init --recursive"; exit 1; } + +DELIVERY_MODULE_DIR="${DELIVERY_MODULE_DIR:-$LEZ_RLN_DIR/logos-delivery-module}" +DELIVERY_DIR="$DELIVERY_MODULE_DIR/vendor/logos-delivery" + +export RISC0_DEV_MODE=1 +export TMPDIR=/tmp +export LOGOS_EVENT_STDERR=1 # Mirror EVENT: lines to stderr so the sim can grep them. + +die() { echo " FATAL: $*" >&2; exit 1; } +log() { echo "[$(date '+%H:%M:%S')] $*"; } + +# Poll a logoscore log until it shows >= $expected "Method call successful" +# lines, or until $timeout iterations (sleeping $sleep_sec each) have elapsed. +# Sets global $N to the last observed count so callers can branch on it. +wait_method_calls() { + local logfile="$1" expected="$2" timeout="$3" sleep_sec="${4:-1}" + local t + for t in $(seq 1 "$timeout"); do + N=$(grep -c '^Method call successful' "$logfile" 2>/dev/null || true); N=${N:-0} + [ "$N" -ge "$expected" ] && return 0 + sleep "$sleep_sec" + done + return 1 +} + +# --- Node identity constants (4 mix nodes) --- +NODEKEYS=( + "f98e3fba96c32e8d1967d460f1b79457380e1a895f7971cecc8528abe733781a" + "09e9d134331953357bd38bbfce8edb377f4b6308b4f3bfbe85c610497053d684" + "ed54db994682e857d77cd6fb81be697382dc43aa5cd78e16b0ec8098549f860e" + "42f96f29f2d6670938b0864aced65a332dcf5774103b4c44ec4d0ea4ef3c47d6" +) +PEER_IDS=( + "16Uiu2HAmPiEs2ozjjJF2iN2Pe2FYeMC9w4caRHKYdLdAfjgbWM6o" + "16Uiu2HAmLtKaFaSWDohToWhWUZFLtqzYZGPFuXwKrojFVF6az5UF" + "16Uiu2HAmTEDHwAziWUSz6ZE23h5vxG2o4Nn7GazhMor4bVuMXTrA" + "16Uiu2HAmPwRKZajXtfb1Qsv45VVfRZgK3ENdfmnqzSrVm3BczF6f" +) +MIXKEYS=( + "c86029e02c05a7e25182974b519d0d52fcbafeca6fe191fbb64857fb05be1a53" + "b858ac16bbb551c4b2973313b1c8c8f7ea469fca03f1608d200bbf58d388ec7f" + "d8bd379bb394b0f22dd236d63af9f1a9bc45266beffc3fbbe19e8b6575f2535b" + "780fff09e51e98df574e266bf3266ec6a3a1ddfcf7da826a349a29c137009d49" +) +MIX_PUBKEYS=( + "9231e86da6432502900a84f867004ce78632ab52cd8e30b1ec322cd795710c2a" + "275cd6889e1f29ca48e5b9edb800d1a94f49f13d393a0ecf1a07af753506de6c" + "e0ed594a8d506681be075e8e23723478388fb182477f7a469309a25e7076fc18" + "8fd7a1a7c19b403d231452a9b1ea40eb1cc76f455d918ef8980e7685f9eeeb1f" +) +# --- Configurable parameters (override via environment) --- +NUM_NODES=${SIM_NUM_NODES:-4} +BASE_TCP_PORT=${SIM_BASE_TCP_PORT:-60001} +BASE_DISC_PORT=${SIM_BASE_DISC_PORT:-9001} +CLUSTER_ID=${SIM_CLUSTER_ID:-99} +NUM_SHARDS=1 +CONTENT_TOPIC="/logos-chat/1/mix-test/proto" +TEST_MESSAGE_PREFIX="chatmixtest" +LOG_LEVEL=${SIM_LOG_LEVEL:-INFO} +CHAT_RECV_PORT=${SIM_CHAT_RECV_PORT:-60010} +CHAT_SEND_PORT=${SIM_CHAT_SEND_PORT:-60011} +SIM_NETWORK=${SIM_NETWORK:-local} +case "$SIM_NETWORK" in + local|testnet) ;; + *) die "SIM_NETWORK must be 'local' or 'testnet', got: $SIM_NETWORK";; +esac + +# Timing floors: local sequencer ~15s blocks vs testnet ~60s + more variance. +if [ "$SIM_NETWORK" = testnet ]; then + KADEMLIA_MIN_WAIT=${SIM_KADEMLIA_MIN_WAIT:-120} + # Testnet block times + finality lag can stretch RLN tx confirmations to + # multiple minutes per mix node. 4 nodes × ~5 min each + slack ≈ 30 min. + KADEMLIA_HARD_CAP=${SIM_KADEMLIA_HARD_CAP:-1800} + RECEIVER_MIN_WAIT=${SIM_RECEIVER_MIN_WAIT:-60} + DELIVERY_TIMEOUT=${SIM_DELIVERY_TIMEOUT:-300} + NODE_STARTUP_SLEEP=${SIM_NODE_STARTUP_SLEEP:-30} + export LEZ_RLN_BLOCK_SEAL_SECS="${LEZ_RLN_BLOCK_SEAL_SECS:-90}" +else + KADEMLIA_MIN_WAIT=${SIM_KADEMLIA_MIN_WAIT:-30} + KADEMLIA_HARD_CAP=${SIM_KADEMLIA_HARD_CAP:-180} + RECEIVER_MIN_WAIT=${SIM_RECEIVER_MIN_WAIT:-15} + DELIVERY_TIMEOUT=${SIM_DELIVERY_TIMEOUT:-120} + NODE_STARTUP_SLEEP=${SIM_NODE_STARTUP_SLEEP:-10} +fi +TESTNET_RPC_URL="https://testnet.lez.logos.co/" + +case "$(uname -s)-$(uname -m)" in + Darwin-arm64) PLATFORM="darwin-arm64-dev"; EXT="dylib";; + Linux-x86_64) PLATFORM="linux-x86_64-dev"; EXT="so";; + Linux-aarch64) PLATFORM="linux-aarch64-dev"; EXT="so";; + *) die "Unsupported platform";; +esac + +STATE_DIR="$SCRIPT_DIR/.sim_state" +FRESH=0 +for arg in "$@"; do [ "$arg" = "--fresh" ] && FRESH=1; done +[ "$FRESH" -eq 1 ] && rm -rf "$STATE_DIR" +mkdir -p "$STATE_DIR" + +SEQUENCER_PID="" +OWN_SEQUENCER=0 +INSTANCE_PIDS=() +MODULES_DIRS=() +SENDER_PID="" +RECEIVER_PID="" +EXIT_CODE=1 + +cleanup() { + set +u + echo ""; echo "=== Shutting down ===" + [ -n "$SENDER_PID" ] && kill "$SENDER_PID" 2>/dev/null || true + [ -n "$RECEIVER_PID" ] && kill "$RECEIVER_PID" 2>/dev/null || true + for pid in "${INSTANCE_PIDS[@]+"${INSTANCE_PIDS[@]}"}"; do [ -n "$pid" ] && kill "$pid" 2>/dev/null || true; done + pkill -f 'logos_host' 2>/dev/null || true + [ "$OWN_SEQUENCER" -eq 1 ] && [ -n "$SEQUENCER_PID" ] && kill "$SEQUENCER_PID" 2>/dev/null || true + for mdir in "${MODULES_DIRS[@]+"${MODULES_DIRS[@]}"}"; do [ -n "$mdir" ] && rm -rf "$mdir"; done + echo " Logs: $STATE_DIR"; echo "Done."; exit "$EXIT_CODE" +} +trap cleanup EXIT + +echo "=== Mix + LEZ RLN Chat Simulation ($NUM_NODES nodes) ===" +echo " Network: $SIM_NETWORK" +[ "$SIM_NETWORK" = testnet ] && echo " Testnet RPC: $TESTNET_RPC_URL" +echo " LEZ repo: $LEZ_RLN_DIR" +echo " Chat module: $CHAT_MODULE_DIR" +echo " Logos-chat: $LOGOS_CHAT_DIR" +echo "" + +pkill -f 'logos_host' 2>/dev/null || true; sleep 1 +# Stale QtRO LocalServer sockets confuse capability_module lookups. +rm -f /tmp/logos_* 2>/dev/null || true + +# ---------- Phase 1: Sequencer ---------- +echo "[1/6] Sequencer..." +if [ "$SIM_NETWORK" = testnet ]; then + # Fail fast if testnet RPC is unreachable before 10+ min of setup work. + BLOCK_RESP=$(curl -sS -m 10 -X POST -H 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","method":"getLastBlockId","params":[],"id":1}' \ + "$TESTNET_RPC_URL" 2>&1) + case "$BLOCK_RESP" in + *'"result"'*) log " Testnet reachable: $(echo "$BLOCK_RESP" | grep -oE '"result":[0-9]+' | head -1)";; + *) die "Testnet unreachable at $TESTNET_RPC_URL: $BLOCK_RESP";; + esac +elif nc -z 127.0.0.1 3040 2>/dev/null && [ "$FRESH" -eq 0 ]; then + SEQUENCER_PID=$(lsof -ti tcp:3040 2>/dev/null || true) + echo " Already running (PID $SEQUENCER_PID)" +else + [ "$(nc -z 127.0.0.1 3040 2>/dev/null; echo $?)" = "0" ] && kill "$(lsof -ti tcp:3040 2>/dev/null)" 2>/dev/null || true; sleep 1 + rm -rf "$LEZ_RLN_DIR/lssa/rocksdb" "$LEZ_RLN_DIR/lssa/sequencer/service/bedrock_signing_key" + + # Pre-built binary path skips both the cargo build and the lssa auto-sync + # (auto-sync needs full git history; shallow Docker clones break it). + if [ -x "$LEZ_RLN_DIR/lssa/target/debug/sequencer_service" ]; then + log " Using pre-built sequencer" + SEQ_BIN="./target/debug/sequencer_service"; SEQ_CFG="sequencer/service/configs/debug/sequencer_config.json" + else + # lssa rev must match what lez-rln's host-side client pins, else + # DeserializeUnexpectedEnd from wire-format divergence. + LSSA_REV=$(grep -oE '(rev|tag)\s*=\s*"[^"]+"' "$LEZ_RLN_DIR/lez-rln/Cargo.toml" | head -1 | sed 's/.*"\([^"]*\)"/\1/') + [ -z "$LSSA_REV" ] && die "Could not extract lssa rev from lez-rln/Cargo.toml" + if ! git -C "$LEZ_RLN_DIR/lssa" merge-base --is-ancestor "$LSSA_REV" HEAD 2>/dev/null; then + log " Pinning lssa to $LSSA_REV..." + (cd "$LEZ_RLN_DIR/lssa" && git fetch --quiet --tags origin && git checkout --quiet "$LSSA_REV") \ + || die "lssa checkout $LSSA_REV failed" + fi + log " Building sequencer..." + if (cd "$LEZ_RLN_DIR/lssa" && cargo build --features standalone -p sequencer_service 2>&1 | tail -3); then + SEQ_BIN="./target/debug/sequencer_service"; SEQ_CFG="sequencer/service/configs/debug/sequencer_config.json" + elif (cd "$LEZ_RLN_DIR/lssa" && cargo build --features standalone -p sequencer_runner 2>&1 | tail -3); then + SEQ_BIN="./target/debug/sequencer_runner"; SEQ_CFG="sequencer_runner/configs/debug" + else die "sequencer build failed"; fi + fi + (cd "$LEZ_RLN_DIR/lssa" && env RUST_LOG=info "$SEQ_BIN" "$SEQ_CFG") >"$STATE_DIR/sequencer.log" 2>&1 & + SEQUENCER_PID=$!; OWN_SEQUENCER=1; echo " PID: $SEQUENCER_PID" + for _ in $(seq 1 60); do nc -z 127.0.0.1 3040 2>/dev/null && break; sleep 1; done + nc -z 127.0.0.1 3040 2>/dev/null || die "Sequencer failed to start" + log " Ready." +fi + +# ---------- Phase 2: Deploy programs ---------- +echo "[2/6] Deploying programs..." +# `local` -> dev/ (re-init each run); `testnet` -> testnet/ (persistent +# wallet + on-chain state). wallet_config.json under each picks the sequencer. +WALLET_HOME_SUBDIR=$([ "$SIM_NETWORK" = testnet ] && echo testnet || echo dev) +export NSSA_WALLET_HOME_DIR="$LEZ_RLN_DIR/$WALLET_HOME_SUBDIR" +export WALLET_CONFIG="$NSSA_WALLET_HOME_DIR/wallet_config.json" +export WALLET_STORAGE="$NSSA_WALLET_HOME_DIR/storage.json" +TREE_ID_HEX="000102030405060708090a0b0c0d0e0f10111213141516171a05100200000001" +GIFTER_ACCOUNT_FILE="$HOME/.logos-lez-rln/payment_account_${TREE_ID_HEX}.txt" + +# Local: clean wallet each run so run_setup re-deploys. +# Testnet: persist wallet + on-chain state; run_setup short-circuits via +# is_initialized() into create_funded_user. +if [ "$SIM_NETWORK" = local ] && [ "${SIM_PERSIST_LOCAL:-0}" != "1" ]; then + rm -f "$WALLET_CONFIG" "$WALLET_STORAGE" +fi + +# Testnet bootstrap: seed wallet + supply-holding sidecar from the +# submodule-shipped artifacts on first run. After that, create_funded_user +# draws fresh per-dev payment accounts from the shared supply. +if [ "$SIM_NETWORK" = testnet ]; then + # Copy shipped seed -> runtime location iff runtime is missing. + seed_copy() { + local label="$1" src="$2" dst="$3" + [ -f "$dst" ] && return 0 + [ -f "$src" ] || return 0 + log " Seeding $label -> $dst" + mkdir -p "$(dirname "$dst")" + cp "$src" "$dst" + } + seed_copy "testnet wallet" \ + "$LEZ_RLN_DIR/testnet/storage.json.seed" "$WALLET_STORAGE" + seed_copy "supply holding sidecar" \ + "$LEZ_RLN_DIR/testnet/supply_holding.txt" \ + "$HOME/.logos-lez-rln/supply_holding_${TREE_ID_HEX}.txt" + seed_copy "payment account sidecar" \ + "$LEZ_RLN_DIR/testnet/payment_account.txt" \ + "$HOME/.logos-lez-rln/payment_account_${TREE_ID_HEX}.txt" +fi + +# Slim mode (SIM_SLIM=1, testnet only): skip run_setup when the shipped +# config_account + cached payment_account are both present — lets fresh +# clones avoid building lez-rln/run_setup. The shared payment_account is +# signed in storage.json.seed and has enough RLNTOK for ~1M Register txs. +# Experimental; the default run_setup path is better-tested. +CONFIG_ACCOUNT_SEED="$LEZ_RLN_DIR/testnet/config_account.txt" +SLIM=0 +if [ "$SIM_NETWORK" = testnet ] && [ "${SIM_SLIM:-0}" = "1" ] \ + && [ -f "$CONFIG_ACCOUNT_SEED" ] && [ -f "$GIFTER_ACCOUNT_FILE" ]; then + SLIM=1 +fi +if [ "$SLIM" = "1" ]; then + log " Slim mode: skipping run_setup (using shipped config_account + cached payment_account)" + CONFIG_ACCOUNT=$(tr -d '\n\r' < "$CONFIG_ACCOUNT_SEED") + GIFTER_ACCOUNT=$(cat "$GIFTER_ACCOUNT_FILE") +else + if [ -x "$LEZ_RLN_DIR/lez-rln/target/debug/run_setup" ]; then + SETUP_OUTPUT=$(cd "$LEZ_RLN_DIR/lez-rln" && ./target/debug/run_setup 2>&1) || die "run_setup failed" + else + SETUP_OUTPUT=$(cd "$LEZ_RLN_DIR/lez-rln" && cargo run --bin run_setup 2>&1) || die "run_setup failed" + fi + echo "$SETUP_OUTPUT" | tail -4 + # Both deploy + already-initialized branches print "Config account:". + CONFIG_ACCOUNT=$(echo "$SETUP_OUTPUT" | grep -oE 'Config account:\s+\S+' | awk '{print $NF}' || true) + [ -z "$CONFIG_ACCOUNT" ] && die "Failed to parse config account" + GIFTER_ACCOUNT=$(cat "$GIFTER_ACCOUNT_FILE" 2>/dev/null || true) + [ -z "$GIFTER_ACCOUNT" ] && die "Gifter account not found at $GIFTER_ACCOUNT_FILE" +fi +echo " CONFIG_ACCOUNT=$CONFIG_ACCOUNT" +echo " GIFTER_ACCOUNT=$GIFTER_ACCOUNT" + +# EIP-191 auth fixtures: secp256k1 keys + gifter (mix node 0) allowlist. +# Committed test fixtures only — do NOT reuse in prod. +GIFTER_AUTH_DIR="$SCRIPT_DIR/fixtures/gifter_auth" +# shellcheck disable=SC1091 +source "$GIFTER_AUTH_DIR/keys.env" +# shellcheck disable=SC1091 +source "$GIFTER_AUTH_DIR/addresses.env" +GIFTER_ALLOWLIST="$ADDR_MIX1,$ADDR_MIX2,$ADDR_MIX3,$ADDR_SENDER,$ADDR_RECEIVER" +echo " Gifter allowlist: $GIFTER_ALLOWLIST" + +# ---------- Phase 3: Prerequisites ---------- +echo "[3/6] Verifying prerequisites..." +# Use liblogos's native SDK pin — overriding to 1468180b breaks liblogos +# 7df6195's source (uses old requestObject/onEvent shapes). Plugins built +# via logos-module-builder use SDK 8bdbd13 transitively; smoke load shows +# they're ABI-compatible with the native build. +LOGOSCORE="${LOGOSCORE:-$(nix build github:logos-co/logos-liblogos/7df6195 --no-link --print-out-paths)/bin/logoscore}" +RLN_MODULE="$LEZ_RLN_DIR/logos-rln-module/result-rln/lib" +WALLET_MODULE="$LEZ_RLN_DIR/logos-rln-module/result-wallet/lib" + +# Delivery module plugin (for mix relay nodes) +if [ -f "$DELIVERY_MODULE_DIR/build_plugin/modules/delivery_module_plugin.$EXT" ]; then + DELIVERY_PLUGIN="$DELIVERY_MODULE_DIR/build_plugin/modules/delivery_module_plugin.$EXT" +else + DELIVERY_PLUGIN="$DELIVERY_MODULE_DIR/result/lib/delivery_module_plugin.$EXT" +fi + +# Chat module plugin (sender/receiver). Prefer locally-built liblogoschat +# (uses vendored Nim toolchain) over the nix result. +CHAT_MODULE_RESULT="$CHAT_MODULE_DIR/result" +if [ -f "$LOGOS_CHAT_DIR/build/liblogoschat.$EXT" ]; then + CHAT_LIB="$LOGOS_CHAT_DIR/build/liblogoschat.$EXT" + log " Using locally-built liblogoschat" +else + CHAT_LIB="$CHAT_MODULE_RESULT/lib/liblogoschat.$EXT" +fi +CHAT_PLUGIN="$CHAT_MODULE_RESULT/lib/chat_module_plugin.$EXT" + +for check in \ + "$RLN_MODULE/liblogos_rln_module.$EXT" \ + "$WALLET_MODULE/liblogos_execution_zone_wallet_module.$EXT" \ + "$DELIVERY_PLUGIN" \ + "$CHAT_PLUGIN" \ + "$CHAT_LIB"; do + [ -f "$check" ] || die "Missing: $check" +done +log " All modules present." + +# ---------- Phase 4: Start mix nodes ---------- +echo "[4/6] Starting $NUM_NODES mix+LEZ nodes..." +LOAD_ORDER="liblogos_execution_zone_wallet_module,liblogos_rln_module,delivery_module" +WALLET_CALL="liblogos_execution_zone_wallet_module.open($WALLET_CONFIG,$WALLET_STORAGE)" +BOOTSTRAP_PEER="/ip4/127.0.0.1/tcp/$BASE_TCP_PORT/p2p/${PEER_IDS[0]}" + +# All RLN memberships are issued at runtime by the gifter on node 0 — no +# off-chain setup_credentials / pre-registration step. + +for i in $(seq 0 $((NUM_NODES - 1))); do + TCP_PORT=$((BASE_TCP_PORT + i)); DISC_PORT=$((BASE_DISC_PORT + i)) + NODE_CONFIG="$STATE_DIR/node${i}_config.json" + LOG_FILE="$STATE_DIR/node${i}.log" + KAD_BOOTSTRAP="[]"; [ "$i" -gt 0 ] && KAD_BOOTSTRAP="[\"$BOOTSTRAP_PEER\"]" + PEER_LIST="" + for j in $(seq 0 $((NUM_NODES - 1))); do + [ "$j" -eq "$i" ] && continue + [ -n "$PEER_LIST" ] && PEER_LIST="$PEER_LIST," + PEER_LIST="$PEER_LIST\"/ip4/127.0.0.1/tcp/$((BASE_TCP_PORT + j))/p2p/${PEER_IDS[$j]}\"" + done + STATIC_PEERS="[$PEER_LIST]" + + GIFTER_FIELDS="" + if [ "$i" -eq 0 ]; then + GIFTER_FIELDS="\"mixGifterService\": true, \"mixGifterWalletAccount\": \"$GIFTER_ACCOUNT\", \"mixGifterAllowlist\": \"$GIFTER_ALLOWLIST\"," + else + # KEY_MIX{1..3} align with non-gifter nodes 1..3. + AUTH_KEY_VAR="KEY_MIX$i" + GIFTER_FIELDS="\"mixGifterNode\": \"$BOOTSTRAP_PEER\", \"mixGifterWalletAccount\": \"$GIFTER_ACCOUNT\", \"mixGifterAuthKey\": \"${!AUTH_KEY_VAR}\"," + fi + + cat > "$NODE_CONFIG" < "$MDIR/liblogos_execution_zone_wallet_module/manifest.json" + mkdir -p "$MDIR/liblogos_rln_module" + cp -L "$RLN_MODULE/liblogos_rln_module.$EXT" "$MDIR/liblogos_rln_module/" + cp -L "$RLN_MODULE/liblez_rln_ffi.$EXT" "$MDIR/liblogos_rln_module/" 2>/dev/null || true + echo "{\"name\":\"liblogos_rln_module\",\"version\":\"1.0.0\",\"type\":\"core\",\"main\":{\"$PLATFORM\":\"liblogos_rln_module.$EXT\"},\"dependencies\":[\"liblogos_execution_zone_wallet_module\"],\"capabilities\":[]}" > "$MDIR/liblogos_rln_module/manifest.json" + mkdir -p "$MDIR/delivery_module" + cp -L "$DELIVERY_PLUGIN" "$MDIR/delivery_module/" + if [ -f "$DELIVERY_DIR/build/liblogosdelivery.$EXT" ]; then + cp -L "$DELIVERY_DIR/build/liblogosdelivery.$EXT" "$MDIR/delivery_module/" + else + cp -L "$DELIVERY_MODULE_DIR/result/lib/liblogosdelivery.$EXT" "$MDIR/delivery_module/" 2>/dev/null || true + fi + for pq in "$DELIVERY_MODULE_DIR"/result/lib/libpq*; do [ -f "$pq" ] && cp -L "$pq" "$MDIR/delivery_module/"; done + echo "{\"name\":\"delivery_module\",\"version\":\"1.0.0\",\"type\":\"core\",\"main\":{\"$PLATFORM\":\"delivery_module_plugin.$EXT\"},\"dependencies\":[],\"capabilities\":[]}" > "$MDIR/delivery_module/manifest.json" + + log " Starting node $i (port $TCP_PORT)..." + (cd "$STATE_DIR" && TMPDIR=/tmp "$LOGOSCORE" -m "$MDIR" -l "$LOAD_ORDER" \ + -c "$WALLET_CALL" \ + -c "delivery_module.createNode(@$NODE_CONFIG)" \ + -c "delivery_module.start()" \ + -c "delivery_module.setRlnConfig($CONFIG_ACCOUNT,$i)" \ + -c "delivery_module.subscribe($CONTENT_TOPIC)" \ + "$LOG_FILE" 2>&1) & + EXPECTED_CALLS=5 + NODE_PID=$!; INSTANCE_PIDS+=($NODE_PID) + wait_method_calls "$LOG_FILE" "$EXPECTED_CALLS" 90 1 || true + if [ "${N:-0}" -ge "$EXPECTED_CALLS" ]; then + log " Node $i ready ($N/$EXPECTED_CALLS calls) PID: $NODE_PID" + else + echo " WARNING: Node $i: $N/$EXPECTED_CALLS calls" + fi + sleep "$NODE_STARTUP_SLEEP" +done +echo "" + +# ---------- Phase 5: Chat module sender/receiver ---------- +echo "[5/6] Starting chat module instances..." + +# Wait for all nodes ready (gifter registrations finalize during startup). +for i in $(seq 0 $((NUM_NODES - 1))); do + wait_method_calls "$STATE_DIR/node${i}.log" 5 120 2 || true +done + +# Wait for RLN root convergence. Mix pool is seeded from each node's +# mixNodes config (processBootNodes), so kademlia isn't required for routing — +# the kad-peer count is logged only for diagnostics. +echo " Waiting for kademlia propagation + RLN convergence..." +KADEMLIA_T0=$SECONDS +# Block chat startup until every mix hop has RLN credentials confirmed +# on-chain — unregistered hops drop sphinx packets (Plugin not ready). +REQUIRED_CLIENT_REGS=$((NUM_NODES - 1)) +while true; do + ELAPSED=$((SECONDS - KADEMLIA_T0)) + GR=$(sed 's/\x1b\[[0-9;]*m//g' "$STATE_DIR/node0.log" 2>/dev/null | grep -c "RLN gifter registration succeeded" || true); GR=${GR:-0} + SELF=$(sed 's/\x1b\[[0-9;]*m//g' "$STATE_DIR/node0.log" 2>/dev/null | grep -c "Gifter self-registered as mix relay" || true); SELF=${SELF:-0} + LR=0 + MIX_PEERS_PER_NODE="" + for i in $(seq 0 $((NUM_NODES - 1))); do + LOG="$STATE_DIR/node${i}.log" + L=$(sed 's/\x1b\[[0-9;]*m//g' "$LOG" 2>/dev/null | grep -c "Polled valid roots\|Fetched roots from\|valid_roots\|OnchainLEZGroupManager initialized\|Wired LEZ callbacks" || true) + LR=$((LR + L)) + MP=$(sed 's/\x1b\[[0-9;]*m//g' "$LOG" 2>/dev/null | grep -c "mix peer added via kademlia lookup" || true); MP=${MP:-0} + MIX_PEERS_PER_NODE="${MIX_PEERS_PER_NODE}n${i}=${MP} " + done + if [ "$ELAPSED" -ge "$KADEMLIA_MIN_WAIT" ] && [ "$GR" -ge "$REQUIRED_CLIENT_REGS" ] && [ "$SELF" -ge 1 ] && [ "$LR" -ge 40 ]; then break; fi + [ "$ELAPSED" -ge "$KADEMLIA_HARD_CAP" ] && break + sleep 1 +done +log " Kademlia ready after $((SECONDS - KADEMLIA_T0))s ($GR/$REQUIRED_CLIENT_REGS client regs, self=$SELF, $LR LEZ root events, kad mix peers: $MIX_PEERS_PER_NODE)" + +RECEIVER_LOG="$STATE_DIR/chat_receiver.log" +SENDER_LOG="$STATE_DIR/chat_sender.log" + +# Build mix node list (multiaddr:mixPubKey) for chat config. +MIXNODE_LIST="" +for j in $(seq 0 $((NUM_NODES - 1))); do + [ -n "$MIXNODE_LIST" ] && MIXNODE_LIST="$MIXNODE_LIST," + MIXNODE_LIST="$MIXNODE_LIST\"/ip4/127.0.0.1/tcp/$((BASE_TCP_PORT + j))/p2p/${PEER_IDS[$j]}:${MIX_PUBKEYS[$j]}\"" +done + +# Stage wallet + RLN + chat modules for a logoscore instance. +stage_chat_module() { + local MDIR=$1 + mkdir -p "$MDIR/liblogos_execution_zone_wallet_module" + cp -L "$WALLET_MODULE/liblogos_execution_zone_wallet_module.$EXT" "$MDIR/liblogos_execution_zone_wallet_module/" + [ -f "$WALLET_MODULE/libwallet_ffi.$EXT" ] && cp -L "$WALLET_MODULE/libwallet_ffi.$EXT" "$MDIR/liblogos_execution_zone_wallet_module/" + echo "{\"name\":\"liblogos_execution_zone_wallet_module\",\"version\":\"1.0.0\",\"type\":\"core\",\"main\":{\"$PLATFORM\":\"liblogos_execution_zone_wallet_module.$EXT\"},\"dependencies\":[],\"capabilities\":[]}" > "$MDIR/liblogos_execution_zone_wallet_module/manifest.json" + + mkdir -p "$MDIR/liblogos_rln_module" + cp -L "$RLN_MODULE/liblogos_rln_module.$EXT" "$MDIR/liblogos_rln_module/" + cp -L "$RLN_MODULE/liblez_rln_ffi.$EXT" "$MDIR/liblogos_rln_module/" 2>/dev/null || true + echo "{\"name\":\"liblogos_rln_module\",\"version\":\"1.0.0\",\"type\":\"core\",\"main\":{\"$PLATFORM\":\"liblogos_rln_module.$EXT\"},\"dependencies\":[\"liblogos_execution_zone_wallet_module\"],\"capabilities\":[]}" > "$MDIR/liblogos_rln_module/manifest.json" + + mkdir -p "$MDIR/chat_module" + cp -L "$CHAT_PLUGIN" "$MDIR/chat_module/" + cp -L "$CHAT_LIB" "$MDIR/chat_module/" + echo "{\"name\":\"chat_module\",\"version\":\"1.0.0\",\"type\":\"core\",\"main\":{\"$PLATFORM\":\"chat_module_plugin.$EXT\"},\"dependencies\":[],\"capabilities\":[]}" > "$MDIR/chat_module/manifest.json" +} + +CHAT_LOAD_ORDER="liblogos_execution_zone_wallet_module,liblogos_rln_module,chat_module" + +# --- Receiver --- +RECV_MDIR=$(mktemp -d); MODULES_DIRS+=("$RECV_MDIR") +stage_chat_module "$RECV_MDIR" + +RECV_CONFIG="$STATE_DIR/chat_receiver_config.json" +# Static peers so chat nodes join the relay mesh. +CHAT_STATIC_PEERS="" +for j in $(seq 0 $((NUM_NODES - 1))); do + [ -n "$CHAT_STATIC_PEERS" ] && CHAT_STATIC_PEERS="$CHAT_STATIC_PEERS," + CHAT_STATIC_PEERS="$CHAT_STATIC_PEERS\"/ip4/127.0.0.1/tcp/$((BASE_TCP_PORT + j))/p2p/${PEER_IDS[$j]}\"" +done +cat > "$RECV_CONFIG" <"$RECEIVER_LOG" 2>&1) & +RECEIVER_PID=$!; INSTANCE_PIDS+=($RECEIVER_PID) +log " Receiver PID: $RECEIVER_PID" + +RECV_EXPECTED=6 +wait_method_calls "$RECEIVER_LOG" "$RECV_EXPECTED" 180 2 || true +log " Receiver method calls: $N/$RECV_EXPECTED" + +# Extract intro bundle (emitted as chatCreateIntroBundleResult). +INTRO_BUNDLE="" +for t in $(seq 1 30); do + INTRO_BUNDLE=$(grep -oE 'logos_chatintro_[A-Za-z0-9_-]+' "$RECEIVER_LOG" 2>/dev/null | head -1 || true) + [ -n "$INTRO_BUNDLE" ] && break; sleep 2 +done +if [ -n "$INTRO_BUNDLE" ]; then + log " Receiver intro bundle: ${INTRO_BUNDLE:0:40}..." +else + log " WARNING: Could not extract intro bundle from receiver log" +fi + +# Wait for async startChat (Waku client started) + a floor for the filter +# subscription to propagate through the relay mesh. +echo " Waiting for receiver to join mix network..." +JOIN_T0=$SECONDS +while true; do + ELAPSED=$((SECONDS - JOIN_T0)) + RS=$(grep -c "Waku client started" "$RECEIVER_LOG" 2>/dev/null || true); RS=${RS:-0} + [ "$ELAPSED" -ge "$RECEIVER_MIN_WAIT" ] && [ "$RS" -ge 1 ] && break + [ "$ELAPSED" -ge 60 ] && break + sleep 1 +done +log " Receiver joined after $((SECONDS - JOIN_T0))s" + +# --- Sender --- +SEND_MDIR=$(mktemp -d); MODULES_DIRS+=("$SEND_MDIR") +stage_chat_module "$SEND_MDIR" + +SEND_CONFIG="$STATE_DIR/chat_sender_config.json" +cat > "$SEND_CONFIG" <\"$SENDER_LOG\" 2>&1) &" +SENDER_PID=$!; INSTANCE_PIDS+=($SENDER_PID) +log " Sender PID: $SENDER_PID" + +SEND_EXPECTED=6 +[ -n "$INTRO_BUNDLE" ] && SEND_EXPECTED=7 +wait_method_calls "$SENDER_LOG" "$SEND_EXPECTED" 180 2 || true + +# On slower systems (Docker/ARM) the sender's async gifter registration may +# trail newPrivateConversation. Wait for RLN readiness; the Nim async code +# retries newPrivateConversation once credentials land. +echo " Waiting for sender RLN readiness..." +SENDER_RLN_T0=$SECONDS +for t in $(seq 1 60); do + SG=$(sed 's/\x1b\[[0-9;]*m//g' "$SENDER_LOG" 2>/dev/null | grep -c "Registered via RLN gifter\|Waku client started" || true) + [ "${SG:-0}" -ge 2 ] && break + sleep 1 +done +log " Sender RLN ready after $((SECONDS - SENDER_RLN_T0))s" +N=$(grep -c '^Method call successful' "$SENDER_LOG" 2>/dev/null || true); N=${N:-0} +log " Sender method calls: $N/$SEND_EXPECTED" + +# Poll receiver log for delivery. +echo " Waiting for message delivery via mix..." +DELIVERY_T0=$SECONDS +for t in $(seq 1 $DELIVERY_TIMEOUT); do + RM=$(grep -c "chatNewMessage\|chatNewConversation\|New Message\|new_message" "$RECEIVER_LOG" 2>/dev/null || true); RM=${RM:-0} + [ "$RM" -ge 1 ] && break + sleep 1 +done +log " Delivery check after $((SECONDS - DELIVERY_T0))s (messages: $RM)" + +echo "" + +# ---------- Phase 6: Verify ---------- +echo "[6/6] Verification"; echo "" +PASS=0; FAIL=0 +check() { local c=$1 d=$2; if eval "$c"; then echo " PASS: $d"; PASS=$((PASS+1)); else echo " FAIL: $d"; FAIL=$((FAIL+1)); fi; } + +echo " --- logos-core mix nodes ---" +for i in $(seq 0 $((NUM_NODES - 1))); do + M=$(sed 's/\x1b\[[0-9;]*m//g' "$STATE_DIR/node${i}.log" 2>/dev/null | grep -c "mounting mix protocol" || true) + check "[ ${M:-0} -ge 1 ]" "Node $i mounted mix ($M)" +done +echo "" + +echo " --- RLN gifter ---" +GIFTER_MOUNTED=$(sed 's/\x1b\[[0-9;]*m//g' "$STATE_DIR/node0.log" 2>/dev/null | grep -c "RLN gifter service mounted" || true) +check "[ ${GIFTER_MOUNTED:-0} -ge 1 ]" "Node 0 gifter service mounted ($GIFTER_MOUNTED)" +echo "" + +echo " --- LEZ RLN ---" +LEZ_ROOTS=0 +for i in $(seq 0 $((NUM_NODES - 1))); do + R=$(sed 's/\x1b\[[0-9;]*m//g' "$STATE_DIR/node${i}.log" 2>/dev/null | grep -c "Polled valid roots\|Fetched roots from\|valid_roots\|OnchainLEZGroupManager initialized\|Wired LEZ callbacks" || true) + LEZ_ROOTS=$((LEZ_ROOTS + R)) +done +check "[ $LEZ_ROOTS -ge 1 ]" "LEZ RLN active ($LEZ_ROOTS events across nodes)" +echo "" + +echo " --- chat module ---" +RECV_INIT=$(grep -c "chatInitResult\|Chat context created" "$RECEIVER_LOG" 2>/dev/null || true) +check "[ ${RECV_INIT:-0} -ge 1 ]" "Receiver initialized ($RECV_INIT)" +RECV_START=$(grep -c "chatStartResult\|Waku client started" "$RECEIVER_LOG" 2>/dev/null || true) +check "[ ${RECV_START:-0} -ge 1 ]" "Receiver started ($RECV_START)" +SEND_INIT=$(grep -c "chatInitResult\|Chat context created" "$SENDER_LOG" 2>/dev/null || true) +check "[ ${SEND_INIT:-0} -ge 1 ]" "Sender initialized ($SEND_INIT)" +SEND_START=$(grep -c "chatStartResult\|Waku client started" "$SENDER_LOG" 2>/dev/null || true) +check "[ ${SEND_START:-0} -ge 1 ]" "Sender started ($SEND_START)" + +RECV_MIX=$(grep -c "mounting mix protocol\|Wired LEZ callbacks" "$RECEIVER_LOG" 2>/dev/null || true) +check "[ ${RECV_MIX:-0} -ge 1 ]" "Receiver mounted mix+LEZ ($RECV_MIX)" +SEND_MIX=$(grep -c "mounting mix protocol\|Wired LEZ callbacks" "$SENDER_LOG" 2>/dev/null || true) +check "[ ${SEND_MIX:-0} -ge 1 ]" "Sender mounted mix+LEZ ($SEND_MIX)" + +RECV_BUNDLE=$(grep -c "logos_chatintro_" "$RECEIVER_LOG" 2>/dev/null || true) +check "[ ${RECV_BUNDLE:-0} -ge 1 ]" "Receiver created intro bundle ($RECV_BUNDLE)" +echo "" + +echo " --- message exchange ---" +SEND_MSG=$(grep -c "chatNewPrivateConversationResult\|chatSendMessageResult\|Message sent via mix" "$SENDER_LOG" 2>/dev/null || true) +check "[ ${SEND_MSG:-0} -ge 1 ]" "Sender sent message ($SEND_MSG)" +RECV_MSG=$(grep -c "chatNewMessage\|chatNewConversation\|New Message\|new_message" "$RECEIVER_LOG" 2>/dev/null || true) +check "[ ${RECV_MSG:-0} -ge 1 ]" "Receiver received message ($RECV_MSG)" + +echo ""; echo " ==========================================" +if [ "$FAIL" -eq 0 ]; then echo " ALL $PASS CHECKS PASSED"; EXIT_CODE=0 +else echo " $FAIL FAILED, $PASS passed"; EXIT_CODE=1; fi +echo " ==========================================" diff --git a/simulations/mix_lez_chat/setup_and_run.sh b/simulations/mix_lez_chat/setup_and_run.sh new file mode 100755 index 0000000..ede0b4d --- /dev/null +++ b/simulations/mix_lez_chat/setup_and_run.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +# One-shot: init nested submodules, build all modules, run mix+LEZ chat sim. +# +# Prerequisites: nix (with flakes), Docker, cargo-risczero. +# +# Environment variables: +# CHAT_MODULE_DIR — path to logos-chat-module checkout (default: ../logos-chat-module) +# CHAT_MODULE_REPO — git URL to clone if CHAT_MODULE_DIR doesn't exist +# CHAT_MODULE_BRANCH — branch to clone (default: feat/logos-delivery) +# SIM_* — simulation parameters, see run_simulation.sh / README.md +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +CHAT_MODULE_DIR="${CHAT_MODULE_DIR:-$ROOT/../logos-chat-module}" +CHAT_MODULE_REPO="${CHAT_MODULE_REPO:-git@github.com:adklempner/logos-chat-module.git}" +CHAT_MODULE_BRANCH="${CHAT_MODULE_BRANCH:-feat/logos-delivery}" + +log() { echo "[$(date '+%H:%M:%S')] $*"; } + +cd "$ROOT" + +# Docker/CI: nix can't sandbox inside containers. Remove /homeless-shelter +# (nix's sandbox HOME stub) and export NIX_CONFIG to disable sandboxing. +if [ -f /.dockerenv ] || grep -q docker /proc/1/cgroup 2>/dev/null; then + rmdir /homeless-shelter 2>/dev/null || true + export NIX_CONFIG="sandbox = false +${NIX_CONFIG:-}" +fi + +# On Linux with nix, bindgen (used by rocksdb/sequencer) needs LIBCLANG_PATH +# and system headers. This covers both Docker and native nix-on-Linux. +if [ "$(uname -s)" = "Linux" ] && [ -d /nix/store ] && [ -z "${LIBCLANG_PATH:-}" ]; then + CLANG_SO=$(find /nix/store -maxdepth 3 -name 'libclang.so' 2>/dev/null | head -1 || true) + if [ -n "$CLANG_SO" ]; then + export LIBCLANG_PATH=$(dirname "$CLANG_SO") + STDBOOL=$(find "$LIBCLANG_PATH" -maxdepth 5 -name 'stdbool.h' 2>/dev/null | head -1 || true) + [ -n "$STDBOOL" ] && export BINDGEN_EXTRA_CLANG_ARGS="-I$(dirname "$STDBOOL")" + fi + log "Docker detected — disabled nix sandbox, LIBCLANG_PATH=$LIBCLANG_PATH" +fi + +# 1. Init submodules. Top-level first (non-recursive to avoid circular refs +# in vendor/logos-lez-rln), then nwaku/nimbus-build-system recursively, +# then logos-lez-rln's nested submodules selectively. +log "Initializing top-level submodules..." +git submodule update --init +(cd vendor/nwaku && git submodule update --init --recursive) +(cd vendor/nimbus-build-system && git submodule update --init --recursive) + +# Init nested submodules inside vendor/logos-lez-rln non-recursively +# (recursive init hits circular submodule references). +# Preserve pre-built guest binaries across submodule reset (they're +# architecture-independent RISC-V ELFs that take ~10min to rebuild). +GUEST_DIR="vendor/logos-lez-rln/lez-rln/methods/guest/target/riscv32im-risc0-zkvm-elf/docker" +# Check repo tree first, then /tmp/guest-bins/ (staged by run_in_docker.sh) +GUEST_TMP="" +if [ -f "$GUEST_DIR/rln_registration.bin" ]; then + GUEST_TMP=$(mktemp -d) + cp "$GUEST_DIR"/*.bin "$GUEST_TMP/" + log "Preserved guest binaries from repo" +elif [ -f "/tmp/guest-bins/rln_registration.bin" ]; then + GUEST_TMP="/tmp/guest-bins" + log "Using guest binaries from /tmp/guest-bins/" +fi +log "Initializing nested submodules in vendor/logos-lez-rln..." +# Slim default: only logos-delivery-module (+ its nested logos-delivery) is +# required to build the chat/delivery/mix Nim modules. lssa and +# logos-execution-zone-module are fetched via flake.nix from GitHub when nix +# builds the wallet/rln modules, so the local clones aren't needed unless the +# dev is running a local sequencer (SIM_NETWORK=local) or hacking those repos. +SUBMODS=(logos-delivery-module) +if [ "${SIM_NETWORK:-testnet}" = "local" ] || [ "${SIM_FULL_SUBMODS:-0}" = "1" ]; then + SUBMODS+=(lssa logos-execution-zone-module) +fi +(cd vendor/logos-lez-rln && \ + git submodule update --init "${SUBMODS[@]}" && \ + git checkout -- . && \ + for d in "${SUBMODS[@]}"; do \ + (cd "$d" && git checkout -- .); \ + done && \ + cd logos-delivery-module && git submodule update --init vendor/logos-delivery) +if [ -d "${GUEST_TMP:-}" ]; then + mkdir -p "$GUEST_DIR" + cp "$GUEST_TMP"/*.bin "$GUEST_DIR/" + rm -rf "$GUEST_TMP" + log "Restored guest binaries" +fi + +# 2. Build LEZ modules (RLN, wallet, delivery plugin, guest zkVM binaries). +log "Building LEZ modules via vendor/logos-lez-rln/build_all.sh..." +bash vendor/logos-lez-rln/build_all.sh + +# 3. Build liblogoschat (Nim shared library). +log "Building liblogoschat..." +make update +make liblogoschat + +# 4. Clone and build logos-chat-module (C++ Qt plugin). +if [ ! -d "$CHAT_MODULE_DIR" ]; then + log "Cloning logos-chat-module to $CHAT_MODULE_DIR..." + git clone -b "$CHAT_MODULE_BRANCH" "$CHAT_MODULE_REPO" "$CHAT_MODULE_DIR" +fi +log "Building logos-chat-module..." +(cd "$CHAT_MODULE_DIR" && nix build) + +# 5. Run the simulation. +log "Starting mix+LEZ chat simulation..." +exec bash "$ROOT/simulations/mix_lez_chat/run_simulation.sh" --fresh "$@" diff --git a/src/chat/client.nim b/src/chat/client.nim index 5f86422..ea54ca5 100644 --- a/src/chat/client.nim +++ b/src/chat/client.nim @@ -145,10 +145,17 @@ proc createIntroBundle*(self: ChatClient): seq[byte] = notice "IntroBundleCreated", client = self.getId(), bundle = result +proc sendPayloadWatched( + ds: WakuClient, contentTopic: string, data: seq[byte] +) {.async.} = + try: + await ds.sendBytes(contentTopic, data) + except CatchableError as e: + error "sendBytes failed", contentTopic = contentTopic, err = e.msg + proc sendPayloads(ds: WakuClient, payloads: seq[PayloadResult]) = for payload in payloads: - # TODO: (P2) surface errors - discard ds.sendBytes(payload.address, payload.data) + asyncSpawn sendPayloadWatched(ds, payload.address, payload.data) ################################################# @@ -237,7 +244,7 @@ proc messageQueueConsumer(client: ChatClient) {.async.} = proc start*(client: ChatClient) {.async.} = ## Start `ChatClient` and listens for incoming messages. client.ds.addDispatchQueue(client.inboundQueue) - asyncSpawn client.ds.start() + await client.ds.start() client.isRunning = true diff --git a/src/chat/delivery/waku_client.nim b/src/chat/delivery/waku_client.nim index 4ecc099..f3ab8ff 100644 --- a/src/chat/delivery/waku_client.nim +++ b/src/chat/delivery/waku_client.nim @@ -2,10 +2,18 @@ import chronicles, chronos, confutils, + eth/common/addresses as eth_addresses, + eth/common/keys as eth_keys, eth/p2p/discoveryv5/enr as eth_enr, libp2p/crypto/crypto, + libp2p/crypto/curve25519, libp2p/peerid, - std/random, + libp2p/protocols/mix, + libp2p/protocols/mix/curve25519 as mix_curve25519, + libp2p/protocols/mix/entry_connection, + libp2p/protocols/mix/mix_protocol as mix_proto, + nimcrypto/utils as ncrutils, + std/[random, strutils], stew/byteutils, strformat, waku/[ @@ -13,13 +21,22 @@ import common/enr as common_enr, node/peer_manager, waku_core, + waku_core/codecs, waku_node, waku_enr, + waku_mix/protocol as waku_mix_protocol, + waku_mix/logos_core_client as mix_lez_client, + waku_lightpush/client as lightpush_client, discovery/waku_discv5, discovery/waku_dnsdisc, factory/builder, waku_filter_v2/client, - ] + waku_rln_relay/rln_gifter/client as rln_gifter_client, + waku_rln_relay/rln_gifter/protocol as rln_gifter_protocol, + ], + mix_rln_spam_protection/onchain_group_manager, + mix_rln_spam_protection/rln_interface as mix_rln_interface, + mix_rln_spam_protection/spam_protection logScope: @@ -40,6 +57,7 @@ proc toChatPayload*(msg: WakuMessage, pubsubTopic: PubsubTopic): ChatPayload = const # Placeholder FilterContentTopic = ContentTopic("/chatsdk/test/proto") + LibchatDeliveryAddress = ContentTopic("delivery_address") ## Logos.dev Fleet ENRs @@ -77,12 +95,18 @@ type QueueRef* = ref object type WakuConfig* = object - nodekey*: crypto.PrivateKey # TODO: protect key exposure + nodekey*: crypto.PrivateKey # TODO: protect key exposure port*: uint16 clusterId*: uint16 shardId*: seq[uint16] pubsubTopic*: string staticPeers*: seq[string] + mixEnabled*: bool + mixNodes*: seq[string] + destPeerAddr*: string + minMixPoolSize*: int + gifterNodeAddr*: string + gifterAuthKey*: string type WakuClient* = ref object @@ -90,6 +114,8 @@ type node*: WakuNode dispatchQueues: seq[QueueRef] staticPeerList: seq[RemotePeerInfo] + mixReady*: bool + destPeerId: PeerId proc DefaultConfig*(): WakuConfig = @@ -100,17 +126,121 @@ proc DefaultConfig*(): WakuConfig = result = WakuConfig(nodeKey: nodeKey, port: port, clusterId: clusterId, shardId: @[shardId], pubsubTopic: &"/waku/2/rs/{clusterId}/{shardId}", - staticPeers: LogosDevStaticPeers) + staticPeers: LogosDevStaticPeers, + mixEnabled: false, mixNodes: @[], destPeerAddr: "", minMixPoolSize: 4, + gifterNodeAddr: "", + gifterAuthKey: "") proc sendBytes*(client: WakuClient, contentTopic: string, bytes: seq[byte]) {.async.} = - let msg = WakuMessage(contentTopic: contentTopic, payload: bytes) - let res = await client.node.publish(some(PubsubTopic(client.cfg.pubsubTopic)), msg) - if res.isErr: - error "Failed to Publish", err = res.error, - pubsubTopic = client.cfg.pubsubTopic + + if client.cfg.mixEnabled: + # Wait for mix pool to be ready before sending + while not client.mixReady: + info "Waiting for mix pool before sending..." + await sleepAsync(2.seconds) + + # Wait for RLN spam protection to be ready (roots + proofs fetched from LEZ) + if not client.node.wakuMix.isNil: + var attempts = 0 + while not client.node.wakuMix.mixRlnSpamProtection.isReady() and attempts < 45: + if attempts mod 5 == 0: + info "Waiting for RLN spam protection readiness...", attempt = attempts + await sleepAsync(2.seconds) + attempts += 1 + if client.node.wakuMix.mixRlnSpamProtection.isReady(): + let gm = client.node.wakuMix.mixRlnSpamProtection.groupManager + if gm of OnchainLEZGroupManager: + let lezGm = OnchainLEZGroupManager(gm) + let pollMs = lezGm.getPollInterval().milliseconds + let stableMs = max(pollMs * 2, 5000) + let probeMs = max(pollMs div 4, 1000) + # The gifter serializes registrations through a worker; on slow + # chains the chat sender may sit at the tail of a queue of up to + # ~6 other registrations, each waiting up to confirmDeadlineMs + # (300s) for chain commit. Budget enough headroom that we don't + # publish against an un-corrected optimistic leaf. + let deadlineMs = 1_500_000 + + # Phase 1: wait for the watcher to confirm our registration on + # chain plus a cushion of 2 poll intervals, so peers have had + # time to fetch the post-registration root. Without this, a + # first publish issued right after the gifter's optimistic + # response can carry a root mix peers haven't seen yet. + let cushionMs = max(pollMs * 2, 10_000) + let confirmDeadline = Moment.now() + chronos.milliseconds(deadlineMs) + info "Waiting for membership confirmation + propagation cushion", + cushionMs = cushionMs, pollMs = pollMs + var confirmedSeen = false + while Moment.now() < confirmDeadline: + let confirmedAt = lezGm.membershipConfirmedAt() + if confirmedAt.isSome: + let elapsedMs = (Moment.now() - confirmedAt.get()).milliseconds + if elapsedMs >= cushionMs: + confirmedSeen = true + break + await sleepAsync(chronos.milliseconds(probeMs)) + if confirmedSeen: + info "Membership confirmed + cushion elapsed" + else: + warn "Membership confirmation did not arrive within deadline, publishing anyway", + deadlineMs = deadlineMs + + # Phase 2: defensive — wait until our proof's merkle root has + # been in our own validRoots window for 2 full poll cycles. + # Catches the rare case where the watcher confirmed but the + # poll loop hasn't yet caught up to the matching proof root. + info "Waiting for proof root to stabilize in valid_roots", + pollMs = pollMs, stableMs = stableMs + var lastRoot = lezGm.proofRoot() + var stableSince = Moment.now() + let deadline = Moment.now() + chronos.milliseconds(deadlineMs) + var settled = false + while Moment.now() < deadline: + await sleepAsync(chronos.milliseconds(probeMs)) + let cur = lezGm.proofRoot() + if cur != lastRoot: + lastRoot = cur + stableSince = Moment.now() + continue + if cur.isSome and lezGm.rootTracker.containsRoot(cur.get()): + if Moment.now() - stableSince >= chronos.milliseconds(stableMs): + settled = true + break + if settled: + info "Proof root stable in valid_roots, proceeding to publish" + else: + warn "Proof root did not stabilize within deadline, publishing anyway", + deadlineMs = deadlineMs + else: + info "RLN spam protection ready (non-LEZ), waiting 30s for root convergence" + await sleepAsync(30.seconds) + else: + warn "RLN spam protection not ready after timeout, sending anyway" + + if client.cfg.mixEnabled and client.mixReady: + info "Sending via mix (lightpushPublish)", contentTopic = contentTopic, mixPoolSize = client.node.getMixNodePoolSize() + let publishFut = client.node.lightpushPublish( + some(PubsubTopic(client.cfg.pubsubTopic)), msg, none(RemotePeerInfo), mixify = true + ) + if not await publishFut.withTimeout(15.seconds): + await publishFut.cancelAndWait() + error "Mix lightpush timed out (no SURB reply within deadline)" + else: + let res = publishFut.read() + if res.isErr: + error "Failed to publish via mix", err = $res.error + else: + info "Message sent via mix successfully" + else: + warn "Sending via relay fallback (mix not ready or not enabled)", + mixEnabled = client.cfg.mixEnabled, mixReady = client.mixReady + let res = await client.node.publish(some(PubsubTopic(client.cfg.pubsubTopic)), msg) + if res.isErr: + error "Failed to Publish", err = res.error, + pubsubTopic = client.cfg.pubsubTopic proc buildWakuNode(cfg: WakuConfig): WakuNode = let @@ -145,6 +275,38 @@ proc buildWakuNode(cfg: WakuConfig): WakuNode = result = node +proc splitPeerIdAndAddr(maddr: string): (string, string) = + let parts = maddr.split("/p2p/") + if parts.len != 2: + error "Invalid multiaddress format", maddr = maddr + return ("", "") + return (parts[0], parts[1]) + +proc parseMixNodes(nodeStrs: seq[string]): seq[MixNodePubInfo] = + for nodeStr in nodeStrs: + let elements = nodeStr.split(":") + if elements.len != 2: + error "Invalid mixnode format, expected multiaddr:mixPubKeyHex", node = nodeStr + continue + result.add(MixNodePubInfo( + multiAddr: elements[0], + pubKey: intoCurve25519Key(ncrutils.fromHex(elements[1])) + )) + +proc waitForMixPool(client: WakuClient) {.async.} = + while client.node.getMixNodePoolSize() < client.cfg.minMixPoolSize: + info "Waiting for mix node pool", + current = client.node.getMixNodePoolSize(), + required = client.cfg.minMixPoolSize + await sleepAsync(1000.milliseconds) + client.mixReady = true + notice "Mix node pool ready", poolSize = client.node.getMixNodePoolSize() + +proc getMixPoolSize*(client: WakuClient): int = + if client.cfg.mixEnabled: + return client.node.getMixNodePoolSize() + return 0 + proc taskKeepAlive(client: WakuClient) {.async.} = while true: for peerInfo in client.staticPeerList: @@ -157,7 +319,7 @@ proc taskKeepAlive(client: WakuClient) {.async.} = # TODO: Use filter. Removing this stops relay from working so keeping for now let subscribeRes = await client.node.wakuFilterClient.subscribe( - peerInfo, client.cfg.pubsubTopic, @[FilterContentTopic] + peerInfo, client.cfg.pubsubTopic, @[FilterContentTopic, LibchatDeliveryAddress] ) if subscribeRes.isErr(): @@ -170,65 +332,6 @@ proc taskKeepAlive(client: WakuClient) {.async.} = await sleepAsync(60.seconds) # Subscription maintenance interval -proc start*(client: WakuClient) {.async.} = - setupLog(logging.LogLevel.NOTICE, logging.LogFormat.TEXT) - await client.node.mountFilter() - await client.node.mountFilterClient() - - await client.node.start() - (await client.node.mountRelay()).isOkOr: - error "failed to mount relay", error = error - quit(1) - - client.node.peerManager.start() - - # Connect to all configured static peers - if client.staticPeerList.len > 0: - info "Connecting to static peers", peerCount = client.staticPeerList.len - asyncSpawn client.node.connectToNodes(client.staticPeerList) - else: - warn "No valid static peers configured" - - let subscription: SubscriptionEvent = (kind: PubsubSub, topic: - client.cfg.pubsubTopic) - - proc handler(topic: PubsubTopic, msg: WakuMessage): Future[void] {.async, gcsafe.} = - let payloadStr = string.fromBytes(msg.payload) - debug "message received", - pubsubTopic = topic, - contentTopic = msg.contentTopic - - let payload = msg.toChatPayload(topic) - - for queueRef in client.dispatchQueues: - await queueRef.queue.put(payload) - - let res = subscribe(client.node, subscription, handler) - if res.isErr: - error "Subscribe failed", err = res.error - - await allFutures(taskKeepAlive(client)) - -proc initWakuClient*(cfg: WakuConfig): WakuClient = - # Parse ENRs from static peers configuration - var peerInfos: seq[RemotePeerInfo] = @[] - for enrStr in cfg.staticPeers: - let enrRecord = eth_enr.Record.fromURI(enrStr).valueOr: - error "Failed to parse ENR in initWakuClient", enr = enrStr, err = error - continue - - let peerInfo = enrRecord.toRemotePeerInfo().valueOr: - error "Failed to convert ENR to PeerInfo in initWakuClient", enr = enrStr, err = error - continue - - peerInfos.add(peerInfo) - - result = WakuClient(cfg: cfg, node: buildWakuNode(cfg), dispatchQueues: @[], - staticPeerList: peerInfos) - -proc addDispatchQueue*(client: var WakuClient, queue: QueueRef) = - client.dispatchQueues.add(queue) - proc getConnectedPeerCount*(client: WakuClient): int = var count = 0 for peerId, peerInfo in client.node.peerManager.switch.peerStore.peers: @@ -236,5 +339,195 @@ proc getConnectedPeerCount*(client: WakuClient): int = inc count return count +proc start*(client: WakuClient) {.async.} = + setupLog(logging.LogLevel.NOTICE, logging.LogFormat.TEXT) + await client.node.mountFilter() + await client.node.mountFilterClient() + + client.node.mountAutoSharding(client.cfg.clusterId, uint32(client.cfg.shardId.len)).isOkOr: + error "failed to mount auto sharding", error = error + + if client.cfg.mixEnabled: + let (mixPrivKey, mixPubKey) = mix_curve25519.generateKeyPair().valueOr: + error "Failed to generate mix key pair", error = error + quit(QuitFailure) + let mixNodeInfos = parseMixNodes(client.cfg.mixNodes) + client.node.mountLightPushClient() + (await client.node.mountMix(client.cfg.clusterId, mixPrivKey, mixNodeInfos, + useOnchainLEZ = true)).isOkOr: + error "Failed to mount mix protocol", error = $error + quit(QuitFailure) + + # Wire LEZ callbacks BEFORE node.start() so spam protection can initialize + if client.cfg.mixEnabled and not client.node.wakuMix.isNil: + let gm = client.node.wakuMix.mixRlnSpamProtection.groupManager + if gm of OnchainLEZGroupManager: + let lezGm = OnchainLEZGroupManager(gm) + let clientFetchRoots = mix_lez_client.makeFetchLatestRoots() + let clientFetchProof = mix_lez_client.makeFetchMerkleProof() + let fetchRoots: onchain_group_manager.FetchRootsCallback = clientFetchRoots + let fetchProof: onchain_group_manager.FetchProofCallback = clientFetchProof + lezGm.setFetchCallbacks(fetchRoots, fetchProof) + mix_lez_client.setGroupManagerRef(lezGm) + info "Wired LEZ callbacks for mix RLN spam protection" + + let (_, destId) = splitPeerIdAndAddr(client.cfg.destPeerAddr) + client.destPeerId = PeerId.init(destId).valueOr: + error "Failed to parse destination peer ID", error = error + quit(QuitFailure) + asyncSpawn client.waitForMixPool() + + await client.node.start() + + client.node.peerManager.start() + + # Register filter push handler for incoming messages (no relay/gossipsub needed) + proc filterHandler(pubsubTopic: PubsubTopic, msg: WakuMessage) {.async, gcsafe.} = + debug "filter message received", + pubsubTopic = pubsubTopic, + contentTopic = msg.contentTopic + + let payload = msg.toChatPayload(pubsubTopic) + for queueRef in client.dispatchQueues: + await queueRef.queue.put(payload) + + client.node.wakuFilterClient.registerPushHandler(filterHandler) + + # Connect to all configured static peers + if client.staticPeerList.len > 0: + info "Connecting to static peers", peerCount = client.staticPeerList.len + await client.node.connectToNodes(client.staticPeerList) + info "Connected to static peers" + else: + warn "No valid static peers configured" + + if client.cfg.mixEnabled and client.cfg.gifterNodeAddr.len > 0 and + not client.node.wakuMix.isNil: + let gm = client.node.wakuMix.mixRlnSpamProtection.groupManager + if gm of OnchainLEZGroupManager: + let lezGm = OnchainLEZGroupManager(gm) + let gifterClient = rln_gifter_client.WakuRlnGifterClient.new( + client.node.peerManager, client.node.rng + ) + let gifterPeer = parsePeerInfo(client.cfg.gifterNodeAddr).valueOr: + error "Failed to parse gifter peer", error = error + quit(QuitFailure) + client.node.peerManager.addServicePeer(gifterPeer, WakuRlnGifterCodec) + + let idCred = + if lezGm.credentials.isSome: + lezGm.credentials.get() + else: + mix_rln_interface.membershipKeyGen().valueOr: + error "Failed to generate RLN identity", error = $error + quit(QuitFailure) + let idCommitmentBytes = @(idCred.idCommitment) + + info "Registering via RLN gifter", + gifterPeer = client.cfg.gifterNodeAddr, + identityCommitmentLen = idCommitmentBytes.len + + var authType: seq[byte] + var authPayload: seq[byte] + if client.cfg.gifterAuthKey.len > 0: + let seckey = eth_keys.PrivateKey.fromHex(client.cfg.gifterAuthKey).valueOr: + error "Failed to parse gifter auth key", error = $error + quit(QuitFailure) + let sig = seckey.sign(rln_gifter_protocol.eip191Message(idCommitmentBytes)) + authPayload = @(sig.toRaw()) + for c in rln_gifter_protocol.EthAllowlistAuthType: + authType.add(byte(c)) + info "Signing gifter request with EIP-191 auth key", + signer = seckey.toPublicKey().to(eth_addresses.Address).to0xHex() + + let regRes = await gifterClient.requestMembership( + idCommitmentBytes, + some(uint64(lezGm.userMessageLimit)), + gifterPeer, + authType, + authPayload, + ) + if regRes.isErr: + error "Failed to register via gifter", error = regRes.error + quit(QuitFailure) + let success = regRes.get() + + let configAccountId = success.configAccountId.valueOr: + error "Gifter response missing configAccountId extension" + quit(QuitFailure) + + lezGm.credentials = some(idCred) + lezGm.membershipIndex = some(onchain_group_manager.MembershipIndex(success.leafIndex)) + mix_lez_client.setRlnConfig(configAccountId, success.leafIndex.int) + + info "Registered via RLN gifter", + leafIndex = success.leafIndex, + configAccount = configAccountId + + # Correct the optimistic leaf via the status codec if a concurrent + # registration tx beat ours to the slot. Pre-publish self-verify drops + # bad proofs in the meantime. + let watcherLezGm = lezGm + let watcherConfigAccount = configAccountId + asyncSpawn gifterClient.watchMembershipConfirmation( + gifterPeer, configAccountId, idCommitmentBytes, success.leafIndex, + "Chat-client", + proc(authLeaf: uint64) {.gcsafe, raises: [].} = + if some(onchain_group_manager.MembershipIndex(authLeaf)) != + watcherLezGm.membershipIndex: + watcherLezGm.membershipIndex = + some(onchain_group_manager.MembershipIndex(authLeaf)) + mix_lez_client.setRlnConfig(watcherConfigAccount, authLeaf.int) + watcherLezGm.markMembershipConfirmed(), + ) + + asyncSpawn taskKeepAlive(client) + + if client.cfg.mixEnabled and not client.node.wakuMix.isNil: + let gm = client.node.wakuMix.mixRlnSpamProtection.groupManager + if gm of OnchainLEZGroupManager: + OnchainLEZGroupManager(gm).startPolling() + + info "Waku client started", + relayMounted = not client.node.wakuRelay.isNil, + mixMounted = not client.node.wakuMix.isNil, + connectedPeers = client.getConnectedPeerCount() + + # Debug: periodically log relay/mesh status + proc meshStatusTask(client: WakuClient) {.async.} = + while true: + await sleepAsync(15.seconds) + let connPeers = client.getConnectedPeerCount() + info "Peer status", + pubsubTopic = client.cfg.pubsubTopic, + connectedPeers = connPeers, + mixReady = client.mixReady, + mixPoolSize = (if client.cfg.mixEnabled and not client.node.wakuMix.isNil: client.node.getMixNodePoolSize() else: 0) + + asyncSpawn meshStatusTask(client) + +proc initWakuClient*(cfg: WakuConfig): WakuClient = + var peerInfos: seq[RemotePeerInfo] = @[] + for peerStr in cfg.staticPeers: + if peerStr.startsWith("/"): + let peerInfo = parsePeerInfo(peerStr).valueOr: + error "Failed to parse multiaddr peer", peer = peerStr, err = error + continue + peerInfos.add(peerInfo) + else: + let enrRecord = eth_enr.Record.fromURI(peerStr).valueOr: + error "Failed to parse ENR", enr = peerStr, err = error + continue + let peerInfo = enrRecord.toRemotePeerInfo().valueOr: + error "Failed to convert ENR to PeerInfo", enr = peerStr, err = error + continue + peerInfos.add(peerInfo) + + result = WakuClient(cfg: cfg, node: buildWakuNode(cfg), dispatchQueues: @[], + staticPeerList: peerInfos) + +proc addDispatchQueue*(client: var WakuClient, queue: QueueRef) = + client.dispatchQueues.add(queue) + proc stop*(client: WakuClient) {.async.} = await client.node.stop() diff --git a/vendor/logos-lez-rln b/vendor/logos-lez-rln new file mode 160000 index 0000000..950f287 --- /dev/null +++ b/vendor/logos-lez-rln @@ -0,0 +1 @@ +Subproject commit 950f2877c13a61d771561ce966ca2d4ea5ae28c1 diff --git a/vendor/nwaku b/vendor/nwaku index 41146a9..8e6ba04 160000 --- a/vendor/nwaku +++ b/vendor/nwaku @@ -1 +1 @@ -Subproject commit 41146a9193c1e360b9a0049d672260a72c4ca2bf +Subproject commit 8e6ba04d5c7bb1829cffbbb6e682461373246987