Skip to content

Commit

Permalink
add config setting for host logic version (stellar#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon authored and SirTyson committed Apr 24, 2023
1 parent c9c50a4 commit 0226743
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
17 changes: 16 additions & 1 deletion Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -492,17 +492,29 @@ struct LiquidityPoolEntry
body;
};

enum ContractDataType
{
RECOVERABLE = 0
};

struct ContractDataEntry {
Hash contractID;
SCVal key;
SCVal val;
union switch (ContractDataType t)
{
case RECOVERABLE:
int64 rentBalance;
}
meta;
};

struct ContractCodeEntry {
ExtensionPoint ext;

Hash hash;
opaque code<SCVAL_LIMIT>;
int64 rentBalance;
};

// Identifiers of all the network settings.
Expand All @@ -513,7 +525,8 @@ enum ConfigSettingID
CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2,
CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3,
CONFIG_SETTING_CONTRACT_META_DATA_V0 = 4,
CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5
CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5,
CONFIG_SETTING_CONTRACT_HOST_LOGIC_VERSION = 6
};

// "Compute" settings for contracts (instructions and memory).
Expand Down Expand Up @@ -611,6 +624,8 @@ case CONFIG_SETTING_CONTRACT_META_DATA_V0:
ConfigSettingContractMetaDataV0 contractMetaData;
case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0:
ConfigSettingContractBandwidthV0 contractBandwidth;
case CONFIG_SETTING_CONTRACT_HOST_LOGIC_VERSION:
uint32 contractHostLogicVersion;
};

struct LedgerEntryExtensionV1
Expand Down
14 changes: 13 additions & 1 deletion Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ struct LedgerHeaderExtensionV1
{
case 0:
void;
case 1:
int64 outstandingRentForCurr<>; // Sum of outstanding rent charges for curr Bucket
int64 outstandingRentForCurr<>; // Sum of outstanding rent charges for snap Bucket
}
ext;
};
Expand Down Expand Up @@ -163,13 +166,20 @@ enum BucketEntryType
LIVEENTRY = 0, // Before protocol 11: created-or-updated;
// At-and-after protocol 11: only updated.
DEADENTRY = 1,
INITENTRY = 2 // At-and-after protocol 11: only created.
INITENTRY = 2, // At-and-after protocol 11: only created.
RENTENTRY = 3
};

struct BucketMetadata
{
// Indicates the protocol version used to create / merge this bucket.
uint32 ledgerVersion;
};

struct RentEntry
{
LedgerKey key;
int64 rentBump;

// reserved for future use
union switch (int v)
Expand All @@ -190,6 +200,8 @@ case DEADENTRY:
LedgerKey deadEntry;
case METAENTRY:
BucketMetadata metaEntry;
case RENTENTRY:
RentEntry rentEntry;
};

enum TxSetComponentType
Expand Down

0 comments on commit 0226743

Please sign in to comment.