Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 8 additions & 2 deletions Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ enum LedgerUpgradeType
LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3,
LEDGER_UPGRADE_BASE_RESERVE = 4,
LEDGER_UPGRADE_FLAGS = 5,
LEDGER_UPGRADE_CONFIG = 6
LEDGER_UPGRADE_CONFIG = 6,
LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7
};

struct ConfigUpgradeSetKey {
Expand All @@ -148,7 +149,12 @@ case LEDGER_UPGRADE_BASE_RESERVE:
case LEDGER_UPGRADE_FLAGS:
uint32 newFlags; // update flags
case LEDGER_UPGRADE_CONFIG:
// Update arbitray `ConfigSetting` entries identified by the key.
ConfigUpgradeSetKey newConfig;
case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE:
// Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without
// using `LEDGER_UPGRADE_CONFIG`.
uint32 newMaxSorobanTxSetSize;
};

struct ConfigUpgradeSet {
Expand Down Expand Up @@ -385,7 +391,7 @@ struct ContractEvent
case 0:
struct
{
SCVec topics;
SCVal topics<>;
SCVal data;
} v0;
}
Expand Down
19 changes: 9 additions & 10 deletions Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,16 @@ struct CreateContractArgs
ContractExecutable executable;
};

struct InvokeContractArgs {
SCAddress contractAddress;
Copy link

@2opremio 2opremio Jul 18, 2023

Choose a reason for hiding this comment

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

Shouldn't this just be a hash? In which cases can this be an account address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for consistency and extensibility. All the contract interactions use address now, so it would be weird to omit it in one place. This also allows us to add functionality to classic accounts if we ever want that (for example, imagine some subscription interface).

SCSymbol functionName;
SCVal args<>;
};

union HostFunction switch (HostFunctionType type)
{
case HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
SCVec invokeContract;
InvokeContractArgs invokeContract;
case HOST_FUNCTION_TYPE_CREATE_CONTRACT:
CreateContractArgs createContract;
case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM:
Expand All @@ -519,17 +525,10 @@ enum SorobanAuthorizedFunctionType
SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1
};

struct SorobanAuthorizedContractFunction
{
SCAddress contractAddress;
SCSymbol functionName;
SCVec args;
};

union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type)
{
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
SorobanAuthorizedContractFunction contractFn;
InvokeContractArgs contractFn;
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
CreateContractArgs createContractHostFn;
};
Expand All @@ -545,7 +544,7 @@ struct SorobanAddressCredentials
SCAddress address;
int64 nonce;
uint32 signatureExpirationLedger;
SCVec signatureArgs;
SCVal signature;
};

enum SorobanCredentialsType
Expand Down