Skip to content

Commit

Permalink
Generalize configuration-related XDR.
Browse files Browse the repository at this point in the history
The changes here are summarized in proposed updated to CAP-47 (stellar/stellar-protocol#1291).

- Use unique keys to identify settings
- Only distribute a hash for config upgrades in `StellarValue`
- Add SCP messages for exchanging config upgrade sets
  • Loading branch information
dmkozh committed Nov 18, 2022
1 parent 1a76201 commit f42cd76
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
15 changes: 4 additions & 11 deletions Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -520,20 +520,13 @@ case CONFIG_SETTING_TYPE_UINT32:

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
10 changes: 5 additions & 5 deletions Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,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;
Hash configUpgradeSetHash;
};

struct ConfigUpgradeSet {
ConfigSettingEntry updatedEntry<>;
};

/* Entries used to define the bucket list */
Expand Down
13 changes: 11 additions & 2 deletions Stellar-overlay.x
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct PeerAddress
uint32 numFailures;
};

// Next ID: 18
// Next ID: 20
enum MessageType
{
ERROR_MSG = 0,
Expand Down Expand Up @@ -113,7 +113,11 @@ enum MessageType

SEND_MORE = 16,
FLOOD_ADVERT = 18,
FLOOD_DEMAND = 19
FLOOD_DEMAND = 19,

// Configuration upgrades
GET_CONFIG_UPGRADE_SET = 20,
CONFIG_UPGRADE_SET = 21
};

struct DontHave
Expand Down Expand Up @@ -243,6 +247,11 @@ case SURVEY_REQUEST:
case SURVEY_RESPONSE:
SignedSurveyResponseMessage signedSurveyResponseMessage;

case GET_CONFIG_UPGRADE_SET:
uint256 configUgradeSetHash;
case CONFIG_UPGRADE_SET:
ConfigUpgradeSet configUpgradeSet;

// SCP
case GET_SCP_QUORUMSET:
uint256 qSetHash;
Expand Down

0 comments on commit f42cd76

Please sign in to comment.