Repository navigation
blindbit-lib: remove the unused full-transaction receive path (SNB-662) - #75
Merged
Merged
Conversation
Nothing calls Scanner::scan_transaction_full: the daemon receives through scan_transaction_short plus apply_block_relevant on the external indexer, and only the BIP-352 vector tests reached the full path. Removed: - Scanner::scan_transaction_full and the imports only it used - utils::construct_dummy_tx, placeholder_txout and their unit tests - the five full-path vector tests (full receive boundary, sparse vout layouts, K_max at the boundary, both label parities, extra change label) and the helpers only they used (full_item, assert_spout_invariants, the sparse layout and per-vout amounts); build_transaction_at is folded into build_transaction Kept: - BIP352_K_MAX, now #[expect(dead_code)]: SNB-540 (PR #18) uses it for the live-path enforcement and its compile-time assert against bdk_sp::K_MAX, which will fail the expectation and force its removal - every live/short-path vector test unchanged (including the ignored live K_max test), fixture_loader_is_strict and the input-tweak test Added: - official_vectors_derive_expected_addresses: the address check that only ran inside the full-path boundary test, now for all 29 receiving sub-cases, plus the sp_address the Electrum index serves - official_vectors_extra_change_label_is_harmless_on_the_live_path: the change-label comparison ported to the live receive step (live_receive takes the label set to register) Docs and comments that described the full path are reworded, including the root Cargo.toml secp256k1-sys opt-level comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uts (SNB-662) Review follow-up. The removed sparse-vout test was the only check that an output paid after a non-taproot output is stored at its real vout; the live path depends on that too (bdk_sp's scan_txouts numbers outputs before it picks the taproot ones), and every other receive test pays taproot outputs only. The new test puts a P2WPKH output in front of every vector output and runs the live receive step. Also rewords the secp256k1-sys opt-level comment, which read as if the ignored K_max test still ran in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the SNB-668 review follow-up (README: http_addr is obsolete but still accepted). No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setavenger
added a commit
that referenced
this pull request
Oct 30, 2026
Brings #18 up to date with master after the Friglet Deslop cleanup (#67-#76). Conflicts resolved as described in #75: - blindbit-lib/Cargo.toml, friglet/Cargo.toml: keep #18's bdk-sp rev pin and comments on top of the reduced manifest lines from SNB-670. - scanning.rs: BIP352_K_MAX loses its #[expect(dead_code)] (the compile-time assert against bdk_sp::K_MAX now uses it); its doc no longer mentions the removed scan_transaction_full, which stays deleted. - bip352_vectors.rs: the full-path K_max boundary test stays deleted; the live K_max test takes the label set and imports BIP352_K_MAX; its doc no longer links the deleted test. - Cargo.toml: the secp256k1-sys comment no longer says the live K_max test is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #74 (SNB-668, HTTP API removal), which sits on #72 (
snb-661-stack-06-docs, top of the Friglet cleanup stack #67–#72); review only the commit after #74. Retargets tointegrationonce #67–#72 land. This change has no code dependency on #74; it is stacked only because SNB-671 (on top) touches the same files as both. The maintainer can reorder.Implements SNB-662, decided by the maintainer on 2026-10-11. Net −938 lines (174 added, 1,112 removed).
What goes, and why
Scanner::scan_transaction_fullwas blindbit's original receive path (Nov 2025): the oracle sent each transaction's full outputs and the scanner checked every one. Since 15 Nov 2025 (f6cb002) friglet uses the short path (8-byte output prefixes, then the block over P2P on a probable match). Nothing in the workspace has called the full function since; only BIP-352 vector tests reached it.Scanner::scan_transaction_fulland the imports only it used (SpOut,Hash,FullTxItem).utils::construct_dummy_tx,placeholder_txout(the fake transaction it scanned) and their five unit tests.official_vectors_cover_blindbit_full_receive_boundary,..._survive_sparse_vout_layouts,..._enforce_k_max_at_the_blindbit_boundary,..._cover_both_label_parities(both parity branches stay covered: the live receive test must find the even- and odd-parity vectors' labelled outputs),..._extra_change_label_is_harmless; and the helpers only they used (full_item,assert_spout_invariants, the sparse vout layout, per-vout amounts).build_transaction_atis folded intobuild_transaction; every test output now carries the same amount, which no remaining test checks.What stays or moves
BIP352_K_MAXstays (PR fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18 uses it), marked#[expect(dead_code, reason = …)]: the live path does not enforce K_max yet (SNB-540). fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's compile-time assert againstbdk_sp::K_MAXwill use it, the expectation then fails, and the attribute has to go (see the fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18 recipe below).fixture_loader_is_strictand the input-tweak test.live_receivetakes the label set to register.official_vectors_derive_expected_addresses: the check against the officialexpected.addressesused to run only inside the removed full-path boundary test. It now runs over all 29 receiving sub-cases (labelled and unlabelled, bothSpIndexerV2::get_addressand aSilentPaymentCodere-derivation), plus thesp_addressthe Electrum index and control socket serve (friglet-ui derives the same address). No scanning, so it is cheap.official_vectors_extra_change_label_is_harmless_on_the_live_path: the removed test showed that registering the change label m=0 on top of a vector's labels hides nothing, which is what lets the live tests use exactly the vector's labels while production always registers m=0. It now runs on the live receive step for the 26 non-K_max sub-cases and checks that 32 outputs were compared.official_vectors_live_receive_step_keeps_vouts_among_non_taproot_outputs(added after review): the removed sparse-vout test was the only check that an output paid after a non-taproot output is stored at its real vout. The live path depends on that too (bdk_sp'sscan_txoutsnumbers outputs before it picks the taproot ones), and every other receive test pays taproot outputs only. The new test puts a P2WPKH output in front of every vector output and runs the live receive step.blindbit_scanner, the section header, the rootCargo.tomlsecp256k1-sys opt-level comment; the setting stays).Test time
cargo test --workspacewallThe two removed tests that scanned the 2,324-output K_max vector through the full path were most of the blindbit-lib time.
Reviews
review: ship with fixes. Applied: the restored live vout test above, the opt-level comment wording, and this description's parity wording.thermo-nuclear-review: ship, no findings (only removals and doc changes in non-test code; no live-path function changed; the fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18 recipe matchesgit merge-treeand every conflicting hunk).Verification
cargo test --workspace: 252 passed, 1 ignored, 0 failed. That is friglet: remove the HTTP API (SNB-668) #74's 259, minus the 5 full-path vector tests and the 5construct_dummy_txunit tests, plus the 3 new tests.cargo test -p blindbit-lib --features serde bip352: 7 passed, 1 ignored (the live K_max test, SNB-540).-D warningson friglet/friglet-ipc/friglet-tray: clean. fmt check: clean.cargo check --workspace --all-targets --all-features: 0 warnings (so#[expect(dead_code)]is fulfilled in lib and test builds)./usr/bin/time -v): base 3.23 ± 0.05 s CPU (user+sys) and 3.40 s wall per scan, this PR 3.24 ± 0.02 s CPU and 3.42 s wall. All runs end in the same state file (sha2568c7aec9071b0…, as in blindbit-lib: one code path in the scan loop (SNB-669) #52).PR #18 (SNB-540) on top of this
#18 is untouched (open against
master, headsnb-540-live-kmax5e9f4c7). It does not merge cleanly onto this branch. Two of its four conflicts come from the cleanup stack regardless of this PR (SNB-670 rewrote thebdk_sp/indexermanifest lines it pins); two come from this PR. A trial merge with the recipe below builds,cargo check --workspace --all-targets --all-featureshas 0 warnings, andcargo test -p blindbit-lib --features serde bip352 -- --include-ignoredpasses 7/7, including the live K_max test #18 un-ignores (21.4 s).Resolution recipe
blindbit-lib/Cargo.toml: take theirs (fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's 4-line pin comment + bothrev = "94b72f60b0015793e4db67355bdab8d240eecc00"lines), minus the four commented-out# bitcoin/# bdk_sp/# indexerlines SNB-670 removed.friglet/Cargo.toml: edit = fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's 2-line comment + SNB-670's reduced form with fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's rev:scanning.rs,BIP352_K_MAXdoc: edit. Drop the#[expect(dead_code, ...)](theconst _assert now uses the constant; left in place it raisesunfulfilled_lint_expectations, verified). Neither side's doc text (ours says "not enforced yet", theirs links the removedScanner::scan_transaction_full); use:const _assert that follows (auto-merged).scanning.rs,scan_transaction_full: take ours (the function stays deleted; fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's comment edit inside it is dropped).bip352_vectors.rs, big hunk: take ours (drops fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's doc rewrite of the deletedofficial_vectors_enforce_k_max_at_the_blindbit_boundary).bip352_vectors.rs, live K_max hunk: edit = both lines:bip352_vectors.rsimports:use super::Scanner;->use super::{BIP352_K_MAX, Scanner};(fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's live K_max test uses it; 662 dropped the import).bip352_vectors.rs, live K_max test doc: fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18's last sentence links the deleted test. Replace"Expensive for the same reason as [
official_vectors_enforce_k_max_at_the_blindbit_boundary]: the external indexer's scan is quadratic in the 2324 outputs."with
"Expensive: the external indexer's scan rescans the shrinking candidate pool for every derivation order, which is quadratic in the 2324 outputs."
BIP352_K_MAXdoc link toScanner::scan_transaction_fullis gone by step 3.Cargo.tomlsecp256k1-sys comment: drop ", ignored until SNB-540" from "(today only the live K_max test, ignored until SNB-540)" once fix: enforce BIP-352 K_max on the live receive path (SNB-540) #18 un-ignores it. Keep the setting.After these steps:
grep -rn 'scan_transaction_full\|enforce_k_max_at_the_blindbit_boundary\|full_item' blindbit-lib/srcfinds nothing; no conflict markers.