-
Notifications
You must be signed in to change notification settings - Fork 725
[Core] Reduce CBlockIndex RAM usage #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Reduce CBlockIndex RAM usage #1502
Conversation
bb048d2 to
30989eb
Compare
85f2c0f to
adfcd45
Compare
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking great 👌 .
Two more things:
What commented about the mapZerocoinSupply applies to the nMoneySupply global object too.
And would be nice to have a reorg functional test verifying that the nMoneySupply and the mapZerocoinSupply gets disconnected/updated properly . We could add it to the mining_pos_reorg.py test.
|
Updated as per feedback. |
851b66a to
d565a73
Compare
on height_ZC_RecalcAccumulators, without a supply checkpoint. Use wrapped serials check instead.
GetMasternodePayment is never called during IBD, thus we don't need historical values. Make it return fixed 3 PIV amount.
d565a73 to
e4fdba3
Compare
e4fdba3 to
2b31bf4
Compare
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2b31bf4
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2b31bf4

This completes the work started in #1338 and bumps the version to
4.0.99.2.It gives a dramatic improvement in memory usage.
On mainnet synced up to block 2281117, it takes ~926 Mb in total (a 59% reduction over the 2.261 Gb of
v4.0.99.1, and 64% overall reduction over the 2.570 Gb ofv4.0.2).Changes:
mapZerocoinSupplyandmoneySupplyare removed from the block index serialization and replaced with a single cached map/value updated inConnectBlock/DisconnectBlockand databased independently.To avoid reindex on upgrade, a utility class
CLegacyBlockIndexis introduced, in order to marshall old (removed) block index members directly from disk.