cculianu / Fulcrum

A fast & nimble SPV Server for BCH, BTC, and LTC
Other
325 stars 73 forks source link

Feature Request: don't index addresses below a certain threshold #222

Open 1ma opened 6 months ago

1ma commented 6 months ago

The BTC UTXO set has grown a lot in 2023 due to the dust UTXOs left over by the DDoS attack it has been suffering for most of the year. This probably has had and will continue to have a negative impact in the storage requirements of Fulcrum when used to index BTC.

For users that are interested in querying their own balances all this information is irrelevant, though.

I think it would make sense to add an optional configuration option that could be called something like ignore-below. This option would prompt Fulcrum to not index any address holding less than the specified amount of sats. For instance, a user could set ignore-below=1000 in his config, or whatever value below his smallest UTXOs to save disk space.

I'm not sure it is easy to implement, because addresses may go above and below the ignore threshold "dynamically" (i.e. not start as dust addresses, but end up being so, and vice versa). Also I think this option should not take 0 balance addresses into account, these should still be indexed (nearly all users will have spent 0 balance addresses that they'll still want to see).

cculianu commented 6 months ago

Fulcrum indexes address histories mostly. The UTXO thing is not very costly in terms of storage. The history is. Most straightforward thing is to ignore the history of txn outputs that are below a certain amount.

Anything else gets confusing.

1ma commented 6 months ago

I see, thanks!

If you want to work on this and do a feature branch I can build it and I'm willing to help with the testing.

cculianu commented 6 months ago

Remember that last time I did some work for you guys for free and was promised a bounty and got $0 to show for it? Fun times.

So you want me to work for free again? Not gunna happen, sorry.

I'm leaving this issue open here. If people chime in for this feature at some point maybe then, might get some traction.

Would take me hours of testing to implement this -- for something that is very niche and almost an anti-feature for most people, aside from maybe personal server people, which is not even the main focus of Fulcrum anyway.