electrum: configurable SP tweaks dust floor (default 1000) - #413
Merged
Conversation
Serve-time omit of P2TR output_pubkeys with value <= --sptweaks-dust (conf sptweaks_dust). Default 1000 sats. 0 serves every value. 546 matches Cake electrs sp_min_dust. The thin index is unchanged.
omit_dust_rows is one retain_mut. JSON encode skips dust outs without a pre-walk. Spent cut-through matches live vouts as an in-order subset instead of nested any.
Encode already skips dust, so omit_dust_rows was dead in lib builds (-D dead-code). Dust tests now assert the JSON encoder. Spent cut-through no longer clones every vout list then walks rows again: one spent.idx batch, one compact. Live-vout subsequence lives next to unspent_create_vouts. Naive hole path drops empty txs in the same loop.
rearden-grok
Bot
force-pushed
the
electrum/sptweaks-dust
branch
from
September 10, 2026 16:48
5ec92c3 to
a61c876
Compare
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.
Summary
Electrum
blockchain.tweaks.subscribenow omits P2TRoutput_pubkeyswithvalue <= --sptweaks-dust(confsptweaks_dust=) and drops txs that then have none. The thin--sptweaksindex is unchanged — this is send-time only (values already come from thetxoutjoin).<= 1000not served).0serves every value, including 0-sat.546matches Cake electrssp_min_dust.Cake cannot be identified on the scan socket, so this is an operator knob rather than a client-name gate.
Serve path is one write walk, not mutate-then-encode:
spent.idxbatch, then compact live P2TR in place (keep_unspent_vout_subsequence— live vouts are an in-order subset of the requested list).Test plan
cargo test -p rbitcoin-store keep_unspent_vout_subsequence --libcargo test -p rbitcoin-query --lib sp_tweakscargo test -p rbitcoin-electrum --lib tweakscargo test -p rbitcoin-node sptweakscargo clippy -p rbitcoin-electrum -p rbitcoin-query -p rbitcoin-store -- -D warningscargo build -p rbitcoin-node