Repository navigation
feat(wallet): add opt-in filtered internal script sync - #645
Draft
byhashdong wants to merge 1 commit into
Draft
byhashdong wants to merge 1 commit into
byhashdong wants to merge 1 commit into
Conversation
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.
Description
Related to #269. Add opt-in
start_sync_with_pending_spks_atandstart_sync_with_pending_spksrequest builders, preserving the existing all-revealed-script methods and their defaults.The new policy retains every revealed external script. It omits an internal script only when its canonical receiving outputs have all been spent and every relevant receiving/spending transaction meets the confirmation threshold.
Noneselects six confirmations; zero is treated as one. Unused, unspent, unsettled and incompletely known histories remain included. Expected transaction IDs are preserved.Notes to the reviewers
This draft is for reviewing the API and filtering policy. Eligibility is recomputed from the current canonical graph on each call; nothing is permanently marked finalized. Received and spent outpoints are compared, rather than transaction counts, so multi-output and partial-history cases cannot accidentally balance. Floating outputs without a full parent are retained conservatively.
This assumes internal addresses are not reused after omission. A payment to an omitted script cannot be discovered through that filtered request; callers need the existing all-revealed request or a full scan to discover it. Learned reuse and learned reorgs cause reconsideration on subsequent calls.
This reduces remote script-history requests, not local asymptotic work: request construction still scans graph history and allocates temporary sets. A synthetic test reduces 38 scripts to 6 while checking the retained identities; it is not a production throughput benchmark.
Validation:
cargo +nightly fmtpinned tonightly-2026-08-01, the version accepted in [cont_integration]fmtjob should pin the nightly compiler #535. Latest nightly rewrites unrelated descriptor macros and can break them; no formatter-only changes or justfile overrides are included in this PR. Changed code and the full tree pass the pinned nightly format check.The implementation is independent; the application code linked in #269 informed the intended policy, rather than being copied.
Changelog notice
Added:
Before submitting