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

XDR for upgradeable config entries #75

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
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
15 changes: 4 additions & 11 deletions Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -518,20 +518,13 @@ case CONFIG_SETTING_TYPE_UINT32:

sisuresh marked this conversation as resolved.
Show resolved Hide resolved
enum ConfigSettingID
{
CONFIG_SETTING_CONTRACT_MAX_SIZE = 0
CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0
};

struct ConfigSettingEntry
union ConfigSettingEntry switch (ConfigSettingID configSettingID)
{
union switch (int v)
{
case 0:
void;
}
ext;

ConfigSettingID configSettingID;
ConfigSetting setting;
case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES:
uint32 contractMaxSizeBytes;
};

struct LedgerEntryExtensionV1
Expand Down
15 changes: 10 additions & 5 deletions Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ enum LedgerUpgradeType
LEDGER_UPGRADE_CONFIG = 6
};

struct ConfigUpgradeSetKey {
Hash contractID;
Hash contentHash;
};

sisuresh marked this conversation as resolved.
Show resolved Hide resolved
union LedgerUpgrade switch (LedgerUpgradeType type)
{
case LEDGER_UPGRADE_VERSION:
Expand All @@ -143,11 +148,11 @@ case LEDGER_UPGRADE_BASE_RESERVE:
case LEDGER_UPGRADE_FLAGS:
uint32 newFlags; // update flags
case LEDGER_UPGRADE_CONFIG:
struct
{
ConfigSettingID id; // id to update
ConfigSetting setting; // new value
} configSetting;
ConfigUpgradeSetKey newConfig;
};

struct ConfigUpgradeSet {
ConfigSettingEntry updatedEntry<>;
};

/* Entries used to define the bucket list */
Expand Down