Repository navigation
Friglet cleanup 3/6: narrow IPC and harden key storage (SNB-661) - #69
Merged
Merged
Conversation
setavenger
force-pushed
the
snb-661-stack-03-ipc
branch
from
October 11, 2026 18:13
534cbc6 to
5778b1f
Compare
friglet-ipc items only its own module uses are private now:
write_message, read_message, SpDescriptor::scan_pubkey,
descriptor_checksum, the log-file constants and RotatingLog::with_limit.
No other crate in the workspace uses them, and neither does friglet-ui
(it uses Request/Response/StatusInfo, Client, listen, accept,
read_config_toml and DaemonConfig).
Comments: no frigletctl tool exists; state_file documents the per-wallet
file name; OkWithNote's example is what the daemon sends today;
oracle_connected describes the background poll, not a cache TTL. The
default oracle_url uses the same constant as hosted_oracle_url("bitcoin")
instead of repeating the URL. The roundtrip test sets scan_health twice;
blindbit-cli has four comments that restate the next line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
write_key_file(.., overwrite = true) truncated scan.key and then wrote
it. A crash between the two left an empty key file, and the daemon would
not start until the key was entered again. It now writes
`<name>.tmp` in the same directory (0600 from creation, enforced again
for a leftover temp file), syncs it and renames it over the key file,
like write_config_toml. The file format ("<hex>\n") and the 0600 mode
are unchanged; creating a new key (overwrite = false) still fails when
the file exists.
New test: a reader thread rereads the key while it is replaced 200
times and must only ever see the old or the new key. On the old code it
sees an empty file (failed 13 of 13 runs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setavenger
force-pushed
the
snb-661-stack-03-ipc
branch
from
October 11, 2026 18:14
5778b1f to
f258866
Compare
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #68; review only this stage's commits and diff.
Purpose
Narrow the IPC and CLI interfaces and make scan-key replacement crash-safe. The public protocol and on-disk key format stay the same; replacement now writes and syncs a private temporary file before renaming it into place.
The stage preserves the original reviewed commits and authorship. It is cumulative with stages 1–2 for SNB-661.
Stack
snb-661-stack-02-library(#68)snb-661-stack-03-ipc→snb-661-stack-02-librarysnb-661-stack-04-daemonIncluded original PRs, in merge order: #55 (SNB-676), #59 (SNB-683).
Verification
Full accumulated debug gate on this exact head:
cargo check --workspace --all-targets --all-features: clean, 0 warnings.cargo check -p blindbit-lib --no-default-features --all-targets: 5 baseline warnings, no growth.cargo clippy --no-deps -p friglet -p friglet-ipc -p friglet-tray --all-targets -- -D warnings: clean.cargo fmt -p friglet -p friglet-ipc -p friglet-tray -- --check: clean.cargo test --workspace: 257 passed, 1 ignored, 0 failed.The combined suite includes the Unix reader/writer stress regression that allows only the old or new key during 200 replacements and checks the final
0600mode. The original source PR did not run a Windows cross-check; this grouped stage adds no new Windows runtime evidence.Landing
Merge the six grouped PRs in numeric order with merge commits. After #68 lands, retarget this PR to
integration, verify its base and diff, and only then merge it. Preserve the predecessor branch until this PR has been retargeted if necessary. After this PR lands, apply the same process to stage 4. Never merge a child PR into its feature-branch base.