Skip to content
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

Adds expiration iterator #104

Merged
merged 3 commits into from
Jun 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion Stellar-contract-config-setting.x
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,25 @@ struct StateExpirationSettings {
int64 restorableRentRateDenominator;
int64 tempRentRateDenominator;

// max number of entries that emit expiration meta in a single ledger
uint32 maxEntriesToExpire;
Copy link
Contributor

@jayz22 jayz22 Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if number of expiring entries exceeds this? They still all expire but some of them don't emit meta?
Never mind, your PR description is pretty clear, sorry about that.


// maximum bytes to scan the BucketList for expired entries in a single ledger, in megabytes
uint32 maxBytesToScan;

union switch (int v)
dmkozh marked this conversation as resolved.
Show resolved Hide resolved
{
case 0:
void;
} ext;
};

// Points to BucketEntry in BucketList where expiration scan last stopped
struct ExpirationIterator {
uint32 bucketListLevel;
bool isCurrBucket;
uint64 bucketFileOffset;

union switch (int v)
{
case 0:
Expand All @@ -179,7 +198,8 @@ enum ConfigSettingID
CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8,
CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9,
CONFIG_SETTING_STATE_EXPIRATION = 10,
CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11
CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11,
CONFIG_SETTING_EXPIRATION_ITERATOR = 12
};

union ConfigSettingEntry switch (ConfigSettingID configSettingID)
Expand Down Expand Up @@ -208,5 +228,7 @@ case CONFIG_SETTING_STATE_EXPIRATION:
StateExpirationSettings stateExpirationSettings;
case CONFIG_SETTING_CONTRACT_EXECUTION_LANES:
ConfigSettingContractExecutionLanesV0 contractExecutionLanes;
case CONFIG_SETTING_EXPIRATION_ITERATOR:
ExpirationIterator expirationIterator;
};
}