Skip to content

feat(tor): centralize embedded onion routing - #2546

Draft
ethicnology wants to merge 7 commits into
developfrom
feat/onion-tor-replace-tor
Draft

feat(tor): centralize embedded onion routing#2546
ethicnology wants to merge 7 commits into
developfrom
feat/onion-tor-replace-tor

Conversation

@ethicnology

Copy link
Copy Markdown
Member

No description provided.

@ethicnology
ethicnology force-pushed the feat/onion-tor-replace-tor branch from 3023d45 to f6d793e Compare July 31, 2026 11:07
The connecting screen's retry budget and backoff lived in the bloc, which
owns presentation only: orchestration belongs one layer down where it can be
tested without pumping a bloc.

Behaviour is unchanged — same three attempts on the same 1s/2s/3s schedule,
and the attempt number is still published before each call so the screen names
the attempt in flight. The single-shot check that guards vault creation keeps
its own collaborator: there the user is already committed, so a retry budget
would only delay the error.
The first attempt slept a second before it ran, so every backup flow paid it
even when the server answered immediately. Tor readiness is already awaited
before this use case starts, so that delay guarded nothing.

Retries keep their backoff, now 1s and 2s between attempts instead of 1s, 2s
and 3s before them: worst case drops from six seconds of waiting to three.
The Tor work added 21 keys to the en template only, so 26 otherwise-complete
locales fell back to English on the new Tor settings and RecoverBull
connecting screens. All 21 are now present everywhere.

torSettingsInfoDescription also still claimed embedded Tor is used "only by
RecoverBull", which contradicted the adapter and the neighbouring copy:
embedded Tor carries Bitcoin Electrum .onion servers too, and Orbot replaces
it for those servers only when enabled. Corrected in the template and in
every locale.

Applied with tools/arb.dart, so untouched keys stay byte-for-byte identical.
`audit-placeholders` reports no mismatch, so {percent} and {transport} survive
in all 26 locales. These translations have not been reviewed by native
speakers — worth a pass before release. Hinglish deliberately keeps the
English terms for "Embedded Tor", "Automatic", "Direct" and "Active
transport", which `audit-identical` will flag as expected.
@ethicnology
ethicnology force-pushed the feat/onion-tor-replace-tor branch from f6d793e to 7026226 Compare July 31, 2026 13:50
Both surfaces read the blockage only from TorConnecting, so the moment Arti
gave up the reason was dropped and the user was told to "try again". That is
backwards: TorUnavailable carries TorBootstrapFailure.diagnostic all the way
from the backend, and in `direct` mode nothing falls back to Snowflake — the
failure screen is then the only place the user can learn that the network, not
the app, is the problem.

The RecoverBull page reads that diagnostic outside the blockage grace period on
purpose: the grace exists to ride out a transient readiness dip, and a terminal
failure is not one. Its timing fields move into setState in the same change,
because they are what the grace and the progress bar are computed from and
build reads them — mutating them bare only appeared to work because the
one-second ticker rebuilt regardless.
The transport selector reached for Material's DropdownButton while
core/widgets/dropdown already owns BBDropdown, which carries the popup shape,
fill and chevron the rest of the app uses. Same generic API, so this is a
straight swap.

Eight other feature files still do this; they are not touched here.
Resolutions worth knowing about:

- gap -> bull_ui: develop vendored Gap into bull_ui and dropped the `gap` dependency (#2558). The three tor/recoverbull widgets that still imported `package:gap/gap.dart` now import `Gap` from bull_ui. Note that pubspec.yaml auto-merged without conflict, so the dependency was already gone while those imports remained — the compiler, not git, caught it.
- connecting_page: took bull_ui's Gap and dropped the `gif` import, which this branch had already removed along with the animation.
- recoverbull_repository: develop swapped `package:hex` for `package:convert` (`convert.hex.decode(_normalizeHex(x))`) while this branch changed `externalProxy:` to `endpoint:`. Orthogonal, so both sides kept.
- recoverbull_repository_test: git auto-merged this file with no conflict, but develop's new hex-tolerance group still called the pre-branch signature. Ported to the 4-positional-argument `fetchVaultKey` and `endpoint:` stub.
- localization: took develop's 27 .arb wholesale, then replayed this branch's 21 Tor keys and its updated torSettingsInfoDescription through tools/arb.dart, so every other key stays byte-for-byte unchanged. Verified per locale: develop's keys untouched, the branch's per-locale translations restored.

Ran build-runner (TorSettingsState and SettingsEntity both gained fields), then `make checks` green: analyze, bull-ui-check, fix-check, format-check, and 940 + 21 + 1 + 23 unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant