docs: clarify address-sync catch-up nonce and buffer comments#3784
docs: clarify address-sync catch-up nonce and buffer comments#3784QuantumExplorer wants to merge 1 commit into
Conversation
Review follow-ups to PR #3650 (comment-only, no behavior change): 1. Correct the synthesized-nonce comment. The old TODO claimed clients recover via `AddressInvalidNonceError.expected_nonce`, but no such handler exists anywhere in the SDK/wallet. The real reason nonce=0 is safe is that every spend path re-fetches the authoritative nonce at build time (`fetch_inputs_with_nonce` + `nonce_inc`), so the synced value is cosmetic and is never broadcast. 2. Document `result.absent.remove(...)` as a deliberate fix that keeps `found` and `absent` disjoint when a post-checkpoint funding lands on an address the branch scan proved absent (previously it could appear in both sets). 3. Drop the in-source reviewer handle and PR number from the unbounded-buffer NOTE; keep the bounded-memory mitigation guidance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Review complete (commit 9b2f988) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Comment-only PR clarifying three review notes in packages/rs-sdk/src/platform/address_sync/mod.rs from PR #3650. Both reviewers verified the new wording is factually accurate (e.g., fetch_inputs_with_nonce + nonce_inc flow exists, no AddressInvalidNonceError.expected_nonce handler), and there is no behavior change. Nothing to flag.
Issue being fixed or feature implemented
Review follow-ups to #3650 (stacked on top of its branch). Comment-only — no behavior change, no logic touched. Addresses three reviewer notes:
AddressInvalidNonceError.expected_nonce, but there is no such handler anywhere inrs-sdk/rs-platform-wallet/swift-sdk. The actual reasonnonce = 0is harmless is that every address-spend path re-fetches the authoritative nonce at build time (fetch_inputs_with_nonce+nonce_incinaddress_inputs.rs), so the synced value is cosmetic and never lands in a broadcast transition. A future reader following the old comment would go hunting for a recovery path that doesn't exist.result.absent.remove(...)was undocumented. It's a deliberate fix that keepsfoundandabsentdisjoint when a post-checkpoint funding lands on an address the branch scan proved absent (previously the address could appear in both sets). Now commented as such at both call sites.NOTEreferenced@thepastaclawandPR #3650, which go stale once merged into history. Kept the substance (bounded-memory mitigation: buffer keys only, re-derive on replay).What was done?
apply_block_changesto state the real reason the synthesized0is safe (build-time authoritative fetch), and downgraded the replay-site comment to a back-reference.found/absentdisjointness fix at both the forward-pass and replay sites.NOTEwhile preserving the mitigation guidance.How Has This Been Tested?
No code paths changed — the diff is exclusively
//line comments inside function bodies, so it cannot affect compilation or runtime behavior. The existingaddress_syncunit tests on the original PR remain the source of truth.Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code