Commit graph

372 commits

Author SHA1 Message Date
e3fb723a91 Merge pull request 'fix(android): keep Tor bootstrap alive after the unlock activity dies' (#116) from feat/android-bootstrap-survives-ui into main
Some checks failed
android-ci / android (push) Failing after 3m32s
Reviewed-on: #116
2026-09-19 01:51:38 +00:00
agent
396e468f1a
fix(android): keep Tor bootstrap alive after the unlock activity dies
Some checks failed
android-ci / android (pull_request) Has been cancelled
Open set Phase.Opening then ran openWire on viewModelScope, and the
keep-alive refused to start until Wire existed. Closing the activity
cancelled bootstrap, so the spinner vanished and the lock screen came
back idle. Run openWire on NodeHost's process scope, start the FGS on
the Open tap, and treat in-flight bootstrap as keep-alive work. IME Go
also submits unlock the same way as the Open button.
2026-09-18 21:46:34 -04:00
77f577fcf9 Merge pull request 'android-ci: make a :app:packageRelease failure diagnosable (--stacktrace)' (#115) from onionwire/t_d81fb7bf-android-ci-make-a-app-packagerelease-fai into main
All checks were successful
android-ci / android (push) Successful in 11m0s
Reviewed-on: #115
2026-09-19 00:03:08 +00:00
apk-dev
fcdabf8d13
android-ci: pass --stacktrace to the release gradle build
All checks were successful
android-ci / android (pull_request) Successful in 10m27s
Run 414 died in :app:packageRelease with an empty cause chain (no
Caused by: line at all), so a one-off packaging failure leaves nothing
to diagnose. --stacktrace only changes output on failure; it does not
alter the build, the artifact or the timings.

scripts/build-android-local.sh is the single gradle invocation that both
android-ci.yml and android-release.yml build through, so one flag covers
both.
2026-09-18 19:53:41 -04:00
0af97e144a Merge pull request 'android-ci: echo the artifact digests and deflated native-lib sizes (evidence follow-up to #113)' (#114) from onionwire/t_f05be394-evidence-digest into main
All checks were successful
android-ci / android (push) Successful in 11m8s
Reviewed-on: #114
2026-09-18 22:53:43 +00:00
agent
c5e2cae694
android-ci: 2 GB of Gradle heap for the cuprated release packaging
Some checks failed
android-ci / android (pull_request) Failing after 2s
Run 414 (PR #114) died in `:app:packageRelease` after a clean build:

    Execution failed for task ':app:packageRelease'.
    > A failure occurred while executing
      com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable

with no `Caused by` line and nothing else in the log — and it is not
reproducible on the same content: runs 412 and 413 (this tree, 1 GB heap)
packaged fine. The one budget in this build that got tight when cuprate came in
is the single-use Gradle daemon's heap, which now compresses a 55 MB SDK lib
(plus RandomX's 1.1 MB) in-process; the runner has 15 GB and the job's peak RSS
is ~3 GB, so 2 GB of heap costs nothing and removes the most likely mechanism.
android-release.yml gets the same number: it packages the same APK.
2026-09-18 18:15:52 -04:00
agent
294cedfbff
android-ci: echo the artifact digests and the deflated native-lib sizes
Some checks failed
android-ci / android (pull_request) Failing after 9m52s
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.

Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
2026-09-18 17:51:11 -04:00
8626da225b Merge pull request 'android: build the SDK with cuprate-daemon and offer the on-device node' (#113) from onionwire/t_f05be394-android-build-the-sdk-with-cuprate-daemo into main
All checks were successful
android-ci / android (push) Successful in 10m40s
Reviewed-on: #113
2026-09-18 21:42:54 +00:00
agent
3860c3d56d
android: record what the cuprated build costs CI (baseline vs feature on)
All checks were successful
android-ci / android (pull_request) Successful in 11m12s
2026-09-18 17:30:20 -04:00
sirius
9afa22a0bf
android-ci: fix the cuprate marker gate failing its own green build
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / test (pull_request) Successful in 5m7s
ci / sdk (pull_request) Successful in 1m4s
ci / fuzz (pull_request) Successful in 4m55s
Run 406 built the APK successfully (BUILD SUCCESSFUL in 44m 7s) and the gate then
reported "the cuprate-daemon feature is NOT in this APK" while the line above it
printed `target_max_memory` **5** times. The bug is the classic one:

    strings -a x.so | grep -q pattern     # under `set -o pipefail`

`grep -q` exits at the first match and closes the pipe; `strings` takes SIGPIPE
(141) and pipefail makes the pipeline status non-zero, so `if ! ...` ran. The count
is captured into a variable now (grep -c reads the whole stream, no SIGPIPE) and the
gate fails on `< 1`, which is what it always meant.
2026-09-18 17:16:05 -04:00
sirius
adcf52b8e4
android: pin the Android Rust toolchain to 1.98 (cuprated needs >= 1.93)
The Android jobs pinned `RUST_TOOLCHAIN: "1.91"` — the workspace MSRV — and the
cuprated graph does not build on it. `tapes`, a Cuprate dependency this repo cannot
patch, calls `VecDeque::pop_front_if`, stable only from 1.93:

    error[E0658]: use of unstable library feature `vec_deque_pop_if`
       --> /cargo/git/checkouts/tapes-.../src/tapes/rolling_tape.rs:396:34

1.98 is the stable release the graph is built and tested with on the dev machine
(rustc 1.98.1) and the one the cross-compile spike used. `ci.yml`, `release.yml` and
the `rust-version = "1.91"` MSRV are untouched: the feature-off workspace builds on
1.91, and moving the MSRV is a separate decision, flagged in the PR.

Both workflows, and `android/CUPRATE_DAEMON.md` records it as a pitfall.
2026-09-18 17:16:05 -04:00
sirius
0a2bcf93a2
android: install cmake in the Android build containers
RandomX is the C++ half of the in-process chain daemon and `randomx-rs`'s build
script drives it through `cmake-rs`. Neither `android-ci.yml` nor
`android-release.yml` installed `cmake` in its `debian:bookworm` container, so the
first CI run of this branch compiled 410 crates in 11m37s and then died with

    error: failed to run custom build command for `randomx-rs …`
    failed to execute command: No such file or directory (os error 2)
    is `cmake` not installed?

surfacing as Gradle's "Process 'command 'cargo'' finished with non-zero exit value
101" — which reads like a Rust error and is not one. Both workflows install it now.

`android-ci.yml` also reports the cargo target volume after the build, next to the
wall clock: the disk cost of the feature on the runner is part of the measurement
this change owes.
2026-09-18 17:16:05 -04:00
sirius
e6b6bc8dd6
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.

Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
  cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
  feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
  can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
  C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
  `libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
  whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
  `RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
  driver at the app's API level, named explicitly, because the dev machines pin
  the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
  `cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
  the task name.

Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
  Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
  `monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
  Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
  this source only, fail-closed on an unrecognised word. No sync height: the SDK
  exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
  refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
  a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
  is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.

CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
  fails the job unless it contains `target_max_memory`, a rodata literal compiled
  only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
  separates "in the artifact" from "requested".

Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
  an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
  it for the chain source that is not a binary.
2026-09-18 17:16:05 -04:00
773dacb062 Merge pull request 'sdk: land the on-device Cuprate chain source on main (replay of #111's SDK commit)' (#112) from onionwire/t_52f8de0f-cuprate-land-the-sdk-surface-on-main-pr into main
All checks were successful
ci / test (push) Successful in 5m9s
ci / sdk (push) Successful in 1m4s
android-ci / android (push) Successful in 8m22s
ci / fuzz (push) Successful in 4m47s
Reviewed-on: #112
2026-09-18 19:44:45 +00:00
agent
e89dd9eaee
sdk: expose the on-device Cuprate chain source (choice, lifecycle, node status)
All checks were successful
ci / test (pull_request) Successful in 5m5s
ci / sdk (pull_request) Successful in 1m4s
android-ci / android (pull_request) Successful in 8m31s
ci / fuzz (pull_request) Successful in 4m47s
ChainChoice gains InProcessCuprate, the SDK passes the core's cuprate-daemon
feature through as its own, and an empty monerod_datadir for that kind resolves
to $ONIONWIRE_HOME/chain so Kotlin never invents a path. wallet_status now
carries chain_in_process / node_available / node_state beside the core's five
state words; no second state machine, no timer, no env var.

start/stop stay the core's pass-through: one call launches the node and the
wallet child, one stops both, both idempotent.

Replayed onto main (25e029e): PR #111 was merged into the core branch
onionwire/t_04975420-cuprate-land-the-in-process-chain-source, not main, so
main had only the core half (from PR #110). This is the same tree change with
no core commits replayed.
2026-09-18 15:29:55 -04:00
25e029ed4e Merge pull request 'wallet: land the in-process Cuprate chain source on main (ChainSource::InProcessCuprate, cuprate-daemon feature)' (#110) from onionwire/t_04975420-cuprate-land-the-in-process-chain-source into main
All checks were successful
ci / test (push) Successful in 5m6s
ci / sdk (push) Successful in 1m3s
android-ci / android (push) Successful in 8m20s
ci / fuzz (push) Successful in 4m43s
Reviewed-on: #110
2026-09-18 18:05:46 +00:00
agent
ffea4bf9df
wallet: land the in-process Cuprate chain source on main
All checks were successful
ci / test (pull_request) Successful in 5m39s
ci / sdk (pull_request) Successful in 1m22s
android-ci / android (pull_request) Successful in 8m58s
ci / fuzz (pull_request) Successful in 4m45s
`ChainSource::InProcessCuprate { datadir }` is the fourth chain source: P2P,
consensus and RandomX run inside the OnionWire process instead of as a spawned
`monerod`. The wallet layer does not move — the daemon binds the same loopback
unrestricted RPC (`127.0.0.1:18081`) that `WalletChild::daemon_address` already
returns for a local source, so `wallet_rpc_argv`, the RPC client, the payment
frames and the receipt-verification path are untouched.

- Cargo.toml: `cuprated` (git, rev 4f8fcd1b) + `toml`, both optional, behind the
  `cuprate-daemon` feature, OFF by default. `cuprated`'s own `arti` feature is
  disabled (`default-features = false`): its arti-client 0.44 cannot unify with
  this crate's 0.46, and the in-process daemon is clearnet-only. One Tor stack in
  the process. `Cargo.lock` gains the graph; a default build's
  `cargo tree --locked -e normal -i cuprated` still says "did not match any
  packages", and only `arti-client v0.46.0` is in the lock.
- src/cuprate.rs (new): `CuprateNode` builds the cuprated config as TOML
  (testnet, unrestricted RPC on loopback, restricted RPC disabled, inbound P2P
  off), launches it on a runtime it owns, and owns the node. `launch` is
  synchronous on purpose: `WalletChild::start` is sync (the TUI calls it from its
  blocking thread, UniFFI calls it from an async context) and a runtime cannot be
  started from inside a runtime, so the launch runs on a thread of its own and
  the node + its runtime come back over a channel. Dropping the value asks the
  node to shut down and `shutdown_background`s the runtime, which is the only
  exit that cannot panic when the value is dropped inside another runtime.
  The type exists in every build (feature off: `launch` fails with the feature
  name), so the chain-source type, its stored record and its copy do not fork on
  a cargo feature.
- src/wallet.rs: the variant, its label (`in-process node`), and the chain-daemon
  client the wallet line carried (typed `WalletError`, de-chunked HTTP,
  `get_height` over the URI endpoint, an above-the-tip height as one typed
  error). Cuprate answers those three differently from monerod and the
  in-process source is what makes them the *local* case.
- src/wallet_child.rs: launches/holds/stops the node, `chain_datadir` for the
  free-space/ownership question, the honest `chain_copy` line, `kind =
  "cuprate"` in the sealed record, and `ChildConfig::validate` for it.
- src/tui.rs: the wallet screen's chain line carries the testnet caveat when the
  configured source is the in-process one. It computes the line at draw time, so
  `Screen::Wallet`'s shape (which tests construct) does not change.
- docs/WALLET.md, docs/THREAT_MODEL.md, docs/cuprate-android-spike.md: the
  feature flag and how to enable it, where the (fjall) chain store lives, the
  **measured** +11.8 MiB delta, the pre-production/testnet caveat, and the
  in-repo aarch64-linux-android proof with exit codes.

Scope deviations, stated plainly:
- `src/cuprate.rs` and its one `src/lib.rs` module line are not in the card's
  allowed list; the card's own deliverable describes the module's behaviour.
- `crates/onionwire-sdk/src/lib.rs` is forbidden, but adding a variant to a
  `pub enum` that the SDK matches exhaustively breaks the SDK workspace, and the
  root CI `sdk` job runs on every PR. One variant plus two match arms land here
  so the SDK keeps compiling (`cargo test --locked` + clippy clean); the SDK card
  owns the rest — feature passthrough, the config field's semantics, the label
  and its tests, and the Android check.
- `tests/wallet.rs` carries the launch test. `tests/tui_frames.rs` is untouched:
  main has no `ChainChoice` to pin (the chain-source picker is the unmerged F7
  work, and `docs/WALLET.md` says so rather than describing a picker that does
  not exist).

Proof (all on this tree):
- Default build: `cargo test --locked --target x86_64-unknown-linux-gnu` → 345
  passed / 0 failed across 33 suites, exit 0; `cargo clippy --locked
  --all-targets --target x86_64-unknown-linux-gnu -- -D warnings` exit 0.
- Feature on: `cargo test --locked --features cuprate-daemon --target
  x86_64-unknown-linux-gnu` → 347 passed / 0 failed, exit 0; same clippy with
  `--features cuprate-daemon` exit 0. The two extra tests are the real thing:
  `wallet_child::tests::in_process_source_launches_a_daemon_and_stop_shuts_it_down`
  and `tests/wallet.rs::an_in_process_cuprate_node_answers_the_typed_daemon_client`
  — the latter launches the node, drives `get_info` / `get_height` / `get_block`
  through the typed client, checks the above-the-tip 500 maps to
  `DaemonHeightOutOfRange`, checks the chain store is under the chain datadir,
  and checks the listener dies with the node.
- aarch64: `cargo check --locked --release --target aarch64-linux-android
  --features cuprate-daemon` exit 0 (1m 50s), and the full link exit 0
  (`cargo rustc ... --bin onionwire -- <NDK C++ runtime / compiler-rt link
  args>`) producing `ELF 64-bit LSB pie executable, ARM aarch64, for Android 26,
  built by NDK r28c`.
- Size: stripped aarch64 release binary, 24,725,704 bytes without the feature and
  37,053,472 with it — +12,327,768 bytes (≈ +11.8 MiB), the figure
  `docs/WALLET.md` now quotes.
2026-09-18 13:45:59 -04:00
8ba1cf4c6c Merge pull request 'android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary (issue #107)' (#109) from onionwire/t_87984328-android-start-stop-the-monero-wallet-rpc into main
All checks were successful
android-ci / android (push) Successful in 8m9s
Reviewed-on: #109
2026-09-18 14:33:54 +00:00
apk-dev
0134396588
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary
All checks were successful
android-ci / android (pull_request) Successful in 8m59s
Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353`
(PR #108) because the UniFFI wallet-child surface is not on `main` yet.

Binary
------

`android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real
`monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from
monero-project/monero v0.18.4.4 (516e5355) via upstream's own
`contrib/depends` + toolchain.cmake path, then stripped with the target's own
strip. 19 954 224 bytes, sha256
d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4.

It ships through `jniLibs` and not as an asset on purpose: since API 29 the
kernel refuses `exec()` on a file in the app's data directory, so the only
executable directory an app has is `applicationInfo.nativeLibraryDir`, which
the package manager fills from `lib/<abi>/` at install time. That requires
`android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`),
which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one
entry so AGP's strip pass cannot rewrite the bytes CI verifies.

`scripts/build-monero-wallet-rpc-android.sh` reproduces the build and
`android/MONERO_BINARIES.md` records the four host quirks that cost the most
time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the
generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which
breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host
headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`).

CI re-verifies the blob rather than taking it on trust:
`scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before
Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of
the APK and compares its sha256 with the committed file.

`arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says
that instead of pretending: `arti_bin` is set to the path the binary would
occupy, and the screen refuses an `.onion` daemon while it is absent.
Loopback and clearnet daemons work.

UI
--

`WalletScreen` gains a "wallet daemon" card above the existing
Create / Import / Invoice / Tip actions, which are untouched:

* a status line from `Wire::wallet_status()` rendered verbatim —
  `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's
  chain-source label (`receive-only` / `local node` / `remote onion daemon` /
  `remote daemon`). A died child reads `exited`; it is never folded into `off`
  and never into `ready`;
* Start / Stop calling `start_wallet_child` / `stop_wallet_child` through
  `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node
  and the status read re-decrypts the sealed record);
* a `host:port` field that saves a remote daemon via `set_chain_source`, plus a
  Receive-only button;
* honest failure states instead of a spinner: no bundled binary, no chain
  source, a `.onion` daemon with no arti, or a start that failed — each gets its
  own sentence, and Start is disabled with the reason on screen.

`WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat
poller, so leaving the wallet screen and coming back cannot stack a second loop.
`ui/WalletChildStatusText.kt` is the pure model (mirrors the
`ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the
status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on
the JVM.

Verified
--------

`./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh`
produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes,
versionName 0.1.0 / versionCode 100) with
`lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and
`extractNativeLibs="true"` in the merged release manifest.

NOT verified: the binary was never executed. The build host has no arm64-v8a
AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user,
so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and
answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so
plainly and lists the emulator steps to close the gap.
2026-09-18 10:20:08 -04:00
143bf6e0d0 Merge pull request 'wallet: land the wallet-child stack on main + expose start/stop/status through UniFFI (issue #107)' (#108) from wt/t_8a8ff353 into main
All checks were successful
ci / test (push) Successful in 4m58s
ci / sdk (push) Successful in 57s
android-ci / android (push) Successful in 8m7s
ci / fuzz (push) Successful in 4m36s
Reviewed-on: #108
2026-09-18 13:45:17 +00:00
agent
c5af978d14
docs(wallet): describe the child lifecycle that ships here
All checks were successful
ci / test (pull_request) Successful in 5m31s
ci / sdk (pull_request) Successful in 1m22s
android-ci / android (pull_request) Successful in 8m52s
ci / fuzz (pull_request) Successful in 4m37s
The inherited section described an F7 config screen with endpoint entry and
test-connection that is not in this stack (it lives on
feat/wallet-create-import), and called local mode 'not wired yet'. Both are
now wrong: the child is wired, and the stored wallet config is a core API
without a screen. Say which is which.
2026-09-18 09:28:11 -04:00
agent
d8a2ee35aa
sdk: expose the wallet-child lifecycle over UniFFI
ChainConfig / ChainChoice / WalletChildStatus records and
set_chain_source(config) / chain_source() / start_wallet_child() /
stop_wallet_child() / wallet_status(). Android passes absolute binary paths
from nativeLibraryDir; the core never resolves a binary the caller named.
2026-09-18 09:28:11 -04:00
agent
440a37caf0
wallet: wire the app-owned child into the node and TUI
The module was dead code: nothing started the child, so the payment spines
could only ever see an env-configured monero-wallet-rpc. Now:

- Node::start_wallet_child / stop_wallet_child / wallet_child_status /
  wallet_child_refresh / wallet_child_config / set_wallet_child_config. The
  start path honours the configured absolute binary path, points the node's
  wallet at the child, and shutdown() stops the child rather than orphaning
  a spend-capable RPC behind a loopback socket.
- The status is derived from the real process (try_wait) and the last probe:
  off / connecting / syncing / ready / exited, plus the chain-source label.
  A dead child is never reported ready.
- ChildConfig (source, wallet_rpc_bin, arti_bin, wallet_filename) persists in
  the sealed wallet_child record next to the generated creds; the record is a
  read-modify-write so first-start creds never clobber a saved config.
- TUI: F6 gains s (start) / x (stop) / p (probe) and a child status row, and
  the /pay and /tip key handlers now call the core readiness guard before
  sending.
2026-09-18 09:28:11 -04:00
agent
11a021acb3
chore: wallet child lifecycle + chain source + SOCKS proxy (t_1bcecf90) 2026-09-18 09:28:11 -04:00
rust-dev
db208be05c
wallet: stored config (F7), WalletStatus snapshot, pay/tip readiness guard
The only input path for the wallet was env. Add the same three remote-mode
fields as stored config so the F7 screen can set them and headless runs read
one source of truth:

- `wallet_config` table in the encrypted store (one row; the login is sealed
  with the store data key under `onionwire/wallet-config/v1`, on top of
  SQLCipher). Empty URL clears it. `Store::load_wallet_config` /
  `save_wallet_config`.
- `WalletConfig { rpc_url, rpc_login: Zeroizing<String>, no_spend }` with a
  redacting `Debug`; `Wallet::from_config`, and `Wallet::for_boot` which
  prefers stored config, falls back to env, and refuses to dial a bad stored
  endpoint. Node::start* now reads the store before constructing the wallet.
- `WalletStatus { configured, connected, last_error, balance_line,
  receive_address }`: `connected` only ever comes from a probe
  (`Wallet::status`, get_address + get_balance); config alone leaves it false.
  `Node::wallet_status` is the cheap draw-path read, `wallet_refresh` the
  probe that folds into it.
- One-shot `Wallet::ping(rpc_url, rpc_login) -> PingResult { ok, status,
  error }` for the Test-connection button: same loopback/digest rules, errors
  redacted and capped.
- `readiness(configured, connected, no_spend, is_tip) -> Readiness` plus
  `Node::wallet_readiness` (async, block_on-friendly): not configured →
  NOT_CONFIGURED_MSG; /tip on a no-spend wallet → VIEW_ONLY_MSG before any
  dial; configured but not connected → NOT_CONNECTED_MSG; else ready.
- `Node::wallet_save_config` persists, validates first, then re-reads so the
  live wallet and snapshot follow a Save without a restart.
- `Node::wallet` is now a Mutex<Wallet> (cloned out before each await) so the
  wallet can be re-pointed mid-session.

Local-mode fields stay reserved: the child lifecycle is t_69ce8e46 and is not
wired here. docs/WALLET.md documents the stored config, boot precedence and
the exact guard copy.

Tests: 38 in tests/wallet.rs including exact-refusal-copy, boot precedence,
sealed-on-disk login, ping sanitization and connected-only-after-probe.
2026-09-18 09:28:11 -04:00
agent
bcf7ec31c1
wallet: app-owned child lifecycle + user-chosen ChainSource
The app now owns monero-wallet-rpc (and monerod when the chain source is
local) instead of requiring the user to start them and export
ONIONWIRE_WALLET_RPC.

- ChainSource enum: None / Local { monerod_bin, datadir } / Remote { host,
  port }. No default remote node; Remote is only constructed from explicit
  user input. A .onion Remote is refused without a SOCKS proxy (separate
  card).
- WalletChild in src/wallet_child.rs spawns monero-wallet-rpc with
  --rpc-bind-ip 127.0.0.1, a random free loopback port, generated
  --rpc-login, and --wallet-dir /wallet; monerod too for a
  local source. --trusted-daemon is never passed.
- Generated RPC creds are sealed in the encrypted SQLCipher store
  (wallet_child table, AEAD on top of whole-db encryption), never a
  plaintext file. The Wallet client is built from the generated loopback
  URL, not from_env.
- Readiness predicate: chain_ready() requires synchronized==true, height>0,
  height>=target_height; can_spend() and can_verify_receipts() gate on it.
  Unsynced -> receipts stay verified=0, spend refused with a clear message.
- Backend-aware timeouts: local management calls keep 5s; chain-dependent
  calls (get_info, get_transfers, transfer) get 60s (CHAIN_RPC_TIMEOUT),
  because a first sync or a remote daemon outlasts 5s and a 5s cap there
  is what left receipts permanently unverified.
- node.rs ingest_receipt gates on can_verify_receipts() instead of
  configured() alone.
- docs/WALLET.md rewritten for the child lifecycle + chain source.

Base: feat/wallet-create-import (PR #66). Do not rebase onto main.

Co-Authored-By: Hermes Agent <agent@local>
2026-09-18 09:28:11 -04:00
462b5765bd Merge pull request 'ci: nightly fuzz job for fuzz/ (PR #103 harness) - fix build+run container' (#106) from wt/t_16e835ef into main
Reviewed-on: #106
2026-09-18 11:09:13 +00:00
4623f78a69 Merge branch 'main' into wt/t_16e835ef 2026-09-18 11:08:51 +00:00
agent
518ef30232
Revert "ci: crash-test — inject panic in qr_decode to prove the fuzz job fails on a crash (REVERT BEFORE MERGE)"
All checks were successful
ci / test (pull_request) Successful in 4m51s
ci / sdk (pull_request) Successful in 58s
ci / fuzz (pull_request) Successful in 4m34s
This reverts commit b76bf46100.
2026-09-17 23:28:32 -04:00
agent
99a941b437
fix(ci): merge fuzz build+run into one container so cargo-fuzz persists
All checks were successful
ci / test (push) Successful in 4m46s
ci / sdk (push) Successful in 57s
ci / fuzz (push) Successful in 4m30s
The fuzz job's two CI steps ran in separate Docker containers, so the
cargo-fuzz binary installed in step 1 was gone by step 2: run-fuzz.sh
failed with 'error: no such command: fuzz'. Merge the nightly toolchain
install, cargo-fuzz install, fuzz build, fuzz list, and run-fuzz.sh into
a single container step so the installed binary and built targets survive.

Carry the /target/tmp mkdir from 1b2c63b (rustup self-update needs TMPDIR
to exist before its temp dir creation).
Co-authored-by: agent <agent@local>
2026-09-17 23:13:34 -04:00
agent
8949da1213
fix(ci): merge fuzz build+run into one container so cargo-fuzz persists
Some checks failed
ci / test (pull_request) Successful in 4m54s
ci / sdk (pull_request) Successful in 1m5s
ci / fuzz (pull_request) Failing after 5m56s
The fuzz job's two CI steps ran in separate Docker containers, so the
cargo-fuzz binary installed in step 1 was gone by step 2: `bash
/scripts/run-fuzz.sh` failed with "error: no such command: `fuzz`".

Merge the nightly toolchain + cargo-fuzz install + `cargo fuzz build` +
`cargo fuzz list` + `bash run-fuzz.sh` into a single container step so
the installed binary and the built targets survive across the run.

Also keep the /target/tmp mkdir from 1b2c63b (rustup needs it for its
temp dir when TMPDIR=/target/tmp).

Co-authored-by: agent <agent@local>
2026-09-17 23:10:08 -04:00
agent
1b2c63b9b6
fix(ci): create /target/tmp before rustup/cargo-fuzz in Docker jobs
Some checks failed
ci / test (push) Successful in 4m42s
ci / sdk (push) Successful in 57s
ci / fuzz (push) Failing after 17m18s
All CI Docker jobs set TMPDIR=/target/tmp (via -e), but the directory
was never created inside the container before rustup ran. The /target
volume mount doesn't include a tmp/ subdir, so rustup's temp dir
creation failed with ENOENT.

Fix: add /target/tmp to the mkdir -p in all four Docker shell commands
(test, sdk, fuzz-build, fuzz-run).
2026-09-17 22:16:25 -04:00
2f6f737106 Merge pull request 'fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers' (#103) from wt/t_1265efb2 into main
Some checks failed
ci / test (push) Successful in 4m49s
ci / sdk (push) Successful in 57s
ci / fuzz (push) Failing after 1m7s
Reviewed-on: #103
2026-09-18 02:00:33 +00:00
2b7a306d43 Merge pull request 'store: widen payments.kind to accept 'tip' (tips were never stored)' (#102) from wt/t_ecf204ad into main
Some checks failed
android-ci / android (push) Successful in 8m57s
ci / test (push) Successful in 4m40s
ci / sdk (push) Successful in 56s
ci / fuzz (push) Failing after 49s
Reviewed-on: #102
2026-09-18 01:53:26 +00:00
agent
186ec7436d
store: widen payments.kind to accept 'tip' so tips are stored
Some checks failed
android-ci / android (pull_request) Successful in 8m6s
ci / test (pull_request) Successful in 4m43s
ci / sdk (pull_request) Successful in 57s
ci / fuzz (pull_request) Failing after 31s
insert_payment has allowed kind = "tip" since the tip path landed, but the
payments table's CHECK only permitted invoice/receipt, so every tip insert
failed ("CHECK constraint failed: kind IN ('invoice','receipt')"). That made
the outbound tip row impossible and silently broke the inbound path too:
ingest_tip returned early and neither the row nor the [tip] chat line was
written.

- recreate the table with the widened CHECK on open, copying rows verbatim
  (new stores get it from the schema directly)
- outbound tip() records kind = "tip" with the tip's memo, matching ingest_tip
- tests: outbound row, inbound round trip, pre-tip store migration

Refs kanban t_ecf204ad
2026-09-17 21:46:57 -04:00
24b5c93c43 Merge pull request 't_2fb507c6: F8 rotate prekey (Node::rotate_prekey + invite re-encode)' (#101) from wt/t_2fb507c6 into main
Some checks failed
android-ci / android (push) Successful in 8m28s
ci / test (push) Has been cancelled
ci / sdk (push) Has been cancelled
ci / fuzz (push) Has been cancelled
Reviewed-on: #101
2026-09-18 01:21:45 +00:00
724e0427b0 Merge pull request 'tls: default to Arti's rustls backend (drop OpenSSL from TLS)' (#100) from wt/t_17e3d3cf-rustls-default into main
Some checks failed
android-ci / android (push) Successful in 9m42s
ci / test (push) Successful in 4m42s
ci / sdk (push) Successful in 1m1s
ci / fuzz (push) Failing after 59s
Reviewed-on: #100
2026-09-18 01:20:35 +00:00
049b612169 Merge branch 'main' into wt/t_17e3d3cf-rustls-default
Some checks failed
android-ci / android (pull_request) Successful in 8m17s
ci / test (pull_request) Successful in 4m50s
ci / sdk (pull_request) Successful in 1m6s
ci / fuzz (pull_request) Failing after 58s
2026-09-18 01:05:55 +00:00
agent
b76bf46100
ci: crash-test — inject panic in qr_decode to prove the fuzz job fails on a crash (REVERT BEFORE MERGE) 2026-09-17 21:04:45 -04:00
rust-dev
2cf9e8c7c6
fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers
Four pure parsers eat untrusted peer input and had no structured fuzzing:

- ratchet_frame  -> RatchetState::from_bytes + RatchetState::decrypt
                    (the 'rat ' frame parser: prefix, version, length,
                    N/PN bounds, DH step, AEAD open)
- qr_decode      -> qr::decode on pasted/scanned invite strings
- dispatch_classify -> dispatch::classify on raw decrypted plaintext,
                    including the 'rat ' -> Kind::Ratchet routing arm
- file_decode    -> file::decode on 'fil ' chunk frames

No src/ change: every target calls the shipped public API. The fuzz crate is
its own workspace (empty [workspace] table), so no root Cargo.toml dependency
is added and cargo build/test at the root never compiles it.

Seeds in fuzz/seeds/ are committed and copied into the gitignored working
corpus by scripts/run-fuzz.sh; each target asserts properties a panic-free
decode must hold (a rejected ratchet frame leaves the state byte-identical,
a decoded invite is 32/32/onion-shaped, a decoded chunk re-encodes).

Verified: cargo +nightly fuzz list -> 4 targets; scripts/run-fuzz.sh with
FUZZ_SECS=60 FUZZ_JOBS=4 -> exit 0, oom/timeout/crash: 0/0/0 for all four,
fuzz/artifacts/* empty.
2026-09-17 21:04:20 -04:00
407b11f2f8 Merge pull request 'docs+tui: reachability stance (no sealed mailbox) and peer-unreachable queued footer' (#99) from wt/t_d662c8a6 into main
Some checks failed
android-ci / android (push) Successful in 8m31s
ci / test (push) Successful in 4m57s
ci / sdk (push) Successful in 1m5s
ci / fuzz (push) Failing after 36s
Reviewed-on: #99
2026-09-18 01:02:21 +00:00
deaa8a7cfa Merge pull request 'ci: nightly cargo-fuzz job for fuzz/ (PR #103 harness)' (#104) from wt/t_16e835ef into main
Some checks failed
ci / test (push) Successful in 4m41s
ci / sdk (push) Successful in 58s
ci / fuzz (push) Failing after 1m11s
Reviewed-on: #104
2026-09-18 01:00:39 +00:00
agent
bfbbdbf14f
ci: nightly cargo-fuzz job for fuzz/ (PR #103 harness)
Some checks failed
ci / test (pull_request) Successful in 4m47s
ci / sdk (pull_request) Successful in 57s
ci / fuzz (pull_request) Failing after 1m8s
Add a  job to .forgejo/workflows/ci.yml that builds the four
libFuzzer targets on nightly (ratchet_frame, qr_decode,
dispatch_classify, file_decode) and runs each for 15s. Own registry
and target volumes (onionwire-cargo-registry-fuzz /
onionwire-target-ci-fuzz), TMPDIR=/target/tmp, own concurrency group
(onionwire-ci-pi-fuzz) so the ~12min cold build does not serialize the
test/sdk jobs. Path allowlist extended with fuzz/** and
scripts/run-fuzz.sh so fuzz-only PRs actually trigger it.

Job is a no-op until PR #103 lands on main; the fuzz/ crate is a
detached workspace that root cargo test/clippy never sees.
2026-09-17 20:57:50 -04:00
rust-dev
bcee6a72a6
fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers
Four pure parsers eat untrusted peer input and had no structured fuzzing:

- ratchet_frame  -> RatchetState::from_bytes + RatchetState::decrypt
                    (the 'rat ' frame parser: prefix, version, length,
                    N/PN bounds, DH step, AEAD open)
- qr_decode      -> qr::decode on pasted/scanned invite strings
- dispatch_classify -> dispatch::classify on raw decrypted plaintext,
                    including the 'rat ' -> Kind::Ratchet routing arm
- file_decode    -> file::decode on 'fil ' chunk frames

No src/ change: every target calls the shipped public API. The fuzz crate is
its own workspace (empty [workspace] table), so no root Cargo.toml dependency
is added and cargo build/test at the root never compiles it.

Seeds in fuzz/seeds/ are committed and copied into the gitignored working
corpus by scripts/run-fuzz.sh; each target asserts properties a panic-free
decode must hold (a rejected ratchet frame leaves the state byte-identical,
a decoded invite is 32/32/onion-shaped, a decoded chunk re-encodes).

Verified: cargo +nightly fuzz list -> 4 targets; scripts/run-fuzz.sh with
FUZZ_SECS=60 FUZZ_JOBS=4 -> exit 0, oom/timeout/crash: 0/0/0 for all four,
fuzz/artifacts/* empty.
2026-09-17 20:52:44 -04:00
4a06d794f1 Merge pull request 'ratchet: freeze the v1 state/frame wire format with guard tests' (#98) from wt/t_0ffa68d2 into main
All checks were successful
ci / test (push) Successful in 4m50s
ci / sdk (push) Successful in 55s
Reviewed-on: #98
2026-09-18 00:50:37 +00:00
ba3c39cfe1 Merge branch 'main' into wt/t_0ffa68d2
All checks were successful
ci / test (pull_request) Successful in 4m59s
ci / sdk (pull_request) Successful in 1m7s
2026-09-18 00:50:24 +00:00
fa53237968 Merge pull request 'tests: assert the DH ratchet step in lockstep on a bidirectional burst' (#97) from wt/t_d686a78c into main
Some checks failed
ci / test (push) Has been cancelled
ci / sdk (push) Has been cancelled
Reviewed-on: #97
2026-09-18 00:49:29 +00:00
rust-dev
6827b87a29
tui: F8 rotate prekey + Node::rotate_prekey (hard cut, drops ratchet state)
All checks were successful
ci / test (pull_request) Successful in 5m0s
ci / sdk (pull_request) Successful in 1m11s
android-ci / android (pull_request) Successful in 8m36s
The signed prekey was set at invite creation and never rotated: a long-lived
static is a long-lived forward-secrecy window. F8 now rotates it.

- Node::rotate_prekey(): new X25519 keypair, written through the existing
  replace_identity_keys prekey columns (no store change needed), live Keys
  updated, new pubkey returned for the invite re-encode. Identity untouched.
- It drops every stored ratchet session: the bootstrap epoch is derived from
  the prekey DH, so each friend has to F3-paste the new invite. Nothing is
  pushed to peers \u2014 there is no in-band prekey update.
- TUI: F8 on Main opens the confirm screen (type ROTATE, same prompt as F4),
  then re-opens the F2 share path with the new invite; help overlay + footer
  hint list it.
- Docs: THREAT_MODEL gains a section on the F8 hard cut and the prekey-bound
  epoch bullet; README key table and PROTOCOL 'Roles and keys' follow.

Tests: node-level rotation test (identity/pk/stored row/ratchet drop/invite),
tests/rotate.rs screen text + prompt, tui_chrome help needs F8.
2026-09-17 20:48:10 -04:00
Hermes rust-dev
69672809ab
tls: default to Arti's rustls backend (drop OpenSSL from TLS)
All checks were successful
ci / test (pull_request) Successful in 6m47s
android-ci / android (pull_request) Successful in 8m21s
ci / sdk (pull_request) Successful in 1m25s
Arti's TLS backends are non-additive; the root crate defaulted to
`native-tls` (OpenSSL). Switch `default = ["rustls"]` and pin the `rustls`
crate with its `ring` feature — `tor-rtcompat` pulls rustls in with
`default-features = false`, so without that pin the backend compiles with no
`CryptoProvider` and the first TLS config fails (same reason already recorded
in crates/onionwire-sdk/Cargo.toml).

`native-tls` stays as an opt-in feature. SQLCipher still builds vendored
OpenSSL (`bundled-sqlcipher-vendored-openssl`); that is unrelated to TLS.

- tests/tls_backend.rs: compile-time pin that the default features select
  rustls, plus a runtime check that rustls resolves a provider with no manual
  install.
- ci.yml: the root `test` job no longer installs pkg-config/libssl-dev (the
  SDK job keeps it).
- docs: README build deps, ARTI_UPGRADE backend table, release-body and the
  SDK README now describe the rustls default; the false "binaries link
  libssl.so.3 dynamically" claim is corrected.
- crates/onionwire-sdk/Cargo.lock: regenerated for the root crate's new
  dependency (separate workspace, --locked would otherwise fail).
2026-09-17 20:48:05 -04:00
agent
dff37fe00e
docs+tui: reachability stance (no sealed mailbox) and peer-unreachable queued footer
Some checks failed
ci / test (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
android-ci / android (pull_request) Has been cancelled
Add a Reachability section to docs/THREAT_MODEL.md: no sealed mailbox or
server-side message store, the chat outbox is local-device retry only, and
there is no mutual-online indicator — a send is a one-shot Noise IK session
and an unanswered dial queues locally with the retry clock shown.

OutboxSummary now carries the outstanding row's attempt count and soonest
retry, so the footer reads 'peer unreachable, queued (n/8, retry 45s)'
instead of a bare 'n queued'. Tests updated to the real outbox wording; the
Android KDoc note stops claiming the footer copy is mirrored (Android shows
per-row 'queued (try n/8, retry …)' via OutboxDetail).
2026-09-17 20:44:28 -04:00