lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.19k stars 483 forks source link

Self cleanup of utxos when they grow #2940

Open tzarebczan opened 4 years ago

tzarebczan commented 4 years ago

We need the coinchooser to be smarter and clean up large lists of UTXOs after X amount (maybe 1k to start?). If not, this bogs down all wallet operations since it needs to load the entire uxto set on each one.

tzarebczan commented 4 years ago

sqlitecoinchooser is supposed to take care of this.

kauffj commented 3 years ago

@eukreign is this fixed in rewrite?

kauffj commented 3 years ago

@eukreign is this fixed in rewrite?

eukreign commented 3 years ago

TLDR; this is not currently solved in new SDK and there is more than one way to solve it depending on if you're in SDK server mode (postgres) or in desktop client mode (sqlite)...

new SDK can solve this when running with postgresql (implement a coin chooser in pl/sql) but for the desktop mode it's still a problem if you have a lot of UTXOs and it needs to load all of them to do the selecting, @jackrobison had a solution that simplified the selection algorithm where it could be done with sqlite (we can look at porting his work to the new SDK when we get to this point)