178 Commits

Author SHA1 Message Date
Arseniy Klempner
4dcd8ff8e2
cleanup(02-types): drop duplicate-type adapter procs + bump nwaku
waku_client.nim's adapter procs (copying logos_core_client's MerkleNode/
ExternalMerkleProof into the plugin's namesakes) are now trivial — the
types are unified via re-export. Collapse to direct callback assignments.
2026-05-21 13:25:21 -06:00
Arseniy Klempner
cbbf4b23ae
cleanup(01-dry): use watchMembershipConfirmation helper + bump nwaku
Replaces the duplicated watcher proc body with a single call to the
new gifter-client helper. Net change: 38-line inline watcher -> 10
lines invoking the helper. Bumps vendor/nwaku for the helper itself.
2026-05-21 12:17:56 -06:00
Arseniy Klempner
295b8d7933
feat(chat): membership status watcher + bump nwaku for 2-phase gifter
src/chat/delivery/waku_client.nim:
- After the gifter-client returns its optimistic leaf_index, spawn a
  background watcher that polls the gifter's new membership-status
  RPC (short-lived libp2p streams on /logos/rln/membership/status/
  1.0.0) until the on-chain membership PDA materialises for our id.
  If the authoritative leaf differs from the optimistic snapshot, the
  watcher rewrites lezGm.membershipIndex. The OnchainLEZGroupManager's
  poll loop picks up the corrected proof on its next iteration;
  spam_protection's self-verify rejects bad proofs until then.

vendor/nwaku bump pulls in:
- New /logos/rln/membership/status/1.0.0 codec + handlers on the
  gifter server.
- MembershipStatusRequest/Response RPC messages.
- WakuRlnGifterClient.queryMembershipStatus.
- Mix-node gifter-client watcher with the same pattern.
2026-05-21 11:15:17 -06:00
Arseniy Klempner
ef5a98317d
chore(rln-module): bump for atomic valid_roots in get_merkle_proofs
Picks up logos-rln-module C++ change to extract validRoots from the
same mainData buffer used to build the merkle proofs, embedding them
into each returned proof object as "valid_roots". Eliminates the
two-RPC race where chain state could advance between get_merkle_proofs
and a follow-up get_valid_roots, leaving the proof's root absent from
the polled window.
2026-05-20 21:13:53 -06:00
Arseniy Klempner
720867c2ef
sim+chain: strict mix-pool readiness gate + bump nwaku for RLN race work
simulations/mix_lez_chat/run_simulation.sh:
- Strict mix-pool readiness wait: now requires NUM_NODES-1 client
  registrations succeeded on the gifter (one per non-gifter mix node)
  AND a "Gifter self-registered as mix relay" log line on node0 —
  not just GR>=3 which could pass while node0 itself hadn't yet
  finished its own membership flow. Lets every mix node actually be
  ready to generate forward proofs before sender starts.
- Bumps testnet KADEMLIA_HARD_CAP to 1800s (30 min). Testnet block
  times + finality lag put 4 sequential mix-node registrations well
  beyond the old 600s ceiling.

vendor/nwaku bump pulls in:
- unified get_merkle_proofs that returns valid_roots atomically;
- self-verify in spam_protection.generateProof;
- ExternalMerkleProof.validRoots field + pollLoop refresh from it;
- proofRoot/getPollInterval accessors on OnchainLEZGroupManager;
- confirmMembershipLeafIndex helper (unused — wiring foundation for a
  follow-up background watcher to close the slot-allocation race).
2026-05-20 21:13:20 -06:00
Arseniy Klempner
0257fdf443
feat(chat): gate first publish on proof root stability in valid_roots
Replaces the blind 30s post-RLN-ready sleep in sendBytes with a
poll-based wait: capture our cachedProof's merkle root, then wait
until it has been present in our own rootTracker for ≥2 poll cycles
(cap 180s, warn-and-publish on cap). Adaptive to the underlying
chain's block cadence — solves the testnet RLN root-drift race
where a 30-42s sleep wasn't enough for mix-node verifiers to poll
the post-registration root, so proofs failed with
"Spam protection proof verification failed" at mix entry.

Non-OnchainLEZ group managers retain the 30s fallback.

Bumps vendor/nwaku to pick up the OnchainLEZGroupManager.proofRoot +
getPollInterval accessors this gate uses.

Also drops the deprecated logos-cpp-sdk override on the nix-fetched
LOGOSCORE: overriding the SDK breaks liblogos 7df6195's source
(stale requestObject/onEvent shape). Plugins via logos-module-builder
ship the newer SDK and are ABI-compatible with the native build.
2026-05-20 11:54:57 -06:00
Arseniy Klempner
95c5c51c77
chore: bump nwaku for callRlnFetcherAsync sync-fetcher fix 2026-05-19 20:10:15 -06:00
Arseniy Klempner
8587f5e288
chore: bump logos-lez-rln for onEvent/requestObject API fix 2026-05-19 13:22:14 -06:00
Arseniy Klempner
5c3a85a063
chore: bump logos-cpp-sdk to 1468180b in sim runner + lez-rln submodule
Cascades the chain-wide SDK pin bump (a4bd66c → 1468180b) into:
  - simulations/mix_lez_chat/run_simulation.sh: logoscore nix-build
    override-input
  - vendor/logos-lez-rln submodule pointer

All override-inputs in the build chain now agree on rev 1468180b, which
provides invokeRemoteMethodAsync. Avoids the mixed-rev ABI hazard where
a plugin compiled against one SDK rev would silently segfault against
a libsdk compiled against a different rev.
2026-05-19 12:51:29 -06:00
Arseniy Klempner
d566f55d9d
chore: bump logos-lez-rln for chat-module/delivery-module port + async trampoline
Picks up the upstream-master rebase + std::promise/future async trampoline
pattern for both chat_module and delivery_module plugins. The Qt thread
is no longer blocked during long-running RLN RPCs (register_member can
take 5-60s on testnet), eliminating cascading QtRO timeouts on unrelated
host CLI commands.

Also pulls in the new hand-written liblogos_rln_module_api.h typed
client header consumed by both plugins.

Nim-side FFI (library/declare_lib.nim) and gifter logic (vendor/nwaku)
unchanged — fix is entirely C++/build-system side.
2026-05-19 12:49:40 -06:00
Arseniy Klempner
b2f5fc8a4c
chore: bump submodules for is_member_registered poll path 2026-05-18 13:01:22 -06:00
Arseniy Klempner
124806643b
chore: bump submodules for register_member submit/confirm split
The on-chain Register submit and the membership-PDA confirmation
poll are now two separate Q_INVOKABLEs (register_member +
is_member_registered) so the RPC thread isn't blocked during the
on-chain wait. The Nim gifter closure owns the confirmation loop
and yields cleanly via async sleepAsync between polls.
2026-05-18 13:00:56 -06:00
Arseniy Klempner
585aa9de83
chore: bump logos-lez-rln for register_member QtRO timeout fix 2026-05-18 12:03:38 -06:00
Arseniy Klempner
b427dbb330
chore: bump submodules for register_member robustness consolidation
Pulls in:
- vendor/logos-lez-rln: rln_ffi_decode_membership FFI helper +
  logos_rln_module::register_member idempotency + PDA-appearance
  confirmation poll.
- nested logos-delivery + nwaku: gifter closure simplified to a thin
  wrapper around the now-robust register_member; gifter self-register
  retry loop removed (the inner FFI handles transient drops via
  PDA-appearance polling instead of trusting tx submission).

Net: -120 lines of Nim ad-hoc retry/poll logic, +60 lines of C++
extracted into a single canonical entry point used by all three
register-paths (Nim gifter, chat-module selfRegisterRln, delivery-
module selfRegisterRln).
2026-05-18 11:39:54 -06:00
Arseniy Klempner
c44269356c
chore: bump submodules for gifter retry fix 2026-05-18 10:52:41 -06:00
Arseniy Klempner
b3b71bc2a5
feat(sim): slim-mode submodule minimization
Three changes:
- vendor/logos-lez-rln bump: drops unused top-level logos-delivery
  submodule (~1.3 GB saved per fresh clone).
- setup_and_run.sh: gate lssa + logos-execution-zone-module init on
  SIM_NETWORK=local (or SIM_FULL_SUBMODS=1). Default Docker setup now
  pulls only logos-delivery-module (+ nested logos-delivery), saving
  ~11 GB of lssa for slim/testnet fresh clones.
- run_simulation.sh: stop requiring lssa/ to exist when discovering
  LEZ_RLN_DIR in the sibling-checkout layout.
- README: slim-mode minimum-submodule recipe + rationale.
2026-05-17 22:17:20 -06:00
Arseniy Klempner
d0a7927844
docs: pin working-state restore point (2026-05-17)
RESTORE.md documents the restore/working-2026-05-17 tag/branch
present in each of the 5 repos in the submodule chain, along with
restore commands. Snapshot of a known-good testnet sim state
before consolidation/refactoring.

Note: the restore tags were taken at the pre-consolidation commit
hashes — they preserve the original commit graph; this commit and
its consolidated peers live on top of those.
2026-05-17 18:59:57 -06:00
Arseniy Klempner
eacbdd6482
chore: bump submodule chain for testnet pipeline + gifter feature
Pulls in across the chain:
- vendor/logos-lez-rln: FFI alignment with SPEL ConfigState +
  4-field Register; canonical testnet deployment seed + slim-mode
  artifacts; nested logos-delivery-module bumped for gifter.
- vendor/nwaku: parity gifter self-register + cross-thread fix.

These were ~5 separate "chore: bump X" commits across submodule
revisions during the session; consolidated to one bump that
matches the consolidated feature commits below.
2026-05-17 18:59:57 -06:00
Arseniy Klempner
8977064671
feat(sim): testnet pipeline with seed bootstrap, slim mode, polish
Adds a SIM_NETWORK=testnet path to mix_lez_chat that:

- Skips local sequencer launch; reachability-checks the testnet RPC
  up front.
- Selects vendor/logos-lez-rln/testnet/ for wallet config + persistent
  state. Default flow runs run_setup against the deployed RLN program
  (is_initialized short-circuits to create_funded_user).
- Bootstraps from the submodule-shipped artifacts on first run:
  copies testnet/storage.json.seed -> testnet/storage.json and
  testnet/{supply_holding,payment_account}.txt ->
  ~/.logos-lez-rln/{supply_holding,payment_account}_<tree>.txt. Lets
  a fresh-clone dev reuse the canonical deployment.
- Adds SIM_SLIM=1 opt-in: skip run_setup entirely, use the shipped
  config_account + cached payment_account. Saves devs from building
  the lez-rln Rust toolchain (and transitively the lssa nested
  submodule).
- Raises timing floors for testnet block times (~60s vs local ~15s);
  adds KADEMLIA_HARD_CAP and SIM_PERSIST_LOCAL escape hatches.
- Polled-readiness loops replace fixed sleeps (kademlia mesh, mix
  peer counts, receiver join, delivery — each with bounded retry).
- Extracted seed_copy and wait_method_calls helpers; dropped a stale
  mix-peer kademlia gate (static mixNodes config seeds the pool via
  processBootNodes — kademlia counts are diagnostics only).

README updated with the testnet-flow + slim-mode + fresh-clone story.
2026-05-17 18:59:31 -06:00
Arseniy Klempner
c6a993a209
chore: bump logos-lez-rln to pick up testnet-fit guest + split Init
Pulls in two commits that together unblock the public testnet deploy:

  - feat(rln-registration): split Initialize into 3 transactions
  - build(methods): strip user_elf in R0BF to fit testnet tx-size cap

Verified end-to-end on https://testnet.lez.logos.co/ -- registration
program deploys (422 KB stripped < 511,800 B cap), all three init txs
land within the 32M-cycle session ceiling, full run_setup pipeline
through Step 7 (user account funding) green.
2026-05-15 07:48:21 -06:00
Arseniy Klempner
ce127b566a
feat(chat): consume RLN membership spec wire format on chat-side gifter
Updates the chat-side gifter caller in waku_client.nim to the new
MembershipAllocationRequest / MembershipAllocationSuccess types:
* identity commitment is sent as bytes (not hex string)
* authentication_type='eth-allowlist' is set explicitly when signing
* rate limit is passed as proto3 optional
* configAccountId is read off success.configAccountId (the LEZ extension)

Bumps vendor/nwaku and vendor/logos-lez-rln to pull in the spec-aligned
wire format on both the gifter server and the auto-registering mix-node
client paths.
2026-05-13 16:10:56 -06:00
Arseniy Klempner
34d570e3ff
chore: bump logos-lez-rln to follow logos-delivery-module .gitmodules fix 2026-05-13 11:44:18 -06:00
Arseniy Klempner
bba01ee9dc
feat(sim): exercise rln-gifter EIP-191 auth in mix_lez_chat sim
Wires the existing mix_lez_chat simulation to drive the gifter's
EIP-191 allowlist auth path end-to-end:

* bumps vendor/nwaku and vendor/logos-lez-rln (and, transitively,
  logos-delivery-module and its bundled logos-delivery copy) to pick up
  the auth plugin, the auto-registering client's EIP-191 signing, and
  the new --mix-gifter-allowlist / --mix-gifter-auth-key CLI flags.
* adds a `gifterAuthKey` knob on WakuConfig + the JSON config bridge in
  client_api so chat sender/receiver instances sign their gifter
  requests too.
* commits 5 fixed test secp256k1 keys (one per non-gifter mix node and
  per chat client) under simulations/mix_lez_chat/fixtures/gifter_auth/
  along with their derived addresses.
* run_simulation.sh sources keys.env+addresses.env, sets
  `mixGifterAllowlist` on mix node 0, and threads the matching
  `mixGifterAuthKey` / `gifterAuthKey` into nodes 1-3 and the
  receiver/sender configs.

Test fixtures only — keys must never be reused outside this sim.
2026-05-13 11:10:27 -06:00
Arseniy Klempner
6c12e6a003
fix: fetch tags when pinning lssa for sequencer build 2026-05-13 10:09:28 -06:00
Arseniy Klempner
194c5663c3
chore: track logos-delivery on feat/rln-gifter-sim branch 2026-05-13 09:04:41 -06:00
Arseniy Klempner
979a715b34
fix: restore submodule working trees in Docker script
Same fix as setup_and_run.sh — git submodule update --init resets
working tree files, so checkout is needed after init.
2026-05-12 13:55:27 -06:00
Arseniy Klempner
1a01e93c02
docs: update sim instructions for SPEL backend 2026-05-12 13:54:10 -06:00
Arseniy Klempner
932627d636
fix: update sim for SPEL 32-byte tree_id and submodule restore
TREE_ID_HEX updated from 24 to 32 bytes to match SPEL's tree_id format,
fixing stale payment account lookup that caused silent registration
failures (KeyNotFound error 8).

setup_and_run.sh now restores working tree files in all nested
submodules after git submodule update --init, which resets them.
2026-05-12 13:24:46 -06:00
Arseniy Klempner
9d368aeb44
build: add Docker image + GHCR for cross-platform simulation testing
Multi-stage Dockerfile pre-builds all heavy nix dependencies. Runtime
image (~8.5GB) at ghcr.io/adklempner/logos-chat-sim:latest includes
nix store closure + Rust + cargo-risczero/r0vm + system clang.

run_in_docker.sh pulls from GHCR, symlinks pre-built modules, builds
sequencer + run_setup from source (~10 min per run).

Update vendor/logos-lez-rln to a591645 (rebased onto main with
member-expiry merged, single squashed commit).

Add INSTRUCTIONS.md with macOS, Linux (native), and Docker instructions.
2026-05-11 18:30:28 -06:00
Arseniy Klempner
695ecb42bc
feat: add mix+LEZ chat simulation with Docker support
End-to-end simulation: 4 mix nodes with RLN spam protection, LEZ
sequencer, gifter service, and two logos-chat-module clients exchanging
double-ratchet-encrypted messages through 3-hop Sphinx onion routes.

Simulation scripts:
- run_simulation.sh: orchestrates sequencer, mix nodes, chat clients,
  with poll-based readiness checks and 15 verification checks
- setup_and_run.sh: one-shot build + run for fresh clones
- run_in_docker.sh: Docker-based Linux testing with pre-built modules
- README.md: configuration, troubleshooting, architecture guide

Configurable via SIM_* env vars (ports, timeouts, log level).
Cross-platform: macOS native + Linux via Docker.

Docker image (Dockerfile.sim) uses multi-stage build:
- Stage 1: builds all LEZ modules, sequencer, liblogoschat, chat-module
- Stage 2: copies only runtime nix closure (~1.9GB) + output artifacts
- Pre-built modules are symlinked at runtime, skipping build_all.sh
2026-05-06 10:50:14 -06:00
Arseniy Klempner
4060bb67c1
feat: add mix+LEZ RLN integration for logos-chat
Integrate logos-chat with the LEZ-backed mix network:

- Update vendor/nwaku to logos-delivery fork (feat/mix-rln-gifter-sim)
  with mix protocol, OnchainLEZGroupManager, RLN gifter client, and
  mix-rln-spam-protection-plugin
- Add vendor/logos-lez-rln submodule for reproducible LEZ module builds
- Add RLN FFI surface to liblogoschat: chat_set_rln_fetcher,
  chat_set_rln_config, chat_push_roots, chat_push_proof, etc.
- Wire gifter client for RLN membership registration via mix network
- Switch to filter-based message reception (relay: false, filter: true)
- Send via lightpushPublish(mixify=true) for Sphinx onion routing
- Add mix-librln separate build + duplicate symbol resolution
- Exclude vendor/logos-lez-rln from nimble link creation
- Update nix build for mix-librln and cross-platform support
2026-05-06 10:49:49 -06:00
osmaczko
15f68f2ec2
chore: use upstream nix (#88) 2026-03-02 12:16:49 +01:00
osmaczko
53302e4373
feat: statically link libchat and rln via rust-bundle (#83)
Add rust-bundle, a single staticlib crate that depends on both libchat
and rln as rlibs. This ensures rustc links Rust std exactly once,
eliminating duplicate symbol errors on all platforms. Nim targets link
against liblogos_chat_bundle.a; Nix uses a bundleDrv instead of
separate libchat and rln derivations.

Reference: https://doc.rust-lang.org/reference/linkage.html#mixed-rust-and-foreign-codebases
2026-03-01 17:27:40 +01:00
Igor Sirotin
07da6e2dec
feat: use logos.dev fleet (#87)
* feat: use logos.dev fleet

* fix: cluster id defaults

* docs: comment with host names and peer ids
2026-02-27 18:30:34 +00:00
Igor Sirotin
6fc4c2200a
ci: run nix build on ubuntu and macos (#85)
* ci: run nix build on ubuntu and macos

* ci: use DeterminateSystems/nix-installer-action

* fix: wrong extension for mac

---------

Co-authored-by: pablo <p.lopez.lpz@gmail.com>
2026-02-25 10:38:36 +00:00
Pablo Lopez
a97d8c1717
fix: mac build (#84)
* fix: mac build

- fix error: `error: darwin.apple_sdk_11_0 has been removed as it was a legacy compatibility stub`
- fix librln hash
- bumped nim-ffi

* fix: typo
2026-02-24 15:40:08 -08:00
osmaczko
74fcb612db
chore: bump libchat (#82) 2026-02-23 20:21:55 +01:00
osmaczko
44437c2bb4
ci: reduce CI times by unifying jobs and caching Cargo artifacts (#81)
- Consolidate build and test into a single job to avoid duplicate builds;
  artifact sharing across jobs proved too complex to justify
- NBS was the main bottleneck; this change improves CI duration beyond that
- Add caching for Cargo registry, git sources, and libchat's target
2026-02-23 19:46:36 +01:00
osmaczko
b4706cd6ac
ci: reduce CI times by unifying jobs and caching Cargo artifacts
- Consolidate build and test into a single job to avoid duplicate builds;
  artifact sharing across jobs proved too complex to justify
- NBS was the main bottleneck; this change improves CI duration beyond that
- Add caching for Cargo registry, git sources, and libchat's target
2026-02-23 19:36:16 +01:00
Jazz Turner-Baggs
8155195871
Readme Overhaul (#74)
* Clean main README.md

* remove uneeded information

* clean up name
2026-02-23 07:56:21 -08:00
osmaczko
b2bcc81bdb
feat: add nix flake 2026-02-23 15:58:29 +01:00
Jazz Turner-Baggs
ee5075cc6e
Remove CI Ignore-paths (#77)
* Add gate to detect changes in source code

* Fix action errors

---------

Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>
2026-02-23 14:20:00 +01:00
Jazz Turner-Baggs
c2196c77ee
Identity Simplification (#71)
* Contract interface for bindings

* Add errorType

* Remove Identity files

* Update Echo_bot

* update cbindings

* Add installation name

* Update tests

* bump libchat dep
2026-02-22 17:51:59 -08:00
Jazz Turner-Baggs
714d97029c
Remove Test-Windows CI Job (#75) 2026-02-22 16:01:02 -08:00
Pablo Lopez
d15bcb0729
Merge pull request #76 from logos-messaging/fix/config
fix: peers and pubsub
2026-02-21 07:57:03 +02:00
pablo
cdafc250e5
fix: peers and pubsub 2026-02-20 13:12:58 +02:00
Jazz Turner-Baggs
3921bd8bbd
Run CI action on push to Main (#72)
* Update ci to run on push to main

* Remove stale actions
2026-02-19 09:13:38 -08:00
Jazz Turner-Baggs
fb347d7974
Merge pull request #66 from logos-messaging/logos_chat_integration
CRC-001 - Integration
2026-02-18 13:53:36 -08:00
Patryk Osmaczko
4e6fcc7ac2
fix: remove stale naxolotl test
src/naxolotl was deleted in #68 but test_naxolotl.nim and its
entry in all_tests.nim were left behind, causing make tests to
fail with "cannot open file: ../src/naxolotl".
2026-02-18 22:20:17 +01:00
Patryk Osmaczko
04f46d1797
fix: re-add vendor/nim-ffi submodule to fix C-bindings build
`requires` in the nimble file alone is not sufficient, NBS never calls
`nimble install` or clones URLs from the `requires` block at build time.
The package must be present as a git submodule for NBS to discover and
link it.

Migrating to `nimble install` is a separate task.
2026-02-18 22:20:16 +01:00