-
Notifications
You must be signed in to change notification settings - Fork 36.2k
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
Report LevelDB estimate for chainstate size in gettxoutsetinfo #10396
Conversation
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.
utACK
Why remove bytes_serialized? |
It has no real meaning. It wasn't an accurate representation of how much space on disk was used, and its definition is very hard to maintain after #10195. |
Nice idea to add the leveldb size estimate - I had no idea such a thing existed. I'm not that happy that It provided a fairly neutral way of measuring the UTXO set size (It is not dependent on a specific database implementation and its overhead), I understand leveldb's estimate is better in estimating the actual disk usage, but
Isn't it a necessary by-product of computing |
The problem is mostly that after #10195, we start relying heavily on LevelDB's prefix compression (whenever two subsequent keys share a prefix, that repeated part is not encoded). This is needed because multiple outputs from the same txid otherwise will require an extra 32 bytes on disk for every output after the first. It is possible to implement a compatibility layer, which processes the outputs in pertxout, re-assembles them into per-tx things, and uses that to compute bytes_serialized and hash_serialized (that's what #10195 currently does, however, it cannot remain exactly the same as now, as the txversion information is dropped from the db). It would be much simpler if no such compatibility hack was needed, and bytes_serialized is either dropped entirely (this PR), or replaced with something that has hardly any relation with the disk size anymore. Especially if we ever want to be able to have gettxoutsetinfo not iterate through the whole set anymore... |
Updated to no longer remove |
Compiling this brings a lot of new warnings:
|
@paveljanik Those warnings seem unrelated. #10195 adds the necessary overrides as most of the relevant function signatures and changed there anyway, but I don't think that should happen in this PR. |
The problem is that if you use utACK otherwise |
Rebased, and removed the |
src/coins.h
Outdated
@@ -342,6 +345,7 @@ class CCoinsViewBacked : public CCoinsView | |||
void SetBackend(CCoinsView &viewIn); | |||
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); | |||
CCoinsViewCursor *Cursor() const; | |||
size_t EstimateSize() const override; |
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.
Seems you forgot one, I still get warnings for override
in this class
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.
Fixed.
Closing because merged as part of #10195. |
No description provided.