RandomX's cmake-rs build script panics with "is cmake not installed?"
in the rust:bookworm job container once cuprate-daemon is a default
feature. Install cmake and build-essential in the root test, release,
and fuzz containers. Android jobs already did this.
The Wallets & Settings screen only named keys that already work. F6 is the
wallet, F7 is the node, and p on the roster or chat opens peer payments.
Profile, backup and wipe stay composer commands, named in help.
Node::start_wallet_child is the call the TUI makes. The test stores an
in-process testnet source, starts the child, and checks the typed daemon
client's get_info. It does not bootstrap Tor.
cuprate-daemon is now in the Linux TUI default, so a release build of the
onionwire bin links the daemon with no extra feature flag. A build with
--no-default-features still refuses with NO_FEATURE_MSG. cuprated keeps
default-features = false so Cuprate's arti feature cannot pull arti-client
0.44 next to OnionWire's 0.46.
Cargo.lock is unchanged: cuprated was already an optional dependency.
TUI.md: the `last` line's shape when one half of a save is refused, why an
app-owned source saves with an empty `url` while a typed endpoint with no login
is still refused, and the wording the `chain` row carries in a build without
`cuprate-daemon`.
WALLET.md: the same gate from the node's side, and the start contract — a start
that fails part way stops what it spawned and leaves the chain datadir as the
thing a retry reuses.
Settle the contract the red feature-gated test was fighting, and make the code
and both tests express it: a start that fails after the chain daemon came up is
all or nothing, the same contract
node::tests::a_missing_binary_fails_the_start_and_leaves_no_child asserts one
level up. A daemon left running behind an error has no owner (the caller gets
the error back, not the client), no handle to stop it, and holds 18081 against
the next start; what a retry reuses is the chain datadir on disk, never a
process that outlived its owner. start_with_creds already behaved that way, so
this states the contract where the stop happens rather than changing it.
in_process_source_launches_a_daemon_and_stop_shuts_it_down was red because its
fake monero-wallet-rpc never binds the port its own readiness gate probes:
start() returns that error, the test discarded it with `let _ =`, and it then
asserted the daemon had survived a failed start. It now holds the published
port the way the module's other start tests do
(test_support::PublishedPortHold) and expects the start to succeed, with every
assertion it had kept. The failure path gets its own test instead, which pins
the tear-down: neither child running, the daemon's port closed, the chain
datadir kept.
cuprate::available() was never consulted in the TUI, so the 'chain' row
offered 'in-process node · cuprate in this app' in a build whose only possible
answer is cuprate::NO_FEATURE_MSG. The row now carries that wording where the
choice is made, the same way prune_display()/network_display() carry theirs.
The choice stays in the picker: builds with the feature exist, and a stored
in-process source must still be readable.
A save on F7 ran the wallet-config write first and returned early on its
error, so an empty 'url' row failed the whole save: 'wallet RPC endpoint
required'. That refusal belongs to Wallet::from_config and it is about an
externally run monero-wallet-rpc; an app-owned chain source (local monerod,
in-process Cuprate) spawns its own child with generated creds and a port it
picked, and Node::start_wallet_child_with replaces the stored client after
the spawn, so the url/login rows describe no endpoint the app dials.
- an empty endpoint on an app-owned source no longer vetoes the chain-source
write; the validator itself is untouched, and a *typed* endpoint with no
login is still refused
- both halves of a save are attempted and reported on one line shape, so a
wallet-config refusal cannot silently drop a chain source the user picked
The chain source was reachable from three places and configured from none of
them properly: `F6`'s inline `1`/`2`/`3` picker wrote only the in-process
choice, the `F9` menu showed the state and named keys that edited it, and
`Node::set_local_monerod` / `set_remote_daemon` / `set_receive_only` — the only
way to point the app at a Monero node — had **no TUI caller at all** (Kotlin
only). `wallet::NOT_CONFIGURED_MSG` told users to "open F7" and there was no F7.
F7 (`WalletSetupConfig`) is now the one screen that sets up the node:
- The `datadir` row is new and editable. `Node::set_local_monerod_at` takes the
path; `set_local_monerod` delegates with the derived default, so an existing
install keeps the store it already has. An empty datadir is refused rather
than silently replaced — a store that moved unasked looks like a vanished
chain and resyncs somewhere the user did not choose.
- The `network` row is new: it carries the Cuprate mainnet/testnet choice that
`F6`'s `1`/`2`/`3` used to own, so deleting those keys loses nothing. Mainnet
reads `unvalidated` before it is picked.
- A `NODE` section shows the live `Node::wallet_child_status` line (state, chain
source, `sync h/t`, last error) and the last save/test answer. It is the
node's answer, never the draft above it, and `Ctrl-R` re-reads it.
- `Ctrl-S` saves and starts the child (the daemon, and `monerod` for a local
source); `Ctrl-X` stops it. Both go through the same `Node::start_wallet_child`
/ `stop_wallet_child` the app's own lifecycle uses, so a start that lands on a
wallet with no stored passphrase still reaches the unlock prompt.
F6 loses the chain picker and the `s`/`x`/`p` child keys — it is the wallet
again (receive, balance, transfers, create/import) — and its footer points at
`F7 node`. The `F9` menu's `child`/`sync` rows now name `F7 ctrl-s/x` and
`F7 ctrl-r` instead of keys that no longer exist on F6. `set_cuprate_chain` and
the `p` probe handler are deleted rather than left dead.
The node's own keys are named in the body, on the section they act on: at 80
columns the footer has room for one group and the status line already spends
half the width, which is the same reason the login row names `Ctrl-U`.
Tests: six new cases in `src/tui.rs`'s `wallet_setup_config_tests` drive the real
key path and the real node — the typed datadir reaching `ChainSource::Local`, an
empty one being refused with nothing written, the live row on open, `Ctrl-S`
saving then reporting the node's own refusal, the in-process network pick
reaching the store, and F6 no longer owning keys it does not handle.
`tests/tui_spec.rs`'s menu-key check now asserts the F7 keys; the F6 keys it
asserted before no longer work.
`wallet::NOT_CONFIGURED_MSG` has always said "open F7 to set it up" and there
was no F7. This is that screen.
- `FunctionKey::Setup` on `F7`, live on Main, the settings menu and peer
payments, same invariant `F9` follows.
- `Screen::WalletSetupConfig` carries `WalletSetupConfigState`: a snapshot of
plain data taken when the screen opens, never a handle onto `Node`.
- Rows: the wallet RPC endpoint and its login (never rendered back — the row
says `hidden · set`, `Debug` redacts it), the view-only toggle, and a chain
picker over all four `ChainSource` cases with their own fields.
- `Node::set_remote_daemon` / `set_local_monerod` / `set_receive_only`, so the
TUI can reach what only the Android API could, plus `F6`'s in-process source.
- An untouched chain row is not written, so an F7 save cannot silently undo the
in-process choice; picking a remote daemon says who is trusted in the same
frame, one line, lowercase.
- `Ctrl-T` tests the endpoint and shows the sanitized `PingResult::line()`.
Saving never dials. A rejected form writes nothing — the node validates.
- Docs that claimed there is no F7 (`docs/TUI.md`, `docs/WALLET.md`) now
describe the screen; the settings menu's `endpoint` row names the key.
(cherry picked from commit a48d40bc4e)
Three sources of wasted Pi time, measured over a two-week window
(353 workflow runs, 694 job runs): ~78% of CI wall-clock was spent on
work that did not need to happen.
1. Nothing was ever cancelled. Every `concurrency:` block in the repo
had `cancel-in-progress: false`, and 279 of 353 runs sat in the
queue behind a newer commit on the same branch. The comment
justifying it ("shared the container name `onionwire-ci`") was
stale — the name has been per-run-id for a while — but the real
constraint is the shared cargo target volume, which two concurrent
writers corrupt (`Permission denied (os error 13)` on
/target/debug/deps). So the flag stays false and superseded runs
instead stand down at a new gate: compare GITHUB_SHA against the
remote branch tip and skip. Seconds, not minutes, and it cannot
release the concurrency group into a volume race. Added to
ci.yml (test, sdk) and android-ci.yml (android).
Verified against the run history: Forgejo's pull_request GITHUB_SHA
is the branch head, never a synthetic merge commit (245/245 recorded
PR runs match a refs/pull/*/head tip), so the gate cannot skip a
live run. It fails open — an unresolvable ref runs the job. 232 of
477 historical PR runs would have been skipped.
2. `fuzz` ran on almost every push. A job cannot narrow a
workflow-level path filter, so `fuzz/**` sat in ci.yml's list
beside `src/**` and `crates/**`: 80 of 84 recorded runs touched
nothing in fuzz/, each paying a nightly toolchain install and
`cargo install cargo-fuzz` for 15 seconds of actual fuzzing. Moved
to its own workflow, schedule-only (03:30 UTC, off the arti-watch
slot) plus workflow_dispatch. The build/run single-container fix
and the PATH export from #106/#107 come along unchanged.
3. android-ci built a full APK for commits that touched no android/
file — 95 of 143 runs, at ~11 minutes each. The PR trigger now
covers android/**, crates/onionwire-sdk/**, Cargo.toml, Cargo.lock
and the build script. The push-to-main trigger keeps src/** and
crates/**, so every merge still runs the in-APK checks that earn
their keep (the target_max_memory marker gate, the .so listing, the
sha256 round-trip) — a Rust-only PR now finds out at merge instead
of before it, and nothing reaches a release untested.
Also drops `fetch-depth: 0` from android-ci: nothing in the build
reads git history (PUBLISH_TAG comes from the environment).
ci.yml's `push: [main]` trigger is unchanged. It re-tests trees a PR
already tested identically (73 job runs in the window), but branch
protection is empty, so it is not a merge gate — it is the "CI green
on main" signal docs/RELEASING.md's readiness gate reads, and a merge
commit has a different sha so statuses do not carry over. The
staleness gate already removes most of its cost.
docs/RELEASING.md describes all of the above; its android-ci path
list and its fuzz-job account were both wrong after this change.
`alert_line_prefixes_when_no_color` flipped the process-global `NO_COLOR`
without the `ASCII_ENV` mutex the other env-touching tests in this binary
hold, so a concurrent `remove_var("NO_COLOR")` could win and make
`alert_line()` resolve to Rgb/Ansi16 — the `! ` assertion then failed on an
otherwise green run (measured 1/12 runs at cc1201d).
Inject the colour mode instead of reading the environment in the test:
* `tui::alert_line_for_mode(mode, msg, width)` — `alert_line()` is now a
one-line delegate passing `color_mode()`, so production behaviour is
unchanged and the no-colour path is asserted without touching the env.
* The test now pins all three shapes of that path: `None` prefixes `! `,
Rgb leaves the message verbatim, and an already-prefixed alert is not
double-prefixed.
Also fix the second, same-class race the 20x repeat surfaced:
`wallets_settings_menu_frame_shows_the_shipped_footer` compares a rendered
frame against `status_footer_phased` computed moments earlier, and both read
`ascii_chrome()`/`color_mode()` live — a concurrent `ONIONWIRE_ASCII=1` made
the two sides disagree (✓/… vs ok/...). It now takes the same `ASCII_ENV`
lock and forces the unicode mode.
Evidence (TMPDIR=/home/lancelot/.hermes/tmp/onionwire-tui):
* cargo test --locked -> exit 0, 35 suites, 472 passed, 0 failed, 4 ignored
* cargo clippy --locked --all-targets -- -D warnings -> exit 0
* cargo test --locked --test tui_spec x60 -> 60 ok, 0 failures
* teeth: with the `! ` prefix removed from the None path, the test fails
("expected '! ' prefix in None mode: \"peer down\"") — reverted.
* ONIONWIRE_ASCII=1 cargo test --locked --test tui_spec -> 37 passed (no
unlocked test's outcome depends on the ambient value)
* rustfmt --edition 2024 --check on both files: only the inherited hunks
(src/tui.rs 16 == HEAD 16; tests/tui_spec.rs 3 vs HEAD 4, one inherited
hunk reformatted away by this edit)
App::open_wallet propagated the node's "no receive address" error with `?`,
so on an install with no wallet RPC configured and no profile xmr the Err
travelled out of App::run and out of boot(), and the process exited 1. The
same call already degrades to an empty address on F9.
Degrade it here too, and leave a status note that names the way forward:
this screen's own `c`/`i` create/import keys plus ONIONWIRE_WALLET_RPC.
A configured-but-failing endpoint gets the existing NOT_CONNECTED_MSG
instead of the unconfigured copy. balance and transfers are unchanged.
Tests: F6 on a bare install opens Screen::Wallet with an empty receive_addr,
a status note, and no error text in the frame drawn through App::draw; the
frame after Esc back to Main really renders the note. The control case (a
profile xmr address) still fills receive_addr and sets no note. The existing
offset-notice test asserted the propagation itself and now asserts the screen
it reaches instead.
Report-only audit of the wallet screens at a1f5c878: rendered frames at
80x24/120x40/200x60 for the first-run frame, the F6 wallet screen, the
F6 -> w wallet list, the create-spend-wallet gate and the F9 menu, plus a
findings table located by function and line.
No source file changed.
Monero's `restore_deterministic_wallet` takes a `seed_offset`: a second
spend secret mixed into the 25 words at restore time, so the same words
with a different offset open a different wallet. It is not the wallet-file
passphrase and must never be sealed, stored, logged or put on an argv.
- `Wallet::restore_wallet` gains `seed_offset: Option<&str>`: None, empty
or whitespace-only leaves the field out of the JSON entirely; otherwise
the ends are trimmed and it is sent beside the seed.
- `Node::wallet_restore` passes it through and still seals only the file
passphrase.
- SDK: `import_wallet` keeps its signature (None) and
`import_wallet_with_offset` is added (Kotlin `importWalletWithOffset`).
- TUI: a new `ImportOffset` step between the seed and the file passphrase
(blank Enter skips, a real one is confirmed, a mismatch never dials), and
`ImportOffsetSeen` after a successful import that used one -- Esc cannot
leave it, only SEEN, and the offset is not drawn anywhere.
- Docs: WALLET.md, THREAT_MODEL.md, TUI.md, one README sentence.
`a_restart_opens_the_stored_wallet_file` failed on the Pi runner twice in a
row — CI run 905 job 1373 and run 901 job 1365 — and passed 3/3 on a 16-core
host:
open the wallet with a passphrase: "wallet file onionwire-1 is not open —
the wallet RPC never answered (wallet connect: Connection refused (os error
111))"
The whole `WALLET_OPEN_WAIT` was burned on refusals, so the mock was bound on
a port the restarted child never dialled. Production is not the suspect:
`WalletChild::start_children` builds the child's argv and the `WalletClient`
URL from the same `pick_port` value, and `start_wallet_child_with` installs
that client in `self.wallet` before `open_child_wallet` dials it, so the client
can never carry the previous child's port.
The harness is the suspect. It learned the restarted child's port from the
*shared* argv log — a file every child writes — and cleared that file first.
A clear is not a synchronisation: on a loaded runner the killed child's write
lands after it, so the poller read the port of a child that was already dead
and bound the mock there. Reproduced deterministically with a stand-in whose
exec is late; with the old read the new test fails with the CI message, byte
for byte.
Each fake child now writes `<log>.<pid>` as well, and the shared copy lands
first, so a pid-named file implies the shared one is complete. A test that
spans two children reads the pid-named file: only that child can write it, so
the port belongs to the child that dials it. `WalletChild::wallet_rpc_pid`
(test-only) supplies the pid.
`open_wallet_blocking` already retries while the RPC is unreachable and gives
up after a bounded wait with a typed `OpenFailure::NotAnswering`, so it cannot
refuse forever against a merely slow child: no production change.
new test: node::tests::a_restart_is_not_given_the_stopped_childs_port
The wallet-child tests learn a spawned stand-in's port by polling its argv
log, and `fake_bin`/`fake_child_bin` truncated the log and then appended
one line per argument -- so a poller could read a prefix. A truncated port
is a *valid* u16 ("427" out of "42765"), so `wait_for_child_rpc_port`
happily returned a port nothing was listening on and the restart's
`open_wallet` died with `Connection refused` after its 10s budget; the
same prefix read is what `loopback_and_clearnet_remotes_carry_no_proxy...`
printed with its `--daemon-address` value missing.
Both tests failed on the first CI run of this branch (ci / test) and are
green in isolation, which is the signature of this race rather than of a
code defect. The argv now lands in the log with a single `mv`, so a reader
sees either no log or the complete one.
Measured with a tight read loop (argv-race-probe.sh): the append version
was caught mid-write 1/300 reads, the mv version 0/300.
The status line renders WalletChildInput.lastError through walletChildLine,
and the same field feeds walletChildStatusDescription for the screen reader.
The filter added in 3f84021 sat on the sticky error card only, so in exactly
the state this card targets — a live child with no wallet file open answering
-13 No wallet file — the raw daemon sentence still reached the line and the
screen-reader sentence.
Move it to the producer: WalletChildStatus.toInput() now runs lastError
through walletFailureText, the one seam where the SDK record becomes the
Kotlin model. Idempotent on its own replacement texts, so the error card's
second pass is stable.
New JVM tests build the SDK record and assert on the rendered line (and its
description), not on walletFailureText in isolation: with the filter removed
they fail on the raw 'No wallet file'.
next_wallet_filename returned <default>-<n> for the first n the SQLCipher
catalogue did not hold, and never looked at the wallet directory. monero
writes two files per wallet (<name> and <name>.keys) and refuses a create
that would collide with either, so a file whose catalogue row is gone -
Store::delete_wallet keeps the file, and a create whose record_wallet
failed leaves one - meant every attempt proposed the same taken name and
the daemon answered -21 Cannot create wallet. Already exists. for ever.
Add wallet_name_taken (src/wallet_child.rs): it lists the wallet dir and
answers whether <name> or <name>.keys is already there. next_wallet_filename
now needs the candidate free in both places, and Node::wallet_dir() is the
single source of $ONIONWIRE_HOME/wallet, used by the child spawn too.
Fail closed: an unreadable (or missing) wallet dir is an error, not a
guess. Reads only - nothing here deletes a file the catalogue does not
hold, which may be the only copy of a funded wallet.
The wallet manager could not open a wallet it holds no passphrase for: the
child came up pointed at the file with no wallet open, `needs_passphrase`
was true, and every read answered the daemon's `-13 No wallet file`. The
screen rendered that string.
Phone side of t_67879b98:
* WalletManagerScreen asks for the passphrase when the child reports
`needs_passphrase` and no wallet is open, and submits it through the
parent's `Wire::open_wallet_with_passphrase` on the file the child is
already pointed at. Masked field, no copy action (same rule as the seed
card), wiped on success and on dispose, FLAG_SECURE while the screen is
up.
* `walletFailureText` filters every user-visible wallet failure: the
daemon's `No wallet file`, a bare `-13`, and any JSON envelope become a
plain sentence that says whether a wallet is open and what to do next.
Applied at every site that renders a wallet error, in both wallet
screens and the wallet-child error flow in the ViewModel.
* The wallet screen says "no wallet is open in the child" and where to fix
it, instead of leaving it to surface later as the daemon's own words.
Tests: WalletManagerTest covers the new decisions (prompt shown / not
shown, submit gate and its reasons, the failure-text filter, the open
hint) on the JVM. 203 unit tests green.