Repository navigation
Apply dustlimit and cut_through in StreamComputeIndex - #61
bitsagarob wants to merge 2 commits into
Conversation
acb48d5 to
442121c
Compare
|
Thanks for the PR. A quick pre-check: Can you clear up one thing for me. It seems like outputs are individually dropped within a transaction and not once all taproot outputs within the transaction are spent. My agents seem to confirm this. Cutting outputs pre-maturely will lead to undetectable unspent outputs within the transaction. The following example applies:
Regarding the architecture decision with an index I will do a deep-dive. I was already experimenting with a form of cut-through for outputs which received twice and noticed that also requires some additional indexes for speeding things up. Perhaps the approaches can be combined. In the meantime could you please double check that the lost fund scenario does not apply. Cheers! |
cd951e2 to
f6cfcbc
Compare
dropping single outputs stops a BIP-352 scanner at the first missing k
f6cfcbc to
d85f5f0
Compare
|
Confirmed against the BIP-352 reference implementation: a tx carrying k=0 and k=1 to the same recipient returns 2 outputs when both are served, and 0 when only the spent k=0 is withheld. The scan stops at the first k it can't match as you describe. Fixed in |
GRPC.md marks both fields reserved. This implements them, on StreamComputeIndex only.
Both filters apply per transaction, never per output. A tx is kept when at least one of its outputs is unspent at the pinned tip and at or above dustlimit, and a kept tx carries all of its output prefixes.
dustlimit: 0 with cut_through: false returns the stored index unchanged, by an early return.
Running here on a full mainnet index. Block 900000: 39677 bytes unfiltered, 7588 with cut_through.
Caveat: cut_through costs a spend lookup per output. Measured end to end over 200 blocks at height 900000, 327 ms/block against 5 ms unfiltered. Fine for a batch client, too slow to serve live. A materialised index is the real fix, presumably what tweaks_cut_through_with_dust_filter was for. Happy to do that instead.