-
Notifications
You must be signed in to change notification settings - Fork 968
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
Bucketlist size meta #3807
Bucketlist size meta #3807
Conversation
7e78790
to
f9ed0f4
Compare
src/bucket/BucketManager.h
Outdated
#endif | ||
|
||
// If currLedger is a ledger when we should snapshot, add a new snapshot to | ||
// the sliding window and write it to disk |
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.
nit: Please add '.' in the end of comments
b38015a
to
b09481f
Compare
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.
Looks good overall, just a couple minor things and maybe a followup
// update the window. If newSize < currSize, pop entries off window. If | ||
// newSize > currSize, add as many copies of the current BucketList size to | ||
// window until it has newSize entries. | ||
void maybeUpdateBucketListWindowSize(AbstractLedgerTxn& ltx, |
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.
I think this should be a static/free function and not fields should be mutable. Instead, this would just update the ledger entry and then we will automatically update the fields as a part of SorobanNetworkConfig::loadFromLedger
(it happens after any update).
I think it's not necessary to do the change in this PR though - probably just open an issue to do cleanup?
b09481f
to
9219a44
Compare
r+ 9219a44 |
Description
Resolves #3783
This PR emits
totalByteSizeOfBucketList
in ledger close meta so that downstream systems can properly calculate Soroban storage related fees. This value is the 30 day average of the size of the BucketList calculated via daily snapshots. These snapshots are stored on disk in a sliding window viaCONFIG_ENTRY
.Checklist
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)