Skip to content

Commit

Permalink
Switch Soroban nonces from autoincrement to random values with signat…
Browse files Browse the repository at this point in the history
…ure expiration. (#103)
  • Loading branch information
dmkozh authored Jun 13, 2023
1 parent 0f5e556 commit 1c32b6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Stellar-contract.x
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ typedef string SCString<>;
typedef string SCSymbol<SCSYMBOL_LIMIT>;

struct SCNonceKey {
SCAddress nonce_address;
int64 nonce;
};

union SCVal switch (SCValType type)
Expand Down
4 changes: 2 additions & 2 deletions Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ enum ContractDataFlags {
};

struct ContractDataEntry {
Hash contractID;
SCAddress contract;
SCVal key;
ContractDataType type;

Expand Down Expand Up @@ -635,7 +635,7 @@ case LIQUIDITY_POOL:
case CONTRACT_DATA:
struct
{
Hash contractID;
SCAddress contract;
SCVal key;
ContractDataType type;
ContractLedgerEntryType leType;
Expand Down
6 changes: 4 additions & 2 deletions Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ struct SorobanAuthorizedInvocation
struct SorobanAddressCredentials
{
SCAddress address;
uint64 nonce;
int64 nonce;
uint32 signatureExpirationLedger;
SCVec signatureArgs;
};

Expand Down Expand Up @@ -670,7 +671,8 @@ case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION:
struct
{
Hash networkID;
uint64 nonce;
int64 nonce;
uint32 signatureExpirationLedger;
SorobanAuthorizedInvocation invocation;
} sorobanAuthorization;
};
Expand Down

0 comments on commit 1c32b6b

Please sign in to comment.