Skip to content

electrum: configurable SP tweaks dust floor (default 1000) - #413

Merged
reardencode merged 3 commits into
masterfrom
electrum/sptweaks-dust
Sep 10, 2026
Merged

electrum: configurable SP tweaks dust floor (default 1000)#413
reardencode merged 3 commits into
masterfrom
electrum/sptweaks-dust

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Electrum blockchain.tweaks.subscribe now omits P2TR output_pubkeys with value <= --sptweaks-dust (conf sptweaks_dust=) and drops txs that then have none. The thin --sptweaks index is unchanged — this is send-time only (values already come from the txout join).

  • Default 1000 sats (<= 1000 not served).
  • 0 serves every value, including 0-sat.
  • 546 matches Cake electrs sp_min_dust.
  • Height keys stay (Cake last-key progress).

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:

  • Dust is skipped while encoding JSON (no extra row retain).
  • Indexed spent cut-through: one spent.idx batch, then compact live P2TR in place (keep_unspent_vout_subsequence — live vouts are an in-order subset of the requested list).
  • Naive hole path drops empty txs in the same loop.

Test plan

  • cargo test -p rbitcoin-store keep_unspent_vout_subsequence --lib
  • cargo test -p rbitcoin-query --lib sp_tweaks
  • cargo test -p rbitcoin-electrum --lib tweaks
  • cargo test -p rbitcoin-node sptweaks
  • cargo clippy -p rbitcoin-electrum -p rbitcoin-query -p rbitcoin-store -- -D warnings
  • cargo build -p rbitcoin-node

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
rearden-grok Bot force-pushed the electrum/sptweaks-dust branch from 5ec92c3 to a61c876 Compare September 10, 2026 16:48
@reardencode
reardencode merged commit f02f863 into master Sep 10, 2026
16 checks passed
@rearden-grok
rearden-grok Bot deleted the electrum/sptweaks-dust branch September 10, 2026 17:24
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