Closed kcalvinalvin closed 3 years ago
Does the size of the pollard grow even if ttls are not used at all?
Does the size of the pollard grow even if ttls are not used at all?
We still remember them so it does take up space. You can test it out on the master branch by commenting out this code https://github.com/mit-dci/utreexo/blob/0c940de7b6d9ff864e8a1d1282298e7cbc8f7202/accumulator/pollard.go#L151-L154
With it commented out, the CSN barely uses any memory. With it, CSNs go up to 7GB around block 1,300,000 on testnet3
UTXOs are currently marked with ttl value of 0. Since 0 < 1000 is true, the pollard was remembering all the UTXOs ever, leading to a ton of memory usage. With this change, CSNs see a lot less memory usage.
This PR still sees the remembered leaves growing over time so there might still be a problem yet to be fixed.