Skip to content

Spend dynamic-key notes first in spare input slots - #123

Open
czarcas7ic wants to merge 31 commits into
adam/swap-receiving-sqlitefrom
adam/swap-receiving-slot-filling
Open

czarcas7ic wants to merge 31 commits into
adam/swap-receiving-sqlitefrom
adam/swap-receiving-slot-filling

Conversation

@czarcas7ic

@czarcas7ic czarcas7ic commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

With NoteSelection::PreferConsolidation, which Vizor uses for ordinary sends and swap funding, the input selector may add up to the shape's spare input slots without changing the fee. The SQLite store now offers Ironwood dynamic-key notes first among those additions, then the smallest notes, so ordinary sends move their value into ordinary internal change. Funding selection is unchanged.

Tests: the library CI matrix (fmt, every scripts/dev.py lane and the three verify scripts) passes at the top of the stack, and the lanes this PR affects pass at this PR.

🤖 Generated with Claude Code

@czarcas7ic
czarcas7ic added this pull request to stack #125 October 7, 2026 21:59
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch from fabbdee to cc88198 Compare October 7, 2026 22:43
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch 2 times, most recently from b370480 to 716e65b Compare October 8, 2026 00:55
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch 3 times, most recently from 357dad6 to f575e6f Compare October 8, 2026 16:14
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch from f575e6f to 4728c2e Compare October 8, 2026 16:44
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch from 4728c2e to 7c475da Compare October 8, 2026 17:26
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch from 7c475da to ddad610 Compare October 8, 2026 21:37
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch from ddad610 to 974108d Compare October 8, 2026 21:58
@czarcas7ic czarcas7ic changed the title Spend swap notes first in spare input slots Spend dynamic-key notes first in spare input slots Oct 8, 2026
With NoteSelection::PreferConsolidation, which Vizor uses for ordinary
sends and swap funding, the input selector may add up to the shape's
spare input slots without changing the fee. The SQLite store now
offers Ironwood dynamic-key notes first among those additions, then
the smallest notes, so ordinary sends move their value into ordinary
internal change. Funding selection is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@czarcas7ic
czarcas7ic force-pushed the adam/swap-receiving-slot-filling branch from 974108d to 004fd99 Compare October 10, 2026 06:07
@czarcas7ic
czarcas7ic marked this pull request as ready for review October 10, 2026 06:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T09:48:52.656726Z 1b6e371 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

czarcas7ic and others added 5 commits October 10, 2026 01:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the funding memo binding, accepted memo identity,
feature-independent dynamic key guard, and seen hits stored with the
sweep attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	librustzcash/zcash_client_sqlite/CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
czarcas7ic and others added 24 commits October 10, 2026 10:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the publishable dynamic-ivk crate, per-attempt directory
lookups, sweep reopening on candidate replacement, and stored raw
transaction validation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the failed-swap direction fix, the pruning contract, the
feature-independent transaction guard and dynamic decryption for ZeWIF
imports. The changelog keeps this branch's consolidation sentence with
the guard's wording for builds without orchard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9272f14c0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"SELECT {result_columns}
FROM eligible WHERE lock_tier = :selected_lock_tier
ORDER BY value ASC, commitment_tree_position, id"
ORDER BY dynamic_note DESC, value ASC, commitment_tree_position, id"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Try ordinary notes when dynamic notes change the transaction shape

With MultiOutputChangeStrategy, the first dynamic-key candidate can change the wallet metadata and therefore the split-change output count, causing same_change_shape to reject it. The selector only tests prefixes of this ordering, so every subsequent attempt still contains that rejected dynamic note, while later small ordinary notes that could preserve the shape are never tried (and may be omitted entirely when dynamic notes consume the query limit). Thus the new ordering can disable otherwise-valid consolidation instead of falling back to the smallest ordinary candidates.

Useful? React with 👍 / 👎.

Spare-slot filling tries prefixes of the dynamic-first ordering, so a
dynamic-key note that changes the change shape stops it. That only
misses an optional consolidation; the shared selector stays unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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