diff --git a/Makefile b/Makefile index 85313fdd..213be4ec 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/529d5176f24c73eeccfa5eba481d4e89c19b1181 +XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/4b7a2ef7931ab2ca2499be68d849f38190b443ca XDR_BASE_LOCAL_CURR=xdr/curr XDR_FILES_CURR= \ Stellar-SCP.x \ @@ -11,10 +11,11 @@ XDR_FILES_CURR= \ Stellar-contract-env-meta.x \ Stellar-contract-meta.x \ Stellar-contract-spec.x \ - Stellar-contract-config-setting.x + Stellar-contract-config-setting.x \ + Stellar-exporter.x XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR)) -XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/8c88608d0a20b01873056a5ec13be245e1f2aa27 +XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/4b7a2ef7931ab2ca2499be68d849f38190b443ca XDR_BASE_LOCAL_NEXT=xdr/next XDR_FILES_NEXT= \ Stellar-SCP.x \ @@ -27,7 +28,8 @@ XDR_FILES_NEXT= \ Stellar-contract-env-meta.x \ Stellar-contract-meta.x \ Stellar-contract-spec.x \ - Stellar-contract-config-setting.x + Stellar-contract-config-setting.x \ + Stellar-exporter.x XDR_FILES_LOCAL_NEXT=$(addprefix xdr/next/,$(XDR_FILES_NEXT)) XDRGEN_COMMIT=master diff --git a/README.md b/README.md index 50220433..6ca2e1d2 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,22 @@ earlier versions of Node, so the tests need to run on those versions.) #### Updating XDR definitions +XDR updates are complicated due to the fact that you need workarounds for bugs +in the generator, formatter, or a namespace adjustment. + 1. Make sure you have [Docker](https://www.docker.com/) installed and running. -2. `make reset-xdr` +2. Change the commit hash to the right version of [stellar-xdr](https://github.com/stellar/stellar-xdr) and add any filenames that might've been introduced. +3. Run `make reset-xdr` +4. Run `sed -ie s/\"/\'/g types/{curr,next}.d.ts` to minimize the diff (the generator's formatter uses `"` but the repo uses `'`). +5. Move `xdr.Operation` into a hidden namespace to avoid conflicts with the SDK's `Operation`. +6. Add generator workarounds: + * `type Hash = Opaque[]` is a necessary alias that doesn't get generated + * `Hyper`, `UnsignedHyper`, and `ScSpecEventV0` need their signatures + fixed because linting wants an `Array` instead of a naked `[]`. + * Some constants aren't generated correctly (e.g, Ctrl+F `SCSYMBOL_LIMIT` in `src/curr_generated.js`) +7. Finally, make code adjustments related to the XDR (these are usually revealed by running the tests). + +As an example PR to follow, [stellar-base#800](https://github.com/stellar/js-stellar-base/pull/800) has detailed steps for each part of the process. ## Usage diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index db4b4f40..977a3c5d 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -1,4 +1,4 @@ -// Automatically generated by xdrgen on 2024-09-12T11:09:00-08:00 +// Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten /* jshint maxstatements:2147483647 */ @@ -293,13 +293,6 @@ xdr.typedef("SequenceNumber", xdr.lookup("Int64")); // =========================================================================== xdr.typedef("DataValue", xdr.varOpaque(64)); -// === xdr source ============================================================ -// -// typedef Hash PoolID; -// -// =========================================================================== -xdr.typedef("PoolId", xdr.lookup("Hash")); - // === xdr source ============================================================ // // typedef opaque AssetCode4[4]; @@ -1237,38 +1230,6 @@ xdr.union("Claimant", { }, }); -// === xdr source ============================================================ -// -// enum ClaimableBalanceIDType -// { -// CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 -// }; -// -// =========================================================================== -xdr.enum("ClaimableBalanceIdType", { - claimableBalanceIdTypeV0: 0, -}); - -// === xdr source ============================================================ -// -// union ClaimableBalanceID switch (ClaimableBalanceIDType type) -// { -// case CLAIMABLE_BALANCE_ID_TYPE_V0: -// Hash v0; -// }; -// -// =========================================================================== -xdr.union("ClaimableBalanceId", { - switchOn: xdr.lookup("ClaimableBalanceIdType"), - switchName: "type", - switches: [ - ["claimableBalanceIdTypeV0", "v0"], - ], - arms: { - v0: xdr.lookup("Hash"), - }, -}); - // === xdr source ============================================================ // // enum ClaimableBalanceFlags @@ -2059,15 +2020,13 @@ xdr.enum("EnvelopeType", { // enum BucketListType // { // LIVE = 0, -// HOT_ARCHIVE = 1, -// COLD_ARCHIVE = 2 +// HOT_ARCHIVE = 1 // }; // // =========================================================================== xdr.enum("BucketListType", { live: 0, hotArchive: 1, - coldArchive: 2, }); // === xdr source ============================================================ @@ -2096,10 +2055,9 @@ xdr.enum("BucketEntryType", { // { // HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. // HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived -// HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but +// HOT_ARCHIVE_LIVE = 1 // Entry was previously HOT_ARCHIVE_ARCHIVED, but // // has been added back to the live BucketList. // // Does not need to be persisted. -// HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) // }; // // =========================================================================== @@ -2107,27 +2065,6 @@ xdr.enum("HotArchiveBucketEntryType", { hotArchiveMetaentry: -1, hotArchiveArchived: 0, hotArchiveLive: 1, - hotArchiveDeleted: 2, -}); - -// === xdr source ============================================================ -// -// enum ColdArchiveBucketEntryType -// { -// COLD_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. -// COLD_ARCHIVE_ARCHIVED_LEAF = 0, // Full LedgerEntry that was archived during the epoch -// COLD_ARCHIVE_DELETED_LEAF = 1, // LedgerKey that was deleted during the epoch -// COLD_ARCHIVE_BOUNDARY_LEAF = 2, // Dummy leaf representing low/high bound -// COLD_ARCHIVE_HASH = 3 // Intermediary Merkle hash entry -// }; -// -// =========================================================================== -xdr.enum("ColdArchiveBucketEntryType", { - coldArchiveMetaentry: -1, - coldArchiveArchivedLeaf: 0, - coldArchiveDeletedLeaf: 1, - coldArchiveBoundaryLeaf: 2, - coldArchiveHash: 3, }); // === xdr source ============================================================ @@ -2216,7 +2153,6 @@ xdr.union("BucketEntry", { // LedgerEntry archivedEntry; // // case HOT_ARCHIVE_LIVE: -// case HOT_ARCHIVE_DELETED: // LedgerKey key; // case HOT_ARCHIVE_METAENTRY: // BucketMetadata metaEntry; @@ -2229,7 +2165,6 @@ xdr.union("HotArchiveBucketEntry", { switches: [ ["hotArchiveArchived", "archivedEntry"], ["hotArchiveLive", "key"], - ["hotArchiveDeleted", "key"], ["hotArchiveMetaentry", "metaEntry"], ], arms: { @@ -2239,100 +2174,6 @@ xdr.union("HotArchiveBucketEntry", { }, }); -// === xdr source ============================================================ -// -// struct ColdArchiveArchivedLeaf -// { -// uint32 index; -// LedgerEntry archivedEntry; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveArchivedLeaf", [ - ["index", xdr.lookup("Uint32")], - ["archivedEntry", xdr.lookup("LedgerEntry")], -]); - -// === xdr source ============================================================ -// -// struct ColdArchiveDeletedLeaf -// { -// uint32 index; -// LedgerKey deletedKey; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveDeletedLeaf", [ - ["index", xdr.lookup("Uint32")], - ["deletedKey", xdr.lookup("LedgerKey")], -]); - -// === xdr source ============================================================ -// -// struct ColdArchiveBoundaryLeaf -// { -// uint32 index; -// bool isLowerBound; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveBoundaryLeaf", [ - ["index", xdr.lookup("Uint32")], - ["isLowerBound", xdr.bool()], -]); - -// === xdr source ============================================================ -// -// struct ColdArchiveHashEntry -// { -// uint32 index; -// uint32 level; -// Hash hash; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveHashEntry", [ - ["index", xdr.lookup("Uint32")], - ["level", xdr.lookup("Uint32")], - ["hash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// union ColdArchiveBucketEntry switch (ColdArchiveBucketEntryType type) -// { -// case COLD_ARCHIVE_METAENTRY: -// BucketMetadata metaEntry; -// case COLD_ARCHIVE_ARCHIVED_LEAF: -// ColdArchiveArchivedLeaf archivedLeaf; -// case COLD_ARCHIVE_DELETED_LEAF: -// ColdArchiveDeletedLeaf deletedLeaf; -// case COLD_ARCHIVE_BOUNDARY_LEAF: -// ColdArchiveBoundaryLeaf boundaryLeaf; -// case COLD_ARCHIVE_HASH: -// ColdArchiveHashEntry hashEntry; -// }; -// -// =========================================================================== -xdr.union("ColdArchiveBucketEntry", { - switchOn: xdr.lookup("ColdArchiveBucketEntryType"), - switchName: "type", - switches: [ - ["coldArchiveMetaentry", "metaEntry"], - ["coldArchiveArchivedLeaf", "archivedLeaf"], - ["coldArchiveDeletedLeaf", "deletedLeaf"], - ["coldArchiveBoundaryLeaf", "boundaryLeaf"], - ["coldArchiveHash", "hashEntry"], - ], - arms: { - metaEntry: xdr.lookup("BucketMetadata"), - archivedLeaf: xdr.lookup("ColdArchiveArchivedLeaf"), - deletedLeaf: xdr.lookup("ColdArchiveDeletedLeaf"), - boundaryLeaf: xdr.lookup("ColdArchiveBoundaryLeaf"), - hashEntry: xdr.lookup("ColdArchiveHashEntry"), - }, -}); - // === xdr source ============================================================ // // typedef opaque UpgradeType<128>; @@ -2597,13 +2438,13 @@ xdr.enum("LedgerUpgradeType", { // === xdr source ============================================================ // // struct ConfigUpgradeSetKey { -// Hash contractID; +// ContractID contractID; // Hash contentHash; // }; // // =========================================================================== xdr.struct("ConfigUpgradeSetKey", [ - ["contractId", xdr.lookup("Hash")], + ["contractId", xdr.lookup("ContractId")], ["contentHash", xdr.lookup("Hash")], ]); @@ -2679,6 +2520,37 @@ xdr.enum("TxSetComponentType", { txsetCompTxsMaybeDiscountedFee: 0, }); +// === xdr source ============================================================ +// +// typedef TransactionEnvelope DependentTxCluster<>; +// +// =========================================================================== +xdr.typedef("DependentTxCluster", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)); + +// === xdr source ============================================================ +// +// typedef DependentTxCluster ParallelTxExecutionStage<>; +// +// =========================================================================== +xdr.typedef("ParallelTxExecutionStage", xdr.varArray(xdr.lookup("DependentTxCluster"), 2147483647)); + +// === xdr source ============================================================ +// +// struct ParallelTxsComponent +// { +// int64* baseFee; +// // A sequence of stages that *may* have arbitrary data dependencies between +// // each other, i.e. in a general case the stage execution order may not be +// // arbitrarily shuffled without affecting the end result. +// ParallelTxExecutionStage executionStages<>; +// }; +// +// =========================================================================== +xdr.struct("ParallelTxsComponent", [ + ["baseFee", xdr.option(xdr.lookup("Int64"))], + ["executionStages", xdr.varArray(xdr.lookup("ParallelTxExecutionStage"), 2147483647)], +]); + // === xdr source ============================================================ // // struct @@ -2723,6 +2595,8 @@ xdr.union("TxSetComponent", { // { // case 0: // TxSetComponent v0Components<>; +// case 1: +// ParallelTxsComponent parallelTxsComponent; // }; // // =========================================================================== @@ -2731,9 +2605,11 @@ xdr.union("TransactionPhase", { switchName: "v", switches: [ [0, "v0Components"], + [1, "parallelTxsComponent"], ], arms: { v0Components: xdr.varArray(xdr.lookup("TxSetComponent"), 2147483647), + parallelTxsComponent: xdr.lookup("ParallelTxsComponent"), }, }); @@ -2999,7 +2875,8 @@ xdr.union("ScpHistoryEntry", { // LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger // LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger // LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger -// LEDGER_ENTRY_STATE = 3 // value of the entry +// LEDGER_ENTRY_STATE = 3, // value of the entry +// LEDGER_ENTRY_RESTORED = 4 // archived entry was restored in the ledger // }; // // =========================================================================== @@ -3008,6 +2885,7 @@ xdr.enum("LedgerEntryChangeType", { ledgerEntryUpdated: 1, ledgerEntryRemoved: 2, ledgerEntryState: 3, + ledgerEntryRestored: 4, }); // === xdr source ============================================================ @@ -3022,6 +2900,8 @@ xdr.enum("LedgerEntryChangeType", { // LedgerKey removed; // case LEDGER_ENTRY_STATE: // LedgerEntry state; +// case LEDGER_ENTRY_RESTORED: +// LedgerEntry restored; // }; // // =========================================================================== @@ -3033,12 +2913,14 @@ xdr.union("LedgerEntryChange", { ["ledgerEntryUpdated", "updated"], ["ledgerEntryRemoved", "removed"], ["ledgerEntryState", "state"], + ["ledgerEntryRestored", "restored"], ], arms: { created: xdr.lookup("LedgerEntry"), updated: xdr.lookup("LedgerEntry"), removed: xdr.lookup("LedgerKey"), state: xdr.lookup("LedgerEntry"), + restored: xdr.lookup("LedgerEntry"), }, }); @@ -3155,7 +3037,7 @@ xdr.union("ContractEventBody", { // // is first, to change ContractEvent into a union. // ExtensionPoint ext; // -// Hash* contractID; +// ContractID* contractID; // ContractEventType type; // // union switch (int v) @@ -3173,7 +3055,7 @@ xdr.union("ContractEventBody", { // =========================================================================== xdr.struct("ContractEvent", [ ["ext", xdr.lookup("ExtensionPoint")], - ["contractId", xdr.option(xdr.lookup("Hash"))], + ["contractId", xdr.option(xdr.lookup("ContractId"))], ["type", xdr.lookup("ContractEventType")], ["body", xdr.lookup("ContractEventBody")], ]); @@ -3192,13 +3074,6 @@ xdr.struct("DiagnosticEvent", [ ["event", xdr.lookup("ContractEvent")], ]); -// === xdr source ============================================================ -// -// typedef DiagnosticEvent DiagnosticEvents<>; -// -// =========================================================================== -xdr.typedef("DiagnosticEvents", xdr.varArray(xdr.lookup("DiagnosticEvent"), 2147483647)); - // === xdr source ============================================================ // // struct SorobanTransactionMetaExtV1 @@ -3314,6 +3189,102 @@ xdr.struct("TransactionMetaV3", [ ["sorobanMeta", xdr.option(xdr.lookup("SorobanTransactionMeta"))], ]); +// === xdr source ============================================================ +// +// struct OperationMetaV2 +// { +// ExtensionPoint ext; +// +// LedgerEntryChanges changes; +// +// ContractEvent events<>; +// }; +// +// =========================================================================== +xdr.struct("OperationMetaV2", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["changes", xdr.lookup("LedgerEntryChanges")], + ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], +]); + +// === xdr source ============================================================ +// +// struct SorobanTransactionMetaV2 +// { +// SorobanTransactionMetaExt ext; +// +// SCVal* returnValue; +// }; +// +// =========================================================================== +xdr.struct("SorobanTransactionMetaV2", [ + ["ext", xdr.lookup("SorobanTransactionMetaExt")], + ["returnValue", xdr.option(xdr.lookup("ScVal"))], +]); + +// === xdr source ============================================================ +// +// enum TransactionEventStage { +// // The event has happened before any one of the transactions has its +// // operations applied. +// TRANSACTION_EVENT_STAGE_BEFORE_ALL_TXS = 0, +// // The event has happened immediately after operations of the transaction +// // have been applied. +// TRANSACTION_EVENT_STAGE_AFTER_TX = 1, +// // The event has happened after every transaction had its operations +// // applied. +// TRANSACTION_EVENT_STAGE_AFTER_ALL_TXS = 2 +// }; +// +// =========================================================================== +xdr.enum("TransactionEventStage", { + transactionEventStageBeforeAllTxes: 0, + transactionEventStageAfterTx: 1, + transactionEventStageAfterAllTxes: 2, +}); + +// === xdr source ============================================================ +// +// struct TransactionEvent { +// TransactionEventStage stage; // Stage at which an event has occurred. +// ContractEvent event; // The contract event that has occurred. +// }; +// +// =========================================================================== +xdr.struct("TransactionEvent", [ + ["stage", xdr.lookup("TransactionEventStage")], + ["event", xdr.lookup("ContractEvent")], +]); + +// === xdr source ============================================================ +// +// struct TransactionMetaV4 +// { +// ExtensionPoint ext; +// +// LedgerEntryChanges txChangesBefore; // tx level changes before operations +// // are applied if any +// OperationMetaV2 operations<>; // meta for each operation +// LedgerEntryChanges txChangesAfter; // tx level changes after operations are +// // applied if any +// SorobanTransactionMetaV2* sorobanMeta; // Soroban-specific meta (only for +// // Soroban transactions). +// +// TransactionEvent events<>; // Used for transaction-level events (like fee payment) +// DiagnosticEvent diagnosticEvents<>; // Used for all diagnostic information +// }; +// +// =========================================================================== +xdr.struct("TransactionMetaV4", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMetaV2"), 2147483647)], + ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], + ["sorobanMeta", xdr.option(xdr.lookup("SorobanTransactionMetaV2"))], + ["events", xdr.varArray(xdr.lookup("TransactionEvent"), 2147483647)], + ["diagnosticEvents", xdr.varArray(xdr.lookup("DiagnosticEvent"), 2147483647)], +]); + // === xdr source ============================================================ // // struct InvokeHostFunctionSuccessPreImage @@ -3340,6 +3311,8 @@ xdr.struct("InvokeHostFunctionSuccessPreImage", [ // TransactionMetaV2 v2; // case 3: // TransactionMetaV3 v3; +// case 4: +// TransactionMetaV4 v4; // }; // // =========================================================================== @@ -3351,12 +3324,14 @@ xdr.union("TransactionMeta", { [1, "v1"], [2, "v2"], [3, "v3"], + [4, "v4"], ], arms: { operations: xdr.varArray(xdr.lookup("OperationMeta"), 2147483647), v1: xdr.lookup("TransactionMetaV1"), v2: xdr.lookup("TransactionMetaV2"), v3: xdr.lookup("TransactionMetaV3"), + v4: xdr.lookup("TransactionMetaV4"), }, }); @@ -3376,6 +3351,28 @@ xdr.struct("TransactionResultMeta", [ ["txApplyProcessing", xdr.lookup("TransactionMeta")], ]); +// === xdr source ============================================================ +// +// struct TransactionResultMetaV1 +// { +// ExtensionPoint ext; +// +// TransactionResultPair result; +// LedgerEntryChanges feeProcessing; +// TransactionMeta txApplyProcessing; +// +// LedgerEntryChanges postTxApplyFeeProcessing; +// }; +// +// =========================================================================== +xdr.struct("TransactionResultMetaV1", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["result", xdr.lookup("TransactionResultPair")], + ["feeProcessing", xdr.lookup("LedgerEntryChanges")], + ["txApplyProcessing", xdr.lookup("TransactionMeta")], + ["postTxApplyFeeProcessing", xdr.lookup("LedgerEntryChanges")], +]); + // === xdr source ============================================================ // // struct UpgradeEntryMeta @@ -3477,16 +3474,15 @@ xdr.union("LedgerCloseMetaExt", { // // other misc information attached to the ledger close // SCPHistoryEntry scpInfo<>; // -// // Size in bytes of BucketList, to support downstream +// // Size in bytes of live Soroban state, to support downstream // // systems calculating storage fees correctly. -// uint64 totalByteSizeOfBucketList; +// uint64 totalByteSizeOfLiveSorobanState; // -// // Temp keys that are being evicted at this ledger. -// LedgerKey evictedTemporaryLedgerKeys<>; +// // TTL and data/code keys that have been evicted at this ledger. +// LedgerKey evictedKeys<>; // -// // Archived restorable ledger entries that are being -// // evicted at this ledger. -// LedgerEntry evictedPersistentLedgerEntries<>; +// // Maintained for backwards compatibility, should never be populated. +// LedgerEntry unused<>; // }; // // =========================================================================== @@ -3497,9 +3493,50 @@ xdr.struct("LedgerCloseMetaV1", [ ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647)], ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], - ["totalByteSizeOfBucketList", xdr.lookup("Uint64")], - ["evictedTemporaryLedgerKeys", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], - ["evictedPersistentLedgerEntries", xdr.varArray(xdr.lookup("LedgerEntry"), 2147483647)], + ["totalByteSizeOfLiveSorobanState", xdr.lookup("Uint64")], + ["evictedKeys", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], + ["unused", xdr.varArray(xdr.lookup("LedgerEntry"), 2147483647)], +]); + +// === xdr source ============================================================ +// +// struct LedgerCloseMetaV2 +// { +// LedgerCloseMetaExt ext; +// +// LedgerHeaderHistoryEntry ledgerHeader; +// +// GeneralizedTransactionSet txSet; +// +// // NB: transactions are sorted in apply order here +// // fees for all transactions are processed first +// // followed by applying transactions +// TransactionResultMetaV1 txProcessing<>; +// +// // upgrades are applied last +// UpgradeEntryMeta upgradesProcessing<>; +// +// // other misc information attached to the ledger close +// SCPHistoryEntry scpInfo<>; +// +// // Size in bytes of live Soroban state, to support downstream +// // systems calculating storage fees correctly. +// uint64 totalByteSizeOfLiveSorobanState; +// +// // TTL and data/code keys that have been evicted at this ledger. +// LedgerKey evictedKeys<>; +// }; +// +// =========================================================================== +xdr.struct("LedgerCloseMetaV2", [ + ["ext", xdr.lookup("LedgerCloseMetaExt")], + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("GeneralizedTransactionSet")], + ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMetaV1"), 2147483647)], + ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ["totalByteSizeOfLiveSorobanState", xdr.lookup("Uint64")], + ["evictedKeys", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], ]); // === xdr source ============================================================ @@ -3510,6 +3547,8 @@ xdr.struct("LedgerCloseMetaV1", [ // LedgerCloseMetaV0 v0; // case 1: // LedgerCloseMetaV1 v1; +// case 2: +// LedgerCloseMetaV2 v2; // }; // // =========================================================================== @@ -3519,10 +3558,12 @@ xdr.union("LedgerCloseMeta", { switches: [ [0, "v0"], [1, "v1"], + [2, "v2"], ], arms: { v0: xdr.lookup("LedgerCloseMetaV0"), v1: xdr.lookup("LedgerCloseMetaV1"), + v2: xdr.lookup("LedgerCloseMetaV2"), }, }); @@ -3717,8 +3758,8 @@ xdr.struct("PeerAddress", [ // ERROR_MSG = 0, // AUTH = 2, // DONT_HAVE = 3, +// // GET_PEERS (4) is deprecated // -// GET_PEERS = 4, // gets a list of peers this guy knows about // PEERS = 5, // // GET_TX_SET = 6, // gets a particular txset by hash @@ -3736,8 +3777,8 @@ xdr.struct("PeerAddress", [ // // new messages // HELLO = 13, // -// SURVEY_REQUEST = 14, -// SURVEY_RESPONSE = 15, +// // SURVEY_REQUEST (14) removed and replaced by TIME_SLICED_SURVEY_REQUEST +// // SURVEY_RESPONSE (15) removed and replaced by TIME_SLICED_SURVEY_RESPONSE // // SEND_MORE = 16, // SEND_MORE_EXTENDED = 20, @@ -3756,7 +3797,6 @@ xdr.enum("MessageType", { errorMsg: 0, auth: 2, dontHave: 3, - getPeers: 4, peers: 5, getTxSet: 6, txSet: 7, @@ -3767,8 +3807,6 @@ xdr.enum("MessageType", { scpMessage: 11, getScpState: 12, hello: 13, - surveyRequest: 14, - surveyResponse: 15, sendMore: 16, sendMoreExtended: 20, floodAdvert: 18, @@ -3797,13 +3835,11 @@ xdr.struct("DontHave", [ // // enum SurveyMessageCommandType // { -// SURVEY_TOPOLOGY = 0, // TIME_SLICED_SURVEY_TOPOLOGY = 1 // }; // // =========================================================================== xdr.enum("SurveyMessageCommandType", { - surveyTopology: 0, timeSlicedSurveyTopology: 1, }); @@ -3811,15 +3847,11 @@ xdr.enum("SurveyMessageCommandType", { // // enum SurveyMessageResponseType // { -// SURVEY_TOPOLOGY_RESPONSE_V0 = 0, -// SURVEY_TOPOLOGY_RESPONSE_V1 = 1, // SURVEY_TOPOLOGY_RESPONSE_V2 = 2 // }; // // =========================================================================== xdr.enum("SurveyMessageResponseType", { - surveyTopologyResponseV0: 0, - surveyTopologyResponseV1: 1, surveyTopologyResponseV2: 2, }); @@ -3921,20 +3953,6 @@ xdr.struct("TimeSlicedSurveyRequestMessage", [ ["outboundPeersIndex", xdr.lookup("Uint32")], ]); -// === xdr source ============================================================ -// -// struct SignedSurveyRequestMessage -// { -// Signature requestSignature; -// SurveyRequestMessage request; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyRequestMessage", [ - ["requestSignature", xdr.lookup("Signature")], - ["request", xdr.lookup("SurveyRequestMessage")], -]); - // === xdr source ============================================================ // // struct SignedTimeSlicedSurveyRequestMessage @@ -3990,20 +4008,6 @@ xdr.struct("TimeSlicedSurveyResponseMessage", [ ["nonce", xdr.lookup("Uint32")], ]); -// === xdr source ============================================================ -// -// struct SignedSurveyResponseMessage -// { -// Signature responseSignature; -// SurveyResponseMessage response; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyResponseMessage", [ - ["responseSignature", xdr.lookup("Signature")], - ["response", xdr.lookup("SurveyResponseMessage")], -]); - // === xdr source ============================================================ // // struct SignedTimeSlicedSurveyResponseMessage @@ -4060,13 +4064,6 @@ xdr.struct("PeerStats", [ ["duplicateFetchMessageRecv", xdr.lookup("Uint64")], ]); -// === xdr source ============================================================ -// -// typedef PeerStats PeerStatList<25>; -// -// =========================================================================== -xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); - // === xdr source ============================================================ // // struct TimeSlicedNodeData @@ -4105,68 +4102,25 @@ xdr.struct("TimeSlicedNodeData", [ // === xdr source ============================================================ // -// struct TimeSlicedPeerData -// { -// PeerStats peerStats; -// uint32 averageLatencyMs; -// }; -// -// =========================================================================== -xdr.struct("TimeSlicedPeerData", [ - ["peerStats", xdr.lookup("PeerStats")], - ["averageLatencyMs", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// typedef TimeSlicedPeerData TimeSlicedPeerDataList<25>; -// -// =========================================================================== -xdr.typedef("TimeSlicedPeerDataList", xdr.varArray(xdr.lookup("TimeSlicedPeerData"), 25)); - -// === xdr source ============================================================ -// -// struct TopologyResponseBodyV0 -// { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// }; -// -// =========================================================================== -xdr.struct("TopologyResponseBodyV0", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct TopologyResponseBodyV1 +// struct TimeSlicedPeerData // { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// -// uint32 maxInboundPeerCount; -// uint32 maxOutboundPeerCount; +// PeerStats peerStats; +// uint32 averageLatencyMs; // }; // // =========================================================================== -xdr.struct("TopologyResponseBodyV1", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], - ["maxInboundPeerCount", xdr.lookup("Uint32")], - ["maxOutboundPeerCount", xdr.lookup("Uint32")], +xdr.struct("TimeSlicedPeerData", [ + ["peerStats", xdr.lookup("PeerStats")], + ["averageLatencyMs", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// typedef TimeSlicedPeerData TimeSlicedPeerDataList<25>; +// +// =========================================================================== +xdr.typedef("TimeSlicedPeerDataList", xdr.varArray(xdr.lookup("TimeSlicedPeerData"), 25)); + // === xdr source ============================================================ // // struct TopologyResponseBodyV2 @@ -4187,10 +4141,6 @@ xdr.struct("TopologyResponseBodyV2", [ // // union SurveyResponseBody switch (SurveyMessageResponseType type) // { -// case SURVEY_TOPOLOGY_RESPONSE_V0: -// TopologyResponseBodyV0 topologyResponseBodyV0; -// case SURVEY_TOPOLOGY_RESPONSE_V1: -// TopologyResponseBodyV1 topologyResponseBodyV1; // case SURVEY_TOPOLOGY_RESPONSE_V2: // TopologyResponseBodyV2 topologyResponseBodyV2; // }; @@ -4200,13 +4150,9 @@ xdr.union("SurveyResponseBody", { switchOn: xdr.lookup("SurveyMessageResponseType"), switchName: "type", switches: [ - ["surveyTopologyResponseV0", "topologyResponseBodyV0"], - ["surveyTopologyResponseV1", "topologyResponseBodyV1"], ["surveyTopologyResponseV2", "topologyResponseBodyV2"], ], arms: { - topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), - topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), topologyResponseBodyV2: xdr.lookup("TopologyResponseBodyV2"), }, }); @@ -4275,8 +4221,6 @@ xdr.struct("FloodDemand", [ // Auth auth; // case DONT_HAVE: // DontHave dontHave; -// case GET_PEERS: -// void; // case PEERS: // PeerAddress peers<100>; // @@ -4290,12 +4234,6 @@ xdr.struct("FloodDemand", [ // case TRANSACTION: // TransactionEnvelope transaction; // -// case SURVEY_REQUEST: -// SignedSurveyRequestMessage signedSurveyRequestMessage; -// -// case SURVEY_RESPONSE: -// SignedSurveyResponseMessage signedSurveyResponseMessage; -// // case TIME_SLICED_SURVEY_REQUEST: // SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; // @@ -4339,14 +4277,11 @@ xdr.union("StellarMessage", { ["hello", "hello"], ["auth", "auth"], ["dontHave", "dontHave"], - ["getPeers", xdr.void()], ["peers", "peers"], ["getTxSet", "txSetHash"], ["txSet", "txSet"], ["generalizedTxSet", "generalizedTxSet"], ["transaction", "transaction"], - ["surveyRequest", "signedSurveyRequestMessage"], - ["surveyResponse", "signedSurveyResponseMessage"], ["timeSlicedSurveyRequest", "signedTimeSlicedSurveyRequestMessage"], ["timeSlicedSurveyResponse", "signedTimeSlicedSurveyResponseMessage"], ["timeSlicedSurveyStartCollecting", "signedTimeSlicedSurveyStartCollectingMessage"], @@ -4370,8 +4305,6 @@ xdr.union("StellarMessage", { txSet: xdr.lookup("TransactionSet"), generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), transaction: xdr.lookup("TransactionEnvelope"), - signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), - signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), signedTimeSlicedSurveyRequestMessage: xdr.lookup("SignedTimeSlicedSurveyRequestMessage"), signedTimeSlicedSurveyResponseMessage: xdr.lookup("SignedTimeSlicedSurveyResponseMessage"), signedTimeSlicedSurveyStartCollectingMessage: xdr.lookup("SignedTimeSlicedSurveyStartCollectingMessage"), @@ -5326,6 +5259,13 @@ xdr.struct("SorobanAuthorizationEntry", [ ["rootInvocation", xdr.lookup("SorobanAuthorizedInvocation")], ]); +// === xdr source ============================================================ +// +// typedef SorobanAuthorizationEntry SorobanAuthorizationEntries<>; +// +// =========================================================================== +xdr.typedef("SorobanAuthorizationEntries", xdr.varArray(xdr.lookup("SorobanAuthorizationEntry"), 2147483647)); + // === xdr source ============================================================ // // struct InvokeHostFunctionOp @@ -5874,153 +5814,76 @@ xdr.struct("LedgerFootprint", [ // === xdr source ============================================================ // -// enum ArchivalProofType -// { -// EXISTENCE = 0, -// NONEXISTENCE = 1 -// }; -// -// =========================================================================== -xdr.enum("ArchivalProofType", { - existence: 0, - nonexistence: 1, -}); - -// === xdr source ============================================================ -// -// struct ArchivalProofNode -// { -// uint32 index; -// Hash hash; -// }; -// -// =========================================================================== -xdr.struct("ArchivalProofNode", [ - ["index", xdr.lookup("Uint32")], - ["hash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// typedef ArchivalProofNode ProofLevel<>; -// -// =========================================================================== -xdr.typedef("ProofLevel", xdr.varArray(xdr.lookup("ArchivalProofNode"), 2147483647)); - -// === xdr source ============================================================ -// -// struct NonexistenceProofBody +// struct SorobanResources // { -// ColdArchiveBucketEntry entriesToProve<>; +// // The ledger footprint of the transaction. +// LedgerFootprint footprint; +// // The maximum number of instructions this transaction can use +// uint32 instructions; // -// // Vector of vectors, where proofLevels[level] -// // contains all HashNodes that correspond with that level -// ProofLevel proofLevels<>; +// // The maximum number of bytes this transaction can read from disk backed entries +// uint32 diskReadBytes; +// // The maximum number of bytes this transaction can write to ledger +// uint32 writeBytes; // }; // // =========================================================================== -xdr.struct("NonexistenceProofBody", [ - ["entriesToProve", xdr.varArray(xdr.lookup("ColdArchiveBucketEntry"), 2147483647)], - ["proofLevels", xdr.varArray(xdr.lookup("ProofLevel"), 2147483647)], +xdr.struct("SorobanResources", [ + ["footprint", xdr.lookup("LedgerFootprint")], + ["instructions", xdr.lookup("Uint32")], + ["diskReadBytes", xdr.lookup("Uint32")], + ["writeBytes", xdr.lookup("Uint32")], ]); // === xdr source ============================================================ // -// struct ExistenceProofBody +// struct SorobanResourcesExtV0 // { -// LedgerKey keysToProve<>; -// -// // Bounds for each key being proved, where bound[n] -// // corresponds to keysToProve[n] -// ColdArchiveBucketEntry lowBoundEntries<>; -// ColdArchiveBucketEntry highBoundEntries<>; -// -// // Vector of vectors, where proofLevels[level] -// // contains all HashNodes that correspond with that level -// ProofLevel proofLevels<>; +// // Vector of indices representing what Soroban +// // entries in the footprint are archived, based on the +// // order of keys provided in the readWrite footprint. +// uint32 archivedSorobanEntries<>; // }; // // =========================================================================== -xdr.struct("ExistenceProofBody", [ - ["keysToProve", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], - ["lowBoundEntries", xdr.varArray(xdr.lookup("ColdArchiveBucketEntry"), 2147483647)], - ["highBoundEntries", xdr.varArray(xdr.lookup("ColdArchiveBucketEntry"), 2147483647)], - ["proofLevels", xdr.varArray(xdr.lookup("ProofLevel"), 2147483647)], +xdr.struct("SorobanResourcesExtV0", [ + ["archivedSorobanEntries", xdr.varArray(xdr.lookup("Uint32"), 2147483647)], ]); // === xdr source ============================================================ // -// union switch (ArchivalProofType t) +// union switch (int v) // { -// case EXISTENCE: -// NonexistenceProofBody nonexistenceProof; -// case NONEXISTENCE: -// ExistenceProofBody existenceProof; +// case 0: +// void; +// case 1: +// SorobanResourcesExtV0 resourceExt; // } // // =========================================================================== -xdr.union("ArchivalProofBody", { - switchOn: xdr.lookup("ArchivalProofType"), - switchName: "t", +xdr.union("SorobanTransactionDataExt", { + switchOn: xdr.int(), + switchName: "v", switches: [ - ["existence", "nonexistenceProof"], - ["nonexistence", "existenceProof"], + [0, xdr.void()], + [1, "resourceExt"], ], arms: { - nonexistenceProof: xdr.lookup("NonexistenceProofBody"), - existenceProof: xdr.lookup("ExistenceProofBody"), + resourceExt: xdr.lookup("SorobanResourcesExtV0"), }, }); -// === xdr source ============================================================ -// -// struct ArchivalProof -// { -// uint32 epoch; // AST Subtree for this proof -// -// union switch (ArchivalProofType t) -// { -// case EXISTENCE: -// NonexistenceProofBody nonexistenceProof; -// case NONEXISTENCE: -// ExistenceProofBody existenceProof; -// } body; -// }; -// -// =========================================================================== -xdr.struct("ArchivalProof", [ - ["epoch", xdr.lookup("Uint32")], - ["body", xdr.lookup("ArchivalProofBody")], -]); - -// === xdr source ============================================================ -// -// struct SorobanResources -// { -// // The ledger footprint of the transaction. -// LedgerFootprint footprint; -// // The maximum number of instructions this transaction can use -// uint32 instructions; -// -// // The maximum number of bytes this transaction can read from ledger -// uint32 readBytes; -// // The maximum number of bytes this transaction can write to ledger -// uint32 writeBytes; -// }; -// -// =========================================================================== -xdr.struct("SorobanResources", [ - ["footprint", xdr.lookup("LedgerFootprint")], - ["instructions", xdr.lookup("Uint32")], - ["readBytes", xdr.lookup("Uint32")], - ["writeBytes", xdr.lookup("Uint32")], -]); - // === xdr source ============================================================ // // struct SorobanTransactionData // { -// ExtensionPoint ext; +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// SorobanResourcesExtV0 resourceExt; +// } ext; // SorobanResources resources; // // Amount of the transaction `fee` allocated to the Soroban resource fees. // // The fraction of `resourceFee` corresponding to `resources` specified @@ -6036,7 +5899,7 @@ xdr.struct("SorobanResources", [ // // =========================================================================== xdr.struct("SorobanTransactionData", [ - ["ext", xdr.lookup("ExtensionPoint")], + ["ext", xdr.lookup("SorobanTransactionDataExt")], ["resources", xdr.lookup("SorobanResources")], ["resourceFee", xdr.lookup("Int64")], ]); @@ -6148,7 +6011,6 @@ xdr.union("TransactionExt", { // // Operation operations; // -// // reserved for future use // union switch (int v) // { // case 0: @@ -8956,6 +8818,13 @@ xdr.typedef("NodeId", xdr.lookup("PublicKey")); // =========================================================================== xdr.typedef("AccountId", xdr.lookup("PublicKey")); +// === xdr source ============================================================ +// +// typedef Hash ContractID; +// +// =========================================================================== +xdr.typedef("ContractId", xdr.lookup("Hash")); + // === xdr source ============================================================ // // struct Curve25519Secret @@ -9066,6 +8935,45 @@ xdr.struct("SerializedBinaryFuseFilter", [ ["fingerprints", xdr.varOpaque()], ]); +// === xdr source ============================================================ +// +// typedef Hash PoolID; +// +// =========================================================================== +xdr.typedef("PoolId", xdr.lookup("Hash")); + +// === xdr source ============================================================ +// +// enum ClaimableBalanceIDType +// { +// CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 +// }; +// +// =========================================================================== +xdr.enum("ClaimableBalanceIdType", { + claimableBalanceIdTypeV0: 0, +}); + +// === xdr source ============================================================ +// +// union ClaimableBalanceID switch (ClaimableBalanceIDType type) +// { +// case CLAIMABLE_BALANCE_ID_TYPE_V0: +// Hash v0; +// }; +// +// =========================================================================== +xdr.union("ClaimableBalanceId", { + switchOn: xdr.lookup("ClaimableBalanceIdType"), + switchName: "type", + switches: [ + ["claimableBalanceIdTypeV0", "v0"], + ], + arms: { + v0: xdr.lookup("Hash"), + }, +}); + // === xdr source ============================================================ // // enum SCValType @@ -9351,15 +9259,35 @@ xdr.union("ContractExecutable", { // enum SCAddressType // { // SC_ADDRESS_TYPE_ACCOUNT = 0, -// SC_ADDRESS_TYPE_CONTRACT = 1 +// SC_ADDRESS_TYPE_CONTRACT = 1, +// SC_ADDRESS_TYPE_MUXED_ACCOUNT = 2, +// SC_ADDRESS_TYPE_CLAIMABLE_BALANCE = 3, +// SC_ADDRESS_TYPE_LIQUIDITY_POOL = 4 // }; // // =========================================================================== xdr.enum("ScAddressType", { scAddressTypeAccount: 0, scAddressTypeContract: 1, + scAddressTypeMuxedAccount: 2, + scAddressTypeClaimableBalance: 3, + scAddressTypeLiquidityPool: 4, }); +// === xdr source ============================================================ +// +// struct MuxedEd25519Account +// { +// uint64 id; +// uint256 ed25519; +// }; +// +// =========================================================================== +xdr.struct("MuxedEd25519Account", [ + ["id", xdr.lookup("Uint64")], + ["ed25519", xdr.lookup("Uint256")], +]); + // === xdr source ============================================================ // // union SCAddress switch (SCAddressType type) @@ -9367,7 +9295,13 @@ xdr.enum("ScAddressType", { // case SC_ADDRESS_TYPE_ACCOUNT: // AccountID accountId; // case SC_ADDRESS_TYPE_CONTRACT: -// Hash contractId; +// ContractID contractId; +// case SC_ADDRESS_TYPE_MUXED_ACCOUNT: +// MuxedEd25519Account muxedAccount; +// case SC_ADDRESS_TYPE_CLAIMABLE_BALANCE: +// ClaimableBalanceID claimableBalanceId; +// case SC_ADDRESS_TYPE_LIQUIDITY_POOL: +// PoolID liquidityPoolId; // }; // // =========================================================================== @@ -9377,10 +9311,16 @@ xdr.union("ScAddress", { switches: [ ["scAddressTypeAccount", "accountId"], ["scAddressTypeContract", "contractId"], + ["scAddressTypeMuxedAccount", "muxedAccount"], + ["scAddressTypeClaimableBalance", "claimableBalanceId"], + ["scAddressTypeLiquidityPool", "liquidityPoolId"], ], arms: { accountId: xdr.lookup("AccountId"), - contractId: xdr.lookup("Hash"), + contractId: xdr.lookup("ContractId"), + muxedAccount: xdr.lookup("MuxedEd25519Account"), + claimableBalanceId: xdr.lookup("ClaimableBalanceId"), + liquidityPoolId: xdr.lookup("PoolId"), }, }); @@ -9505,13 +9445,12 @@ xdr.struct("ScContractInstance", [ // // // Special SCVals reserved for system-constructed contract-data // // ledger keys, not generally usable elsewhere. +// case SCV_CONTRACT_INSTANCE: +// SCContractInstance instance; // case SCV_LEDGER_KEY_CONTRACT_INSTANCE: // void; // case SCV_LEDGER_KEY_NONCE: // SCNonceKey nonce_key; -// -// case SCV_CONTRACT_INSTANCE: -// SCContractInstance instance; // }; // // =========================================================================== @@ -9538,9 +9477,9 @@ xdr.union("ScVal", { ["scvVec", "vec"], ["scvMap", "map"], ["scvAddress", "address"], + ["scvContractInstance", "instance"], ["scvLedgerKeyContractInstance", xdr.void()], ["scvLedgerKeyNonce", "nonceKey"], - ["scvContractInstance", "instance"], ], arms: { b: xdr.bool(), @@ -9561,8 +9500,8 @@ xdr.union("ScVal", { vec: xdr.option(xdr.lookup("ScVec")), map: xdr.option(xdr.lookup("ScMap")), address: xdr.lookup("ScAddress"), - nonceKey: xdr.lookup("ScNonceKey"), instance: xdr.lookup("ScContractInstance"), + nonceKey: xdr.lookup("ScNonceKey"), }, }); @@ -9705,6 +9644,7 @@ xdr.const("SC_SPEC_DOC_LIMIT", 1024); // SC_SPEC_TYPE_STRING = 16, // SC_SPEC_TYPE_SYMBOL = 17, // SC_SPEC_TYPE_ADDRESS = 19, +// SC_SPEC_TYPE_MUXED_ADDRESS = 20, // // // Types with parameters. // SC_SPEC_TYPE_OPTION = 1000, @@ -9738,6 +9678,7 @@ xdr.enum("ScSpecType", { scSpecTypeString: 16, scSpecTypeSymbol: 17, scSpecTypeAddress: 19, + scSpecTypeMuxedAddress: 20, scSpecTypeOption: 1000, scSpecTypeResult: 1001, scSpecTypeVec: 1002, @@ -9857,6 +9798,7 @@ xdr.struct("ScSpecTypeUdt", [ // case SC_SPEC_TYPE_STRING: // case SC_SPEC_TYPE_SYMBOL: // case SC_SPEC_TYPE_ADDRESS: +// case SC_SPEC_TYPE_MUXED_ADDRESS: // void; // case SC_SPEC_TYPE_OPTION: // SCSpecTypeOption option; @@ -9897,6 +9839,7 @@ xdr.union("ScSpecTypeDef", { ["scSpecTypeString", xdr.void()], ["scSpecTypeSymbol", xdr.void()], ["scSpecTypeAddress", xdr.void()], + ["scSpecTypeMuxedAddress", xdr.void()], ["scSpecTypeOption", "option"], ["scSpecTypeResult", "result"], ["scSpecTypeVec", "vec"], @@ -10138,6 +10081,76 @@ xdr.struct("ScSpecFunctionV0", [ ["outputs", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 1)], ]); +// === xdr source ============================================================ +// +// enum SCSpecEventParamLocationV0 +// { +// SC_SPEC_EVENT_PARAM_LOCATION_DATA = 0, +// SC_SPEC_EVENT_PARAM_LOCATION_TOPIC_LIST = 1 +// }; +// +// =========================================================================== +xdr.enum("ScSpecEventParamLocationV0", { + scSpecEventParamLocationData: 0, + scSpecEventParamLocationTopicList: 1, +}); + +// === xdr source ============================================================ +// +// struct SCSpecEventParamV0 +// { +// string doc; +// string name<30>; +// SCSpecTypeDef type; +// SCSpecEventParamLocationV0 location; +// }; +// +// =========================================================================== +xdr.struct("ScSpecEventParamV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], + ["location", xdr.lookup("ScSpecEventParamLocationV0")], +]); + +// === xdr source ============================================================ +// +// enum SCSpecEventDataFormat +// { +// SC_SPEC_EVENT_DATA_FORMAT_SINGLE_VALUE = 0, +// SC_SPEC_EVENT_DATA_FORMAT_VEC = 1, +// SC_SPEC_EVENT_DATA_FORMAT_MAP = 2 +// }; +// +// =========================================================================== +xdr.enum("ScSpecEventDataFormat", { + scSpecEventDataFormatSingleValue: 0, + scSpecEventDataFormatVec: 1, + scSpecEventDataFormatMap: 2, +}); + +// === xdr source ============================================================ +// +// struct SCSpecEventV0 +// { +// string doc; +// string lib<80>; +// SCSymbol name; +// SCSymbol prefixTopics<2>; +// SCSpecEventParamV0 params<50>; +// SCSpecEventDataFormat dataFormat; +// }; +// +// =========================================================================== +xdr.struct("ScSpecEventV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.lookup("ScSymbol")], + ["prefixTopics", xdr.varArray(xdr.lookup("ScSymbol"), 2)], + ["params", xdr.varArray(xdr.lookup("ScSpecEventParamV0"), 50)], + ["dataFormat", xdr.lookup("ScSpecEventDataFormat")], +]); + // === xdr source ============================================================ // // enum SCSpecEntryKind @@ -10146,7 +10159,8 @@ xdr.struct("ScSpecFunctionV0", [ // SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, // SC_SPEC_ENTRY_UDT_UNION_V0 = 2, // SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, -// SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 +// SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4, +// SC_SPEC_ENTRY_EVENT_V0 = 5 // }; // // =========================================================================== @@ -10156,6 +10170,7 @@ xdr.enum("ScSpecEntryKind", { scSpecEntryUdtUnionV0: 2, scSpecEntryUdtEnumV0: 3, scSpecEntryUdtErrorEnumV0: 4, + scSpecEntryEventV0: 5, }); // === xdr source ============================================================ @@ -10172,6 +10187,8 @@ xdr.enum("ScSpecEntryKind", { // SCSpecUDTEnumV0 udtEnumV0; // case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: // SCSpecUDTErrorEnumV0 udtErrorEnumV0; +// case SC_SPEC_ENTRY_EVENT_V0: +// SCSpecEventV0 eventV0; // }; // // =========================================================================== @@ -10184,6 +10201,7 @@ xdr.union("ScSpecEntry", { ["scSpecEntryUdtUnionV0", "udtUnionV0"], ["scSpecEntryUdtEnumV0", "udtEnumV0"], ["scSpecEntryUdtErrorEnumV0", "udtErrorEnumV0"], + ["scSpecEntryEventV0", "eventV0"], ], arms: { functionV0: xdr.lookup("ScSpecFunctionV0"), @@ -10191,6 +10209,7 @@ xdr.union("ScSpecEntry", { udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), udtEnumV0: xdr.lookup("ScSpecUdtEnumV0"), udtErrorEnumV0: xdr.lookup("ScSpecUdtErrorEnumV0"), + eventV0: xdr.lookup("ScSpecEventV0"), }, }); @@ -10231,61 +10250,95 @@ xdr.struct("ConfigSettingContractComputeV0", [ ["txMemoryLimit", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// struct ConfigSettingContractParallelComputeV0 +// { +// // Maximum number of clusters with dependent transactions allowed in a +// // stage of parallel tx set component. +// // This effectively sets the lower bound on the number of physical threads +// // necessary to effectively apply transaction sets in parallel. +// uint32 ledgerMaxDependentTxClusters; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingContractParallelComputeV0", [ + ["ledgerMaxDependentTxClusters", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // struct ConfigSettingContractLedgerCostV0 // { -// // Maximum number of ledger entry read operations per ledger -// uint32 ledgerMaxReadLedgerEntries; -// // Maximum number of bytes that can be read per ledger -// uint32 ledgerMaxReadBytes; +// // Maximum number of disk entry read operations per ledger +// uint32 ledgerMaxDiskReadEntries; +// // Maximum number of bytes of disk reads that can be performed per ledger +// uint32 ledgerMaxDiskReadBytes; // // Maximum number of ledger entry write operations per ledger // uint32 ledgerMaxWriteLedgerEntries; // // Maximum number of bytes that can be written per ledger // uint32 ledgerMaxWriteBytes; // -// // Maximum number of ledger entry read operations per transaction -// uint32 txMaxReadLedgerEntries; -// // Maximum number of bytes that can be read per transaction -// uint32 txMaxReadBytes; +// // Maximum number of disk entry read operations per transaction +// uint32 txMaxDiskReadEntries; +// // Maximum number of bytes of disk reads that can be performed per transaction +// uint32 txMaxDiskReadBytes; // // Maximum number of ledger entry write operations per transaction // uint32 txMaxWriteLedgerEntries; // // Maximum number of bytes that can be written per transaction // uint32 txMaxWriteBytes; // -// int64 feeReadLedgerEntry; // Fee per ledger entry read -// int64 feeWriteLedgerEntry; // Fee per ledger entry write +// int64 feeDiskReadLedgerEntry; // Fee per disk ledger entry read +// int64 feeWriteLedgerEntry; // Fee per ledger entry write // -// int64 feeRead1KB; // Fee for reading 1KB +// int64 feeDiskRead1KB; // Fee for reading 1KB disk // // // The following parameters determine the write fee per 1KB. -// // Write fee grows linearly until bucket list reaches this size -// int64 bucketListTargetSizeBytes; -// // Fee per 1KB write when the bucket list is empty -// int64 writeFee1KBBucketListLow; -// // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` -// int64 writeFee1KBBucketListHigh; -// // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` -// uint32 bucketListWriteFeeGrowthFactor; +// // Rent fee grows linearly until soroban state reaches this size +// int64 sorobanStateTargetSizeBytes; +// // Fee per 1KB rent when the soroban state is empty +// int64 rentFee1KBSorobanStateSizeLow; +// // Fee per 1KB rent when the soroban state has reached `sorobanStateTargetSizeBytes` +// int64 rentFee1KBSorobanStateSizeHigh; +// // Rent fee multiplier for any additional data past the first `sorobanStateTargetSizeBytes` +// uint32 sorobanStateRentFeeGrowthFactor; // }; // // =========================================================================== xdr.struct("ConfigSettingContractLedgerCostV0", [ - ["ledgerMaxReadLedgerEntries", xdr.lookup("Uint32")], - ["ledgerMaxReadBytes", xdr.lookup("Uint32")], + ["ledgerMaxDiskReadEntries", xdr.lookup("Uint32")], + ["ledgerMaxDiskReadBytes", xdr.lookup("Uint32")], ["ledgerMaxWriteLedgerEntries", xdr.lookup("Uint32")], ["ledgerMaxWriteBytes", xdr.lookup("Uint32")], - ["txMaxReadLedgerEntries", xdr.lookup("Uint32")], - ["txMaxReadBytes", xdr.lookup("Uint32")], + ["txMaxDiskReadEntries", xdr.lookup("Uint32")], + ["txMaxDiskReadBytes", xdr.lookup("Uint32")], ["txMaxWriteLedgerEntries", xdr.lookup("Uint32")], ["txMaxWriteBytes", xdr.lookup("Uint32")], - ["feeReadLedgerEntry", xdr.lookup("Int64")], + ["feeDiskReadLedgerEntry", xdr.lookup("Int64")], ["feeWriteLedgerEntry", xdr.lookup("Int64")], - ["feeRead1Kb", xdr.lookup("Int64")], - ["bucketListTargetSizeBytes", xdr.lookup("Int64")], - ["writeFee1KbBucketListLow", xdr.lookup("Int64")], - ["writeFee1KbBucketListHigh", xdr.lookup("Int64")], - ["bucketListWriteFeeGrowthFactor", xdr.lookup("Uint32")], + ["feeDiskRead1Kb", xdr.lookup("Int64")], + ["sorobanStateTargetSizeBytes", xdr.lookup("Int64")], + ["rentFee1KbSorobanStateSizeLow", xdr.lookup("Int64")], + ["rentFee1KbSorobanStateSizeHigh", xdr.lookup("Int64")], + ["sorobanStateRentFeeGrowthFactor", xdr.lookup("Uint32")], +]); + +// === xdr source ============================================================ +// +// struct ConfigSettingContractLedgerCostExtV0 +// { +// // Maximum number of RO+RW entries in the transaction footprint. +// uint32 txMaxFootprintEntries; +// // Fee per 1 KB of data written to the ledger. +// // Unlike the rent fee, this is a flat fee that is charged for any ledger +// // write, independent of the type of the entry being written. +// int64 feeWrite1KB; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingContractLedgerCostExtV0", [ + ["txMaxFootprintEntries", xdr.lookup("Uint32")], + ["feeWrite1Kb", xdr.lookup("Int64")], ]); // === xdr source ============================================================ @@ -10596,11 +10649,11 @@ xdr.struct("ContractCostParamEntry", [ // // max number of entries that emit archival meta in a single ledger // uint32 maxEntriesToArchive; // -// // Number of snapshots to use when calculating average BucketList size -// uint32 bucketListSizeWindowSampleSize; +// // Number of snapshots to use when calculating average live Soroban State size +// uint32 liveSorobanStateSizeWindowSampleSize; // -// // How often to sample the BucketList size for the average, in ledgers -// uint32 bucketListWindowSamplePeriod; +// // How often to sample the live Soroban State size for the average, in ledgers +// uint32 liveSorobanStateSizeWindowSamplePeriod; // // // Maximum number of bytes that we scan for eviction per ledger // uint32 evictionScanSize; @@ -10617,8 +10670,8 @@ xdr.struct("StateArchivalSettings", [ ["persistentRentRateDenominator", xdr.lookup("Int64")], ["tempRentRateDenominator", xdr.lookup("Int64")], ["maxEntriesToArchive", xdr.lookup("Uint32")], - ["bucketListSizeWindowSampleSize", xdr.lookup("Uint32")], - ["bucketListWindowSamplePeriod", xdr.lookup("Uint32")], + ["liveSorobanStateSizeWindowSampleSize", xdr.lookup("Uint32")], + ["liveSorobanStateSizeWindowSamplePeriod", xdr.lookup("Uint32")], ["evictionScanSize", xdr.lookup("Uint32")], ["startingEvictionScanLevel", xdr.lookup("Uint32")], ]); @@ -10638,6 +10691,25 @@ xdr.struct("EvictionIterator", [ ["bucketFileOffset", xdr.lookup("Uint64")], ]); +// === xdr source ============================================================ +// +// struct ConfigSettingSCPTiming { +// uint32 ledgerTargetCloseTimeMilliseconds; +// uint32 nominationTimeoutInitialMilliseconds; +// uint32 nominationTimeoutIncrementMilliseconds; +// uint32 ballotTimeoutInitialMilliseconds; +// uint32 ballotTimeoutIncrementMilliseconds; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingScpTiming", [ + ["ledgerTargetCloseTimeMilliseconds", xdr.lookup("Uint32")], + ["nominationTimeoutInitialMilliseconds", xdr.lookup("Uint32")], + ["nominationTimeoutIncrementMilliseconds", xdr.lookup("Uint32")], + ["ballotTimeoutInitialMilliseconds", xdr.lookup("Uint32")], + ["ballotTimeoutIncrementMilliseconds", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // const CONTRACT_COST_COUNT_LIMIT = 1024; @@ -10668,8 +10740,11 @@ xdr.typedef("ContractCostParams", xdr.varArray(xdr.lookup("ContractCostParamEntr // CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, // CONFIG_SETTING_STATE_ARCHIVAL = 10, // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, -// CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, -// CONFIG_SETTING_EVICTION_ITERATOR = 13 +// CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW = 12, +// CONFIG_SETTING_EVICTION_ITERATOR = 13, +// CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14, +// CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0 = 15, +// CONFIG_SETTING_SCP_TIMING = 16 // }; // // =========================================================================== @@ -10686,8 +10761,11 @@ xdr.enum("ConfigSettingId", { configSettingContractDataEntrySizeBytes: 9, configSettingStateArchival: 10, configSettingContractExecutionLanes: 11, - configSettingBucketlistSizeWindow: 12, + configSettingLiveSorobanStateSizeWindow: 12, configSettingEvictionIterator: 13, + configSettingContractParallelComputeV0: 14, + configSettingContractLedgerCostExtV0: 15, + configSettingScpTiming: 16, }); // === xdr source ============================================================ @@ -10718,10 +10796,16 @@ xdr.enum("ConfigSettingId", { // StateArchivalSettings stateArchivalSettings; // case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: // ConfigSettingContractExecutionLanesV0 contractExecutionLanes; -// case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: -// uint64 bucketListSizeWindow<>; +// case CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW: +// uint64 liveSorobanStateSizeWindow<>; // case CONFIG_SETTING_EVICTION_ITERATOR: // EvictionIterator evictionIterator; +// case CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0: +// ConfigSettingContractParallelComputeV0 contractParallelCompute; +// case CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0: +// ConfigSettingContractLedgerCostExtV0 contractLedgerCostExt; +// case CONFIG_SETTING_SCP_TIMING: +// ConfigSettingSCPTiming contractSCPTiming; // }; // // =========================================================================== @@ -10741,8 +10825,11 @@ xdr.union("ConfigSettingEntry", { ["configSettingContractDataEntrySizeBytes", "contractDataEntrySizeBytes"], ["configSettingStateArchival", "stateArchivalSettings"], ["configSettingContractExecutionLanes", "contractExecutionLanes"], - ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], + ["configSettingLiveSorobanStateSizeWindow", "liveSorobanStateSizeWindow"], ["configSettingEvictionIterator", "evictionIterator"], + ["configSettingContractParallelComputeV0", "contractParallelCompute"], + ["configSettingContractLedgerCostExtV0", "contractLedgerCostExt"], + ["configSettingScpTiming", "contractScpTiming"], ], arms: { contractMaxSizeBytes: xdr.lookup("Uint32"), @@ -10757,10 +10844,34 @@ xdr.union("ConfigSettingEntry", { contractDataEntrySizeBytes: xdr.lookup("Uint32"), stateArchivalSettings: xdr.lookup("StateArchivalSettings"), contractExecutionLanes: xdr.lookup("ConfigSettingContractExecutionLanesV0"), - bucketListSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), + liveSorobanStateSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), evictionIterator: xdr.lookup("EvictionIterator"), + contractParallelCompute: xdr.lookup("ConfigSettingContractParallelComputeV0"), + contractLedgerCostExt: xdr.lookup("ConfigSettingContractLedgerCostExtV0"), + contractScpTiming: xdr.lookup("ConfigSettingScpTiming"), }, }); +// === xdr source ============================================================ +// +// struct LedgerCloseMetaBatch +// { +// // starting ledger sequence number in the batch +// uint32 startSequence; +// +// // ending ledger sequence number in the batch +// uint32 endSequence; +// +// // Ledger close meta for each ledger within the batch +// LedgerCloseMeta ledgerCloseMetas<>; +// }; +// +// =========================================================================== +xdr.struct("LedgerCloseMetaBatch", [ + ["startSequence", xdr.lookup("Uint32")], + ["endSequence", xdr.lookup("Uint32")], + ["ledgerCloseMeta", xdr.varArray(xdr.lookup("LedgerCloseMeta"), 2147483647)], +]); + }); export default types; diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index fe8ce869..977a3c5d 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -1,4 +1,4 @@ -// Automatically generated by xdrgen on 2024-09-12T11:09:00-08:00 +// Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten /* jshint maxstatements:2147483647 */ @@ -15,6 +15,13 @@ var types = XDR.config(xdr => { const SCSYMBOL_LIMIT = 32; const SC_SPEC_DOC_LIMIT = 1024; +// === xdr source ============================================================ +// +// typedef opaque Value<>; +// +// =========================================================================== +xdr.typedef("Value", xdr.varOpaque()); + // === xdr source ============================================================ // // struct SCPBallot @@ -286,13 +293,6 @@ xdr.typedef("SequenceNumber", xdr.lookup("Int64")); // =========================================================================== xdr.typedef("DataValue", xdr.varOpaque(64)); -// === xdr source ============================================================ -// -// typedef Hash PoolID; -// -// =========================================================================== -xdr.typedef("PoolId", xdr.lookup("Hash")); - // === xdr source ============================================================ // // typedef opaque AssetCode4[4]; @@ -1230,38 +1230,6 @@ xdr.union("Claimant", { }, }); -// === xdr source ============================================================ -// -// enum ClaimableBalanceIDType -// { -// CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 -// }; -// -// =========================================================================== -xdr.enum("ClaimableBalanceIdType", { - claimableBalanceIdTypeV0: 0, -}); - -// === xdr source ============================================================ -// -// union ClaimableBalanceID switch (ClaimableBalanceIDType type) -// { -// case CLAIMABLE_BALANCE_ID_TYPE_V0: -// Hash v0; -// }; -// -// =========================================================================== -xdr.union("ClaimableBalanceId", { - switchOn: xdr.lookup("ClaimableBalanceIdType"), - switchName: "type", - switches: [ - ["claimableBalanceIdTypeV0", "v0"], - ], - arms: { - v0: xdr.lookup("Hash"), - }, -}); - // === xdr source ============================================================ // // enum ClaimableBalanceFlags @@ -2052,15 +2020,13 @@ xdr.enum("EnvelopeType", { // enum BucketListType // { // LIVE = 0, -// HOT_ARCHIVE = 1, -// COLD_ARCHIVE = 2 +// HOT_ARCHIVE = 1 // }; // // =========================================================================== xdr.enum("BucketListType", { live: 0, hotArchive: 1, - coldArchive: 2, }); // === xdr source ============================================================ @@ -2089,10 +2055,9 @@ xdr.enum("BucketEntryType", { // { // HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. // HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived -// HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but +// HOT_ARCHIVE_LIVE = 1 // Entry was previously HOT_ARCHIVE_ARCHIVED, but // // has been added back to the live BucketList. // // Does not need to be persisted. -// HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) // }; // // =========================================================================== @@ -2100,27 +2065,6 @@ xdr.enum("HotArchiveBucketEntryType", { hotArchiveMetaentry: -1, hotArchiveArchived: 0, hotArchiveLive: 1, - hotArchiveDeleted: 2, -}); - -// === xdr source ============================================================ -// -// enum ColdArchiveBucketEntryType -// { -// COLD_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. -// COLD_ARCHIVE_ARCHIVED_LEAF = 0, // Full LedgerEntry that was archived during the epoch -// COLD_ARCHIVE_DELETED_LEAF = 1, // LedgerKey that was deleted during the epoch -// COLD_ARCHIVE_BOUNDARY_LEAF = 2, // Dummy leaf representing low/high bound -// COLD_ARCHIVE_HASH = 3 // Intermediary Merkle hash entry -// }; -// -// =========================================================================== -xdr.enum("ColdArchiveBucketEntryType", { - coldArchiveMetaentry: -1, - coldArchiveArchivedLeaf: 0, - coldArchiveDeletedLeaf: 1, - coldArchiveBoundaryLeaf: 2, - coldArchiveHash: 3, }); // === xdr source ============================================================ @@ -2209,7 +2153,6 @@ xdr.union("BucketEntry", { // LedgerEntry archivedEntry; // // case HOT_ARCHIVE_LIVE: -// case HOT_ARCHIVE_DELETED: // LedgerKey key; // case HOT_ARCHIVE_METAENTRY: // BucketMetadata metaEntry; @@ -2222,7 +2165,6 @@ xdr.union("HotArchiveBucketEntry", { switches: [ ["hotArchiveArchived", "archivedEntry"], ["hotArchiveLive", "key"], - ["hotArchiveDeleted", "key"], ["hotArchiveMetaentry", "metaEntry"], ], arms: { @@ -2232,100 +2174,6 @@ xdr.union("HotArchiveBucketEntry", { }, }); -// === xdr source ============================================================ -// -// struct ColdArchiveArchivedLeaf -// { -// uint32 index; -// LedgerEntry archivedEntry; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveArchivedLeaf", [ - ["index", xdr.lookup("Uint32")], - ["archivedEntry", xdr.lookup("LedgerEntry")], -]); - -// === xdr source ============================================================ -// -// struct ColdArchiveDeletedLeaf -// { -// uint32 index; -// LedgerKey deletedKey; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveDeletedLeaf", [ - ["index", xdr.lookup("Uint32")], - ["deletedKey", xdr.lookup("LedgerKey")], -]); - -// === xdr source ============================================================ -// -// struct ColdArchiveBoundaryLeaf -// { -// uint32 index; -// bool isLowerBound; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveBoundaryLeaf", [ - ["index", xdr.lookup("Uint32")], - ["isLowerBound", xdr.bool()], -]); - -// === xdr source ============================================================ -// -// struct ColdArchiveHashEntry -// { -// uint32 index; -// uint32 level; -// Hash hash; -// }; -// -// =========================================================================== -xdr.struct("ColdArchiveHashEntry", [ - ["index", xdr.lookup("Uint32")], - ["level", xdr.lookup("Uint32")], - ["hash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// union ColdArchiveBucketEntry switch (ColdArchiveBucketEntryType type) -// { -// case COLD_ARCHIVE_METAENTRY: -// BucketMetadata metaEntry; -// case COLD_ARCHIVE_ARCHIVED_LEAF: -// ColdArchiveArchivedLeaf archivedLeaf; -// case COLD_ARCHIVE_DELETED_LEAF: -// ColdArchiveDeletedLeaf deletedLeaf; -// case COLD_ARCHIVE_BOUNDARY_LEAF: -// ColdArchiveBoundaryLeaf boundaryLeaf; -// case COLD_ARCHIVE_HASH: -// ColdArchiveHashEntry hashEntry; -// }; -// -// =========================================================================== -xdr.union("ColdArchiveBucketEntry", { - switchOn: xdr.lookup("ColdArchiveBucketEntryType"), - switchName: "type", - switches: [ - ["coldArchiveMetaentry", "metaEntry"], - ["coldArchiveArchivedLeaf", "archivedLeaf"], - ["coldArchiveDeletedLeaf", "deletedLeaf"], - ["coldArchiveBoundaryLeaf", "boundaryLeaf"], - ["coldArchiveHash", "hashEntry"], - ], - arms: { - metaEntry: xdr.lookup("BucketMetadata"), - archivedLeaf: xdr.lookup("ColdArchiveArchivedLeaf"), - deletedLeaf: xdr.lookup("ColdArchiveDeletedLeaf"), - boundaryLeaf: xdr.lookup("ColdArchiveBoundaryLeaf"), - hashEntry: xdr.lookup("ColdArchiveHashEntry"), - }, -}); - // === xdr source ============================================================ // // typedef opaque UpgradeType<128>; @@ -2590,13 +2438,13 @@ xdr.enum("LedgerUpgradeType", { // === xdr source ============================================================ // // struct ConfigUpgradeSetKey { -// Hash contractID; +// ContractID contractID; // Hash contentHash; // }; // // =========================================================================== xdr.struct("ConfigUpgradeSetKey", [ - ["contractId", xdr.lookup("Hash")], + ["contractId", xdr.lookup("ContractId")], ["contentHash", xdr.lookup("Hash")], ]); @@ -2674,23 +2522,26 @@ xdr.enum("TxSetComponentType", { // === xdr source ============================================================ // -// typedef TransactionEnvelope TxExecutionThread<>; +// typedef TransactionEnvelope DependentTxCluster<>; // // =========================================================================== -xdr.typedef("TxExecutionThread", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)); +xdr.typedef("DependentTxCluster", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)); // === xdr source ============================================================ // -// typedef TxExecutionThread ParallelTxExecutionStage<>; +// typedef DependentTxCluster ParallelTxExecutionStage<>; // // =========================================================================== -xdr.typedef("ParallelTxExecutionStage", xdr.varArray(xdr.lookup("TxExecutionThread"), 2147483647)); +xdr.typedef("ParallelTxExecutionStage", xdr.varArray(xdr.lookup("DependentTxCluster"), 2147483647)); // === xdr source ============================================================ // // struct ParallelTxsComponent // { // int64* baseFee; +// // A sequence of stages that *may* have arbitrary data dependencies between +// // each other, i.e. in a general case the stage execution order may not be +// // arbitrarily shuffled without affecting the end result. // ParallelTxExecutionStage executionStages<>; // }; // @@ -3024,7 +2875,8 @@ xdr.union("ScpHistoryEntry", { // LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger // LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger // LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger -// LEDGER_ENTRY_STATE = 3 // value of the entry +// LEDGER_ENTRY_STATE = 3, // value of the entry +// LEDGER_ENTRY_RESTORED = 4 // archived entry was restored in the ledger // }; // // =========================================================================== @@ -3033,6 +2885,7 @@ xdr.enum("LedgerEntryChangeType", { ledgerEntryUpdated: 1, ledgerEntryRemoved: 2, ledgerEntryState: 3, + ledgerEntryRestored: 4, }); // === xdr source ============================================================ @@ -3047,6 +2900,8 @@ xdr.enum("LedgerEntryChangeType", { // LedgerKey removed; // case LEDGER_ENTRY_STATE: // LedgerEntry state; +// case LEDGER_ENTRY_RESTORED: +// LedgerEntry restored; // }; // // =========================================================================== @@ -3058,12 +2913,14 @@ xdr.union("LedgerEntryChange", { ["ledgerEntryUpdated", "updated"], ["ledgerEntryRemoved", "removed"], ["ledgerEntryState", "state"], + ["ledgerEntryRestored", "restored"], ], arms: { created: xdr.lookup("LedgerEntry"), updated: xdr.lookup("LedgerEntry"), removed: xdr.lookup("LedgerKey"), state: xdr.lookup("LedgerEntry"), + restored: xdr.lookup("LedgerEntry"), }, }); @@ -3180,7 +3037,7 @@ xdr.union("ContractEventBody", { // // is first, to change ContractEvent into a union. // ExtensionPoint ext; // -// Hash* contractID; +// ContractID* contractID; // ContractEventType type; // // union switch (int v) @@ -3198,7 +3055,7 @@ xdr.union("ContractEventBody", { // =========================================================================== xdr.struct("ContractEvent", [ ["ext", xdr.lookup("ExtensionPoint")], - ["contractId", xdr.option(xdr.lookup("Hash"))], + ["contractId", xdr.option(xdr.lookup("ContractId"))], ["type", xdr.lookup("ContractEventType")], ["body", xdr.lookup("ContractEventBody")], ]); @@ -3332,6 +3189,102 @@ xdr.struct("TransactionMetaV3", [ ["sorobanMeta", xdr.option(xdr.lookup("SorobanTransactionMeta"))], ]); +// === xdr source ============================================================ +// +// struct OperationMetaV2 +// { +// ExtensionPoint ext; +// +// LedgerEntryChanges changes; +// +// ContractEvent events<>; +// }; +// +// =========================================================================== +xdr.struct("OperationMetaV2", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["changes", xdr.lookup("LedgerEntryChanges")], + ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], +]); + +// === xdr source ============================================================ +// +// struct SorobanTransactionMetaV2 +// { +// SorobanTransactionMetaExt ext; +// +// SCVal* returnValue; +// }; +// +// =========================================================================== +xdr.struct("SorobanTransactionMetaV2", [ + ["ext", xdr.lookup("SorobanTransactionMetaExt")], + ["returnValue", xdr.option(xdr.lookup("ScVal"))], +]); + +// === xdr source ============================================================ +// +// enum TransactionEventStage { +// // The event has happened before any one of the transactions has its +// // operations applied. +// TRANSACTION_EVENT_STAGE_BEFORE_ALL_TXS = 0, +// // The event has happened immediately after operations of the transaction +// // have been applied. +// TRANSACTION_EVENT_STAGE_AFTER_TX = 1, +// // The event has happened after every transaction had its operations +// // applied. +// TRANSACTION_EVENT_STAGE_AFTER_ALL_TXS = 2 +// }; +// +// =========================================================================== +xdr.enum("TransactionEventStage", { + transactionEventStageBeforeAllTxes: 0, + transactionEventStageAfterTx: 1, + transactionEventStageAfterAllTxes: 2, +}); + +// === xdr source ============================================================ +// +// struct TransactionEvent { +// TransactionEventStage stage; // Stage at which an event has occurred. +// ContractEvent event; // The contract event that has occurred. +// }; +// +// =========================================================================== +xdr.struct("TransactionEvent", [ + ["stage", xdr.lookup("TransactionEventStage")], + ["event", xdr.lookup("ContractEvent")], +]); + +// === xdr source ============================================================ +// +// struct TransactionMetaV4 +// { +// ExtensionPoint ext; +// +// LedgerEntryChanges txChangesBefore; // tx level changes before operations +// // are applied if any +// OperationMetaV2 operations<>; // meta for each operation +// LedgerEntryChanges txChangesAfter; // tx level changes after operations are +// // applied if any +// SorobanTransactionMetaV2* sorobanMeta; // Soroban-specific meta (only for +// // Soroban transactions). +// +// TransactionEvent events<>; // Used for transaction-level events (like fee payment) +// DiagnosticEvent diagnosticEvents<>; // Used for all diagnostic information +// }; +// +// =========================================================================== +xdr.struct("TransactionMetaV4", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMetaV2"), 2147483647)], + ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], + ["sorobanMeta", xdr.option(xdr.lookup("SorobanTransactionMetaV2"))], + ["events", xdr.varArray(xdr.lookup("TransactionEvent"), 2147483647)], + ["diagnosticEvents", xdr.varArray(xdr.lookup("DiagnosticEvent"), 2147483647)], +]); + // === xdr source ============================================================ // // struct InvokeHostFunctionSuccessPreImage @@ -3358,6 +3311,8 @@ xdr.struct("InvokeHostFunctionSuccessPreImage", [ // TransactionMetaV2 v2; // case 3: // TransactionMetaV3 v3; +// case 4: +// TransactionMetaV4 v4; // }; // // =========================================================================== @@ -3369,12 +3324,14 @@ xdr.union("TransactionMeta", { [1, "v1"], [2, "v2"], [3, "v3"], + [4, "v4"], ], arms: { operations: xdr.varArray(xdr.lookup("OperationMeta"), 2147483647), v1: xdr.lookup("TransactionMetaV1"), v2: xdr.lookup("TransactionMetaV2"), v3: xdr.lookup("TransactionMetaV3"), + v4: xdr.lookup("TransactionMetaV4"), }, }); @@ -3394,6 +3351,28 @@ xdr.struct("TransactionResultMeta", [ ["txApplyProcessing", xdr.lookup("TransactionMeta")], ]); +// === xdr source ============================================================ +// +// struct TransactionResultMetaV1 +// { +// ExtensionPoint ext; +// +// TransactionResultPair result; +// LedgerEntryChanges feeProcessing; +// TransactionMeta txApplyProcessing; +// +// LedgerEntryChanges postTxApplyFeeProcessing; +// }; +// +// =========================================================================== +xdr.struct("TransactionResultMetaV1", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["result", xdr.lookup("TransactionResultPair")], + ["feeProcessing", xdr.lookup("LedgerEntryChanges")], + ["txApplyProcessing", xdr.lookup("TransactionMeta")], + ["postTxApplyFeeProcessing", xdr.lookup("LedgerEntryChanges")], +]); + // === xdr source ============================================================ // // struct UpgradeEntryMeta @@ -3495,16 +3474,15 @@ xdr.union("LedgerCloseMetaExt", { // // other misc information attached to the ledger close // SCPHistoryEntry scpInfo<>; // -// // Size in bytes of BucketList, to support downstream +// // Size in bytes of live Soroban state, to support downstream // // systems calculating storage fees correctly. -// uint64 totalByteSizeOfBucketList; +// uint64 totalByteSizeOfLiveSorobanState; // -// // Temp keys that are being evicted at this ledger. -// LedgerKey evictedTemporaryLedgerKeys<>; +// // TTL and data/code keys that have been evicted at this ledger. +// LedgerKey evictedKeys<>; // -// // Archived restorable ledger entries that are being -// // evicted at this ledger. -// LedgerEntry evictedPersistentLedgerEntries<>; +// // Maintained for backwards compatibility, should never be populated. +// LedgerEntry unused<>; // }; // // =========================================================================== @@ -3515,9 +3493,50 @@ xdr.struct("LedgerCloseMetaV1", [ ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647)], ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], - ["totalByteSizeOfBucketList", xdr.lookup("Uint64")], - ["evictedTemporaryLedgerKeys", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], - ["evictedPersistentLedgerEntries", xdr.varArray(xdr.lookup("LedgerEntry"), 2147483647)], + ["totalByteSizeOfLiveSorobanState", xdr.lookup("Uint64")], + ["evictedKeys", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], + ["unused", xdr.varArray(xdr.lookup("LedgerEntry"), 2147483647)], +]); + +// === xdr source ============================================================ +// +// struct LedgerCloseMetaV2 +// { +// LedgerCloseMetaExt ext; +// +// LedgerHeaderHistoryEntry ledgerHeader; +// +// GeneralizedTransactionSet txSet; +// +// // NB: transactions are sorted in apply order here +// // fees for all transactions are processed first +// // followed by applying transactions +// TransactionResultMetaV1 txProcessing<>; +// +// // upgrades are applied last +// UpgradeEntryMeta upgradesProcessing<>; +// +// // other misc information attached to the ledger close +// SCPHistoryEntry scpInfo<>; +// +// // Size in bytes of live Soroban state, to support downstream +// // systems calculating storage fees correctly. +// uint64 totalByteSizeOfLiveSorobanState; +// +// // TTL and data/code keys that have been evicted at this ledger. +// LedgerKey evictedKeys<>; +// }; +// +// =========================================================================== +xdr.struct("LedgerCloseMetaV2", [ + ["ext", xdr.lookup("LedgerCloseMetaExt")], + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("GeneralizedTransactionSet")], + ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMetaV1"), 2147483647)], + ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ["totalByteSizeOfLiveSorobanState", xdr.lookup("Uint64")], + ["evictedKeys", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], ]); // === xdr source ============================================================ @@ -3528,6 +3547,8 @@ xdr.struct("LedgerCloseMetaV1", [ // LedgerCloseMetaV0 v0; // case 1: // LedgerCloseMetaV1 v1; +// case 2: +// LedgerCloseMetaV2 v2; // }; // // =========================================================================== @@ -3537,10 +3558,12 @@ xdr.union("LedgerCloseMeta", { switches: [ [0, "v0"], [1, "v1"], + [2, "v2"], ], arms: { v0: xdr.lookup("LedgerCloseMetaV0"), v1: xdr.lookup("LedgerCloseMetaV1"), + v2: xdr.lookup("LedgerCloseMetaV2"), }, }); @@ -3735,8 +3758,8 @@ xdr.struct("PeerAddress", [ // ERROR_MSG = 0, // AUTH = 2, // DONT_HAVE = 3, +// // GET_PEERS (4) is deprecated // -// GET_PEERS = 4, // gets a list of peers this guy knows about // PEERS = 5, // // GET_TX_SET = 6, // gets a particular txset by hash @@ -3754,8 +3777,8 @@ xdr.struct("PeerAddress", [ // // new messages // HELLO = 13, // -// SURVEY_REQUEST = 14, -// SURVEY_RESPONSE = 15, +// // SURVEY_REQUEST (14) removed and replaced by TIME_SLICED_SURVEY_REQUEST +// // SURVEY_RESPONSE (15) removed and replaced by TIME_SLICED_SURVEY_RESPONSE // // SEND_MORE = 16, // SEND_MORE_EXTENDED = 20, @@ -3774,7 +3797,6 @@ xdr.enum("MessageType", { errorMsg: 0, auth: 2, dontHave: 3, - getPeers: 4, peers: 5, getTxSet: 6, txSet: 7, @@ -3785,8 +3807,6 @@ xdr.enum("MessageType", { scpMessage: 11, getScpState: 12, hello: 13, - surveyRequest: 14, - surveyResponse: 15, sendMore: 16, sendMoreExtended: 20, floodAdvert: 18, @@ -3815,13 +3835,11 @@ xdr.struct("DontHave", [ // // enum SurveyMessageCommandType // { -// SURVEY_TOPOLOGY = 0, // TIME_SLICED_SURVEY_TOPOLOGY = 1 // }; // // =========================================================================== xdr.enum("SurveyMessageCommandType", { - surveyTopology: 0, timeSlicedSurveyTopology: 1, }); @@ -3829,15 +3847,11 @@ xdr.enum("SurveyMessageCommandType", { // // enum SurveyMessageResponseType // { -// SURVEY_TOPOLOGY_RESPONSE_V0 = 0, -// SURVEY_TOPOLOGY_RESPONSE_V1 = 1, // SURVEY_TOPOLOGY_RESPONSE_V2 = 2 // }; // // =========================================================================== xdr.enum("SurveyMessageResponseType", { - surveyTopologyResponseV0: 0, - surveyTopologyResponseV1: 1, surveyTopologyResponseV2: 2, }); @@ -3939,20 +3953,6 @@ xdr.struct("TimeSlicedSurveyRequestMessage", [ ["outboundPeersIndex", xdr.lookup("Uint32")], ]); -// === xdr source ============================================================ -// -// struct SignedSurveyRequestMessage -// { -// Signature requestSignature; -// SurveyRequestMessage request; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyRequestMessage", [ - ["requestSignature", xdr.lookup("Signature")], - ["request", xdr.lookup("SurveyRequestMessage")], -]); - // === xdr source ============================================================ // // struct SignedTimeSlicedSurveyRequestMessage @@ -4008,20 +4008,6 @@ xdr.struct("TimeSlicedSurveyResponseMessage", [ ["nonce", xdr.lookup("Uint32")], ]); -// === xdr source ============================================================ -// -// struct SignedSurveyResponseMessage -// { -// Signature responseSignature; -// SurveyResponseMessage response; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyResponseMessage", [ - ["responseSignature", xdr.lookup("Signature")], - ["response", xdr.lookup("SurveyResponseMessage")], -]); - // === xdr source ============================================================ // // struct SignedTimeSlicedSurveyResponseMessage @@ -4078,13 +4064,6 @@ xdr.struct("PeerStats", [ ["duplicateFetchMessageRecv", xdr.lookup("Uint64")], ]); -// === xdr source ============================================================ -// -// typedef PeerStats PeerStatList<25>; -// -// =========================================================================== -xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); - // === xdr source ============================================================ // // struct TimeSlicedNodeData @@ -4142,49 +4121,6 @@ xdr.struct("TimeSlicedPeerData", [ // =========================================================================== xdr.typedef("TimeSlicedPeerDataList", xdr.varArray(xdr.lookup("TimeSlicedPeerData"), 25)); -// === xdr source ============================================================ -// -// struct TopologyResponseBodyV0 -// { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// }; -// -// =========================================================================== -xdr.struct("TopologyResponseBodyV0", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct TopologyResponseBodyV1 -// { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// -// uint32 maxInboundPeerCount; -// uint32 maxOutboundPeerCount; -// }; -// -// =========================================================================== -xdr.struct("TopologyResponseBodyV1", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], - ["maxInboundPeerCount", xdr.lookup("Uint32")], - ["maxOutboundPeerCount", xdr.lookup("Uint32")], -]); - // === xdr source ============================================================ // // struct TopologyResponseBodyV2 @@ -4205,10 +4141,6 @@ xdr.struct("TopologyResponseBodyV2", [ // // union SurveyResponseBody switch (SurveyMessageResponseType type) // { -// case SURVEY_TOPOLOGY_RESPONSE_V0: -// TopologyResponseBodyV0 topologyResponseBodyV0; -// case SURVEY_TOPOLOGY_RESPONSE_V1: -// TopologyResponseBodyV1 topologyResponseBodyV1; // case SURVEY_TOPOLOGY_RESPONSE_V2: // TopologyResponseBodyV2 topologyResponseBodyV2; // }; @@ -4218,13 +4150,9 @@ xdr.union("SurveyResponseBody", { switchOn: xdr.lookup("SurveyMessageResponseType"), switchName: "type", switches: [ - ["surveyTopologyResponseV0", "topologyResponseBodyV0"], - ["surveyTopologyResponseV1", "topologyResponseBodyV1"], ["surveyTopologyResponseV2", "topologyResponseBodyV2"], ], arms: { - topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), - topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), topologyResponseBodyV2: xdr.lookup("TopologyResponseBodyV2"), }, }); @@ -4293,8 +4221,6 @@ xdr.struct("FloodDemand", [ // Auth auth; // case DONT_HAVE: // DontHave dontHave; -// case GET_PEERS: -// void; // case PEERS: // PeerAddress peers<100>; // @@ -4308,12 +4234,6 @@ xdr.struct("FloodDemand", [ // case TRANSACTION: // TransactionEnvelope transaction; // -// case SURVEY_REQUEST: -// SignedSurveyRequestMessage signedSurveyRequestMessage; -// -// case SURVEY_RESPONSE: -// SignedSurveyResponseMessage signedSurveyResponseMessage; -// // case TIME_SLICED_SURVEY_REQUEST: // SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; // @@ -4357,14 +4277,11 @@ xdr.union("StellarMessage", { ["hello", "hello"], ["auth", "auth"], ["dontHave", "dontHave"], - ["getPeers", xdr.void()], ["peers", "peers"], ["getTxSet", "txSetHash"], ["txSet", "txSet"], ["generalizedTxSet", "generalizedTxSet"], ["transaction", "transaction"], - ["surveyRequest", "signedSurveyRequestMessage"], - ["surveyResponse", "signedSurveyResponseMessage"], ["timeSlicedSurveyRequest", "signedTimeSlicedSurveyRequestMessage"], ["timeSlicedSurveyResponse", "signedTimeSlicedSurveyResponseMessage"], ["timeSlicedSurveyStartCollecting", "signedTimeSlicedSurveyStartCollectingMessage"], @@ -4388,8 +4305,6 @@ xdr.union("StellarMessage", { txSet: xdr.lookup("TransactionSet"), generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), transaction: xdr.lookup("TransactionEnvelope"), - signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), - signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), signedTimeSlicedSurveyRequestMessage: xdr.lookup("SignedTimeSlicedSurveyRequestMessage"), signedTimeSlicedSurveyResponseMessage: xdr.lookup("SignedTimeSlicedSurveyResponseMessage"), signedTimeSlicedSurveyStartCollectingMessage: xdr.lookup("SignedTimeSlicedSurveyStartCollectingMessage"), @@ -5344,6 +5259,13 @@ xdr.struct("SorobanAuthorizationEntry", [ ["rootInvocation", xdr.lookup("SorobanAuthorizedInvocation")], ]); +// === xdr source ============================================================ +// +// typedef SorobanAuthorizationEntry SorobanAuthorizationEntries<>; +// +// =========================================================================== +xdr.typedef("SorobanAuthorizationEntries", xdr.varArray(xdr.lookup("SorobanAuthorizationEntry"), 2147483647)); + // === xdr source ============================================================ // // struct InvokeHostFunctionOp @@ -5890,127 +5812,6 @@ xdr.struct("LedgerFootprint", [ ["readWrite", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], ]); -// === xdr source ============================================================ -// -// enum ArchivalProofType -// { -// EXISTENCE = 0, -// NONEXISTENCE = 1 -// }; -// -// =========================================================================== -xdr.enum("ArchivalProofType", { - existence: 0, - nonexistence: 1, -}); - -// === xdr source ============================================================ -// -// struct ArchivalProofNode -// { -// uint32 index; -// Hash hash; -// }; -// -// =========================================================================== -xdr.struct("ArchivalProofNode", [ - ["index", xdr.lookup("Uint32")], - ["hash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// typedef ArchivalProofNode ProofLevel<>; -// -// =========================================================================== -xdr.typedef("ProofLevel", xdr.varArray(xdr.lookup("ArchivalProofNode"), 2147483647)); - -// === xdr source ============================================================ -// -// struct NonexistenceProofBody -// { -// ColdArchiveBucketEntry entriesToProve<>; -// -// // Vector of vectors, where proofLevels[level] -// // contains all HashNodes that correspond with that level -// ProofLevel proofLevels<>; -// }; -// -// =========================================================================== -xdr.struct("NonexistenceProofBody", [ - ["entriesToProve", xdr.varArray(xdr.lookup("ColdArchiveBucketEntry"), 2147483647)], - ["proofLevels", xdr.varArray(xdr.lookup("ProofLevel"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct ExistenceProofBody -// { -// LedgerKey keysToProve<>; -// -// // Bounds for each key being proved, where bound[n] -// // corresponds to keysToProve[n] -// ColdArchiveBucketEntry lowBoundEntries<>; -// ColdArchiveBucketEntry highBoundEntries<>; -// -// // Vector of vectors, where proofLevels[level] -// // contains all HashNodes that correspond with that level -// ProofLevel proofLevels<>; -// }; -// -// =========================================================================== -xdr.struct("ExistenceProofBody", [ - ["keysToProve", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], - ["lowBoundEntries", xdr.varArray(xdr.lookup("ColdArchiveBucketEntry"), 2147483647)], - ["highBoundEntries", xdr.varArray(xdr.lookup("ColdArchiveBucketEntry"), 2147483647)], - ["proofLevels", xdr.varArray(xdr.lookup("ProofLevel"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union switch (ArchivalProofType t) -// { -// case EXISTENCE: -// NonexistenceProofBody nonexistenceProof; -// case NONEXISTENCE: -// ExistenceProofBody existenceProof; -// } -// -// =========================================================================== -xdr.union("ArchivalProofBody", { - switchOn: xdr.lookup("ArchivalProofType"), - switchName: "t", - switches: [ - ["existence", "nonexistenceProof"], - ["nonexistence", "existenceProof"], - ], - arms: { - nonexistenceProof: xdr.lookup("NonexistenceProofBody"), - existenceProof: xdr.lookup("ExistenceProofBody"), - }, -}); - -// === xdr source ============================================================ -// -// struct ArchivalProof -// { -// uint32 epoch; // AST Subtree for this proof -// -// union switch (ArchivalProofType t) -// { -// case EXISTENCE: -// NonexistenceProofBody nonexistenceProof; -// case NONEXISTENCE: -// ExistenceProofBody existenceProof; -// } body; -// }; -// -// =========================================================================== -xdr.struct("ArchivalProof", [ - ["epoch", xdr.lookup("Uint32")], - ["body", xdr.lookup("ArchivalProofBody")], -]); - // === xdr source ============================================================ // // struct SorobanResources @@ -6020,8 +5821,8 @@ xdr.struct("ArchivalProof", [ // // The maximum number of instructions this transaction can use // uint32 instructions; // -// // The maximum number of bytes this transaction can read from ledger -// uint32 readBytes; +// // The maximum number of bytes this transaction can read from disk backed entries +// uint32 diskReadBytes; // // The maximum number of bytes this transaction can write to ledger // uint32 writeBytes; // }; @@ -6030,10 +5831,25 @@ xdr.struct("ArchivalProof", [ xdr.struct("SorobanResources", [ ["footprint", xdr.lookup("LedgerFootprint")], ["instructions", xdr.lookup("Uint32")], - ["readBytes", xdr.lookup("Uint32")], + ["diskReadBytes", xdr.lookup("Uint32")], ["writeBytes", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// struct SorobanResourcesExtV0 +// { +// // Vector of indices representing what Soroban +// // entries in the footprint are archived, based on the +// // order of keys provided in the readWrite footprint. +// uint32 archivedSorobanEntries<>; +// }; +// +// =========================================================================== +xdr.struct("SorobanResourcesExtV0", [ + ["archivedSorobanEntries", xdr.varArray(xdr.lookup("Uint32"), 2147483647)], +]); + // === xdr source ============================================================ // // union switch (int v) @@ -6041,7 +5857,7 @@ xdr.struct("SorobanResources", [ // case 0: // void; // case 1: -// ArchivalProof proofs<>; +// SorobanResourcesExtV0 resourceExt; // } // // =========================================================================== @@ -6050,10 +5866,10 @@ xdr.union("SorobanTransactionDataExt", { switchName: "v", switches: [ [0, xdr.void()], - [1, "proofs"], + [1, "resourceExt"], ], arms: { - proofs: xdr.varArray(xdr.lookup("ArchivalProof"), 2147483647), + resourceExt: xdr.lookup("SorobanResourcesExtV0"), }, }); @@ -6066,7 +5882,7 @@ xdr.union("SorobanTransactionDataExt", { // case 0: // void; // case 1: -// ArchivalProof proofs<>; +// SorobanResourcesExtV0 resourceExt; // } ext; // SorobanResources resources; // // Amount of the transaction `fee` allocated to the Soroban resource fees. @@ -6195,7 +6011,6 @@ xdr.union("TransactionExt", { // // Operation operations; // -// // reserved for future use // union switch (int v) // { // case 0: @@ -9003,6 +8818,13 @@ xdr.typedef("NodeId", xdr.lookup("PublicKey")); // =========================================================================== xdr.typedef("AccountId", xdr.lookup("PublicKey")); +// === xdr source ============================================================ +// +// typedef Hash ContractID; +// +// =========================================================================== +xdr.typedef("ContractId", xdr.lookup("Hash")); + // === xdr source ============================================================ // // struct Curve25519Secret @@ -9113,6 +8935,45 @@ xdr.struct("SerializedBinaryFuseFilter", [ ["fingerprints", xdr.varOpaque()], ]); +// === xdr source ============================================================ +// +// typedef Hash PoolID; +// +// =========================================================================== +xdr.typedef("PoolId", xdr.lookup("Hash")); + +// === xdr source ============================================================ +// +// enum ClaimableBalanceIDType +// { +// CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 +// }; +// +// =========================================================================== +xdr.enum("ClaimableBalanceIdType", { + claimableBalanceIdTypeV0: 0, +}); + +// === xdr source ============================================================ +// +// union ClaimableBalanceID switch (ClaimableBalanceIDType type) +// { +// case CLAIMABLE_BALANCE_ID_TYPE_V0: +// Hash v0; +// }; +// +// =========================================================================== +xdr.union("ClaimableBalanceId", { + switchOn: xdr.lookup("ClaimableBalanceIdType"), + switchName: "type", + switches: [ + ["claimableBalanceIdTypeV0", "v0"], + ], + arms: { + v0: xdr.lookup("Hash"), + }, +}); + // === xdr source ============================================================ // // enum SCValType @@ -9398,15 +9259,35 @@ xdr.union("ContractExecutable", { // enum SCAddressType // { // SC_ADDRESS_TYPE_ACCOUNT = 0, -// SC_ADDRESS_TYPE_CONTRACT = 1 +// SC_ADDRESS_TYPE_CONTRACT = 1, +// SC_ADDRESS_TYPE_MUXED_ACCOUNT = 2, +// SC_ADDRESS_TYPE_CLAIMABLE_BALANCE = 3, +// SC_ADDRESS_TYPE_LIQUIDITY_POOL = 4 // }; // // =========================================================================== xdr.enum("ScAddressType", { scAddressTypeAccount: 0, scAddressTypeContract: 1, + scAddressTypeMuxedAccount: 2, + scAddressTypeClaimableBalance: 3, + scAddressTypeLiquidityPool: 4, }); +// === xdr source ============================================================ +// +// struct MuxedEd25519Account +// { +// uint64 id; +// uint256 ed25519; +// }; +// +// =========================================================================== +xdr.struct("MuxedEd25519Account", [ + ["id", xdr.lookup("Uint64")], + ["ed25519", xdr.lookup("Uint256")], +]); + // === xdr source ============================================================ // // union SCAddress switch (SCAddressType type) @@ -9414,7 +9295,13 @@ xdr.enum("ScAddressType", { // case SC_ADDRESS_TYPE_ACCOUNT: // AccountID accountId; // case SC_ADDRESS_TYPE_CONTRACT: -// Hash contractId; +// ContractID contractId; +// case SC_ADDRESS_TYPE_MUXED_ACCOUNT: +// MuxedEd25519Account muxedAccount; +// case SC_ADDRESS_TYPE_CLAIMABLE_BALANCE: +// ClaimableBalanceID claimableBalanceId; +// case SC_ADDRESS_TYPE_LIQUIDITY_POOL: +// PoolID liquidityPoolId; // }; // // =========================================================================== @@ -9424,10 +9311,16 @@ xdr.union("ScAddress", { switches: [ ["scAddressTypeAccount", "accountId"], ["scAddressTypeContract", "contractId"], + ["scAddressTypeMuxedAccount", "muxedAccount"], + ["scAddressTypeClaimableBalance", "claimableBalanceId"], + ["scAddressTypeLiquidityPool", "liquidityPoolId"], ], arms: { accountId: xdr.lookup("AccountId"), - contractId: xdr.lookup("Hash"), + contractId: xdr.lookup("ContractId"), + muxedAccount: xdr.lookup("MuxedEd25519Account"), + claimableBalanceId: xdr.lookup("ClaimableBalanceId"), + liquidityPoolId: xdr.lookup("PoolId"), }, }); @@ -9552,13 +9445,12 @@ xdr.struct("ScContractInstance", [ // // // Special SCVals reserved for system-constructed contract-data // // ledger keys, not generally usable elsewhere. +// case SCV_CONTRACT_INSTANCE: +// SCContractInstance instance; // case SCV_LEDGER_KEY_CONTRACT_INSTANCE: // void; // case SCV_LEDGER_KEY_NONCE: // SCNonceKey nonce_key; -// -// case SCV_CONTRACT_INSTANCE: -// SCContractInstance instance; // }; // // =========================================================================== @@ -9585,9 +9477,9 @@ xdr.union("ScVal", { ["scvVec", "vec"], ["scvMap", "map"], ["scvAddress", "address"], + ["scvContractInstance", "instance"], ["scvLedgerKeyContractInstance", xdr.void()], ["scvLedgerKeyNonce", "nonceKey"], - ["scvContractInstance", "instance"], ], arms: { b: xdr.bool(), @@ -9608,8 +9500,8 @@ xdr.union("ScVal", { vec: xdr.option(xdr.lookup("ScVec")), map: xdr.option(xdr.lookup("ScMap")), address: xdr.lookup("ScAddress"), - nonceKey: xdr.lookup("ScNonceKey"), instance: xdr.lookup("ScContractInstance"), + nonceKey: xdr.lookup("ScNonceKey"), }, }); @@ -9752,6 +9644,7 @@ xdr.const("SC_SPEC_DOC_LIMIT", 1024); // SC_SPEC_TYPE_STRING = 16, // SC_SPEC_TYPE_SYMBOL = 17, // SC_SPEC_TYPE_ADDRESS = 19, +// SC_SPEC_TYPE_MUXED_ADDRESS = 20, // // // Types with parameters. // SC_SPEC_TYPE_OPTION = 1000, @@ -9785,6 +9678,7 @@ xdr.enum("ScSpecType", { scSpecTypeString: 16, scSpecTypeSymbol: 17, scSpecTypeAddress: 19, + scSpecTypeMuxedAddress: 20, scSpecTypeOption: 1000, scSpecTypeResult: 1001, scSpecTypeVec: 1002, @@ -9904,6 +9798,7 @@ xdr.struct("ScSpecTypeUdt", [ // case SC_SPEC_TYPE_STRING: // case SC_SPEC_TYPE_SYMBOL: // case SC_SPEC_TYPE_ADDRESS: +// case SC_SPEC_TYPE_MUXED_ADDRESS: // void; // case SC_SPEC_TYPE_OPTION: // SCSpecTypeOption option; @@ -9944,6 +9839,7 @@ xdr.union("ScSpecTypeDef", { ["scSpecTypeString", xdr.void()], ["scSpecTypeSymbol", xdr.void()], ["scSpecTypeAddress", xdr.void()], + ["scSpecTypeMuxedAddress", xdr.void()], ["scSpecTypeOption", "option"], ["scSpecTypeResult", "result"], ["scSpecTypeVec", "vec"], @@ -10185,6 +10081,76 @@ xdr.struct("ScSpecFunctionV0", [ ["outputs", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 1)], ]); +// === xdr source ============================================================ +// +// enum SCSpecEventParamLocationV0 +// { +// SC_SPEC_EVENT_PARAM_LOCATION_DATA = 0, +// SC_SPEC_EVENT_PARAM_LOCATION_TOPIC_LIST = 1 +// }; +// +// =========================================================================== +xdr.enum("ScSpecEventParamLocationV0", { + scSpecEventParamLocationData: 0, + scSpecEventParamLocationTopicList: 1, +}); + +// === xdr source ============================================================ +// +// struct SCSpecEventParamV0 +// { +// string doc; +// string name<30>; +// SCSpecTypeDef type; +// SCSpecEventParamLocationV0 location; +// }; +// +// =========================================================================== +xdr.struct("ScSpecEventParamV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], + ["location", xdr.lookup("ScSpecEventParamLocationV0")], +]); + +// === xdr source ============================================================ +// +// enum SCSpecEventDataFormat +// { +// SC_SPEC_EVENT_DATA_FORMAT_SINGLE_VALUE = 0, +// SC_SPEC_EVENT_DATA_FORMAT_VEC = 1, +// SC_SPEC_EVENT_DATA_FORMAT_MAP = 2 +// }; +// +// =========================================================================== +xdr.enum("ScSpecEventDataFormat", { + scSpecEventDataFormatSingleValue: 0, + scSpecEventDataFormatVec: 1, + scSpecEventDataFormatMap: 2, +}); + +// === xdr source ============================================================ +// +// struct SCSpecEventV0 +// { +// string doc; +// string lib<80>; +// SCSymbol name; +// SCSymbol prefixTopics<2>; +// SCSpecEventParamV0 params<50>; +// SCSpecEventDataFormat dataFormat; +// }; +// +// =========================================================================== +xdr.struct("ScSpecEventV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.lookup("ScSymbol")], + ["prefixTopics", xdr.varArray(xdr.lookup("ScSymbol"), 2)], + ["params", xdr.varArray(xdr.lookup("ScSpecEventParamV0"), 50)], + ["dataFormat", xdr.lookup("ScSpecEventDataFormat")], +]); + // === xdr source ============================================================ // // enum SCSpecEntryKind @@ -10193,7 +10159,8 @@ xdr.struct("ScSpecFunctionV0", [ // SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, // SC_SPEC_ENTRY_UDT_UNION_V0 = 2, // SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, -// SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 +// SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4, +// SC_SPEC_ENTRY_EVENT_V0 = 5 // }; // // =========================================================================== @@ -10203,6 +10170,7 @@ xdr.enum("ScSpecEntryKind", { scSpecEntryUdtUnionV0: 2, scSpecEntryUdtEnumV0: 3, scSpecEntryUdtErrorEnumV0: 4, + scSpecEntryEventV0: 5, }); // === xdr source ============================================================ @@ -10219,6 +10187,8 @@ xdr.enum("ScSpecEntryKind", { // SCSpecUDTEnumV0 udtEnumV0; // case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: // SCSpecUDTErrorEnumV0 udtErrorEnumV0; +// case SC_SPEC_ENTRY_EVENT_V0: +// SCSpecEventV0 eventV0; // }; // // =========================================================================== @@ -10231,6 +10201,7 @@ xdr.union("ScSpecEntry", { ["scSpecEntryUdtUnionV0", "udtUnionV0"], ["scSpecEntryUdtEnumV0", "udtEnumV0"], ["scSpecEntryUdtErrorEnumV0", "udtErrorEnumV0"], + ["scSpecEntryEventV0", "eventV0"], ], arms: { functionV0: xdr.lookup("ScSpecFunctionV0"), @@ -10238,6 +10209,7 @@ xdr.union("ScSpecEntry", { udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), udtEnumV0: xdr.lookup("ScSpecUdtEnumV0"), udtErrorEnumV0: xdr.lookup("ScSpecUdtErrorEnumV0"), + eventV0: xdr.lookup("ScSpecEventV0"), }, }); @@ -10282,75 +10254,91 @@ xdr.struct("ConfigSettingContractComputeV0", [ // // struct ConfigSettingContractParallelComputeV0 // { -// // Maximum number of threads that can be used to apply a -// // transaction set to close the ledger. -// // This doesn't limit or defined the actual number of -// // threads used and instead only defines the minimum number -// // of physical threads that a tier-1 validator has to support -// // in order to not fall out of sync with the network. -// uint32 ledgerMaxParallelThreads; +// // Maximum number of clusters with dependent transactions allowed in a +// // stage of parallel tx set component. +// // This effectively sets the lower bound on the number of physical threads +// // necessary to effectively apply transaction sets in parallel. +// uint32 ledgerMaxDependentTxClusters; // }; // // =========================================================================== xdr.struct("ConfigSettingContractParallelComputeV0", [ - ["ledgerMaxParallelThreads", xdr.lookup("Uint32")], + ["ledgerMaxDependentTxClusters", xdr.lookup("Uint32")], ]); // === xdr source ============================================================ // // struct ConfigSettingContractLedgerCostV0 // { -// // Maximum number of ledger entry read operations per ledger -// uint32 ledgerMaxReadLedgerEntries; -// // Maximum number of bytes that can be read per ledger -// uint32 ledgerMaxReadBytes; +// // Maximum number of disk entry read operations per ledger +// uint32 ledgerMaxDiskReadEntries; +// // Maximum number of bytes of disk reads that can be performed per ledger +// uint32 ledgerMaxDiskReadBytes; // // Maximum number of ledger entry write operations per ledger // uint32 ledgerMaxWriteLedgerEntries; // // Maximum number of bytes that can be written per ledger // uint32 ledgerMaxWriteBytes; // -// // Maximum number of ledger entry read operations per transaction -// uint32 txMaxReadLedgerEntries; -// // Maximum number of bytes that can be read per transaction -// uint32 txMaxReadBytes; +// // Maximum number of disk entry read operations per transaction +// uint32 txMaxDiskReadEntries; +// // Maximum number of bytes of disk reads that can be performed per transaction +// uint32 txMaxDiskReadBytes; // // Maximum number of ledger entry write operations per transaction // uint32 txMaxWriteLedgerEntries; // // Maximum number of bytes that can be written per transaction // uint32 txMaxWriteBytes; // -// int64 feeReadLedgerEntry; // Fee per ledger entry read -// int64 feeWriteLedgerEntry; // Fee per ledger entry write +// int64 feeDiskReadLedgerEntry; // Fee per disk ledger entry read +// int64 feeWriteLedgerEntry; // Fee per ledger entry write // -// int64 feeRead1KB; // Fee for reading 1KB +// int64 feeDiskRead1KB; // Fee for reading 1KB disk // // // The following parameters determine the write fee per 1KB. -// // Write fee grows linearly until bucket list reaches this size -// int64 bucketListTargetSizeBytes; -// // Fee per 1KB write when the bucket list is empty -// int64 writeFee1KBBucketListLow; -// // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` -// int64 writeFee1KBBucketListHigh; -// // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` -// uint32 bucketListWriteFeeGrowthFactor; +// // Rent fee grows linearly until soroban state reaches this size +// int64 sorobanStateTargetSizeBytes; +// // Fee per 1KB rent when the soroban state is empty +// int64 rentFee1KBSorobanStateSizeLow; +// // Fee per 1KB rent when the soroban state has reached `sorobanStateTargetSizeBytes` +// int64 rentFee1KBSorobanStateSizeHigh; +// // Rent fee multiplier for any additional data past the first `sorobanStateTargetSizeBytes` +// uint32 sorobanStateRentFeeGrowthFactor; // }; // // =========================================================================== xdr.struct("ConfigSettingContractLedgerCostV0", [ - ["ledgerMaxReadLedgerEntries", xdr.lookup("Uint32")], - ["ledgerMaxReadBytes", xdr.lookup("Uint32")], + ["ledgerMaxDiskReadEntries", xdr.lookup("Uint32")], + ["ledgerMaxDiskReadBytes", xdr.lookup("Uint32")], ["ledgerMaxWriteLedgerEntries", xdr.lookup("Uint32")], ["ledgerMaxWriteBytes", xdr.lookup("Uint32")], - ["txMaxReadLedgerEntries", xdr.lookup("Uint32")], - ["txMaxReadBytes", xdr.lookup("Uint32")], + ["txMaxDiskReadEntries", xdr.lookup("Uint32")], + ["txMaxDiskReadBytes", xdr.lookup("Uint32")], ["txMaxWriteLedgerEntries", xdr.lookup("Uint32")], ["txMaxWriteBytes", xdr.lookup("Uint32")], - ["feeReadLedgerEntry", xdr.lookup("Int64")], + ["feeDiskReadLedgerEntry", xdr.lookup("Int64")], ["feeWriteLedgerEntry", xdr.lookup("Int64")], - ["feeRead1Kb", xdr.lookup("Int64")], - ["bucketListTargetSizeBytes", xdr.lookup("Int64")], - ["writeFee1KbBucketListLow", xdr.lookup("Int64")], - ["writeFee1KbBucketListHigh", xdr.lookup("Int64")], - ["bucketListWriteFeeGrowthFactor", xdr.lookup("Uint32")], + ["feeDiskRead1Kb", xdr.lookup("Int64")], + ["sorobanStateTargetSizeBytes", xdr.lookup("Int64")], + ["rentFee1KbSorobanStateSizeLow", xdr.lookup("Int64")], + ["rentFee1KbSorobanStateSizeHigh", xdr.lookup("Int64")], + ["sorobanStateRentFeeGrowthFactor", xdr.lookup("Uint32")], +]); + +// === xdr source ============================================================ +// +// struct ConfigSettingContractLedgerCostExtV0 +// { +// // Maximum number of RO+RW entries in the transaction footprint. +// uint32 txMaxFootprintEntries; +// // Fee per 1 KB of data written to the ledger. +// // Unlike the rent fee, this is a flat fee that is charged for any ledger +// // write, independent of the type of the entry being written. +// int64 feeWrite1KB; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingContractLedgerCostExtV0", [ + ["txMaxFootprintEntries", xdr.lookup("Uint32")], + ["feeWrite1Kb", xdr.lookup("Int64")], ]); // === xdr source ============================================================ @@ -10661,11 +10649,11 @@ xdr.struct("ContractCostParamEntry", [ // // max number of entries that emit archival meta in a single ledger // uint32 maxEntriesToArchive; // -// // Number of snapshots to use when calculating average BucketList size -// uint32 bucketListSizeWindowSampleSize; +// // Number of snapshots to use when calculating average live Soroban State size +// uint32 liveSorobanStateSizeWindowSampleSize; // -// // How often to sample the BucketList size for the average, in ledgers -// uint32 bucketListWindowSamplePeriod; +// // How often to sample the live Soroban State size for the average, in ledgers +// uint32 liveSorobanStateSizeWindowSamplePeriod; // // // Maximum number of bytes that we scan for eviction per ledger // uint32 evictionScanSize; @@ -10682,8 +10670,8 @@ xdr.struct("StateArchivalSettings", [ ["persistentRentRateDenominator", xdr.lookup("Int64")], ["tempRentRateDenominator", xdr.lookup("Int64")], ["maxEntriesToArchive", xdr.lookup("Uint32")], - ["bucketListSizeWindowSampleSize", xdr.lookup("Uint32")], - ["bucketListWindowSamplePeriod", xdr.lookup("Uint32")], + ["liveSorobanStateSizeWindowSampleSize", xdr.lookup("Uint32")], + ["liveSorobanStateSizeWindowSamplePeriod", xdr.lookup("Uint32")], ["evictionScanSize", xdr.lookup("Uint32")], ["startingEvictionScanLevel", xdr.lookup("Uint32")], ]); @@ -10703,6 +10691,25 @@ xdr.struct("EvictionIterator", [ ["bucketFileOffset", xdr.lookup("Uint64")], ]); +// === xdr source ============================================================ +// +// struct ConfigSettingSCPTiming { +// uint32 ledgerTargetCloseTimeMilliseconds; +// uint32 nominationTimeoutInitialMilliseconds; +// uint32 nominationTimeoutIncrementMilliseconds; +// uint32 ballotTimeoutInitialMilliseconds; +// uint32 ballotTimeoutIncrementMilliseconds; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingScpTiming", [ + ["ledgerTargetCloseTimeMilliseconds", xdr.lookup("Uint32")], + ["nominationTimeoutInitialMilliseconds", xdr.lookup("Uint32")], + ["nominationTimeoutIncrementMilliseconds", xdr.lookup("Uint32")], + ["ballotTimeoutInitialMilliseconds", xdr.lookup("Uint32")], + ["ballotTimeoutIncrementMilliseconds", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // const CONTRACT_COST_COUNT_LIMIT = 1024; @@ -10733,9 +10740,11 @@ xdr.typedef("ContractCostParams", xdr.varArray(xdr.lookup("ContractCostParamEntr // CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, // CONFIG_SETTING_STATE_ARCHIVAL = 10, // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, -// CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, +// CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW = 12, // CONFIG_SETTING_EVICTION_ITERATOR = 13, -// CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14 +// CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14, +// CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0 = 15, +// CONFIG_SETTING_SCP_TIMING = 16 // }; // // =========================================================================== @@ -10752,9 +10761,11 @@ xdr.enum("ConfigSettingId", { configSettingContractDataEntrySizeBytes: 9, configSettingStateArchival: 10, configSettingContractExecutionLanes: 11, - configSettingBucketlistSizeWindow: 12, + configSettingLiveSorobanStateSizeWindow: 12, configSettingEvictionIterator: 13, configSettingContractParallelComputeV0: 14, + configSettingContractLedgerCostExtV0: 15, + configSettingScpTiming: 16, }); // === xdr source ============================================================ @@ -10785,12 +10796,16 @@ xdr.enum("ConfigSettingId", { // StateArchivalSettings stateArchivalSettings; // case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: // ConfigSettingContractExecutionLanesV0 contractExecutionLanes; -// case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: -// uint64 bucketListSizeWindow<>; +// case CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW: +// uint64 liveSorobanStateSizeWindow<>; // case CONFIG_SETTING_EVICTION_ITERATOR: // EvictionIterator evictionIterator; // case CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0: // ConfigSettingContractParallelComputeV0 contractParallelCompute; +// case CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0: +// ConfigSettingContractLedgerCostExtV0 contractLedgerCostExt; +// case CONFIG_SETTING_SCP_TIMING: +// ConfigSettingSCPTiming contractSCPTiming; // }; // // =========================================================================== @@ -10810,9 +10825,11 @@ xdr.union("ConfigSettingEntry", { ["configSettingContractDataEntrySizeBytes", "contractDataEntrySizeBytes"], ["configSettingStateArchival", "stateArchivalSettings"], ["configSettingContractExecutionLanes", "contractExecutionLanes"], - ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], + ["configSettingLiveSorobanStateSizeWindow", "liveSorobanStateSizeWindow"], ["configSettingEvictionIterator", "evictionIterator"], ["configSettingContractParallelComputeV0", "contractParallelCompute"], + ["configSettingContractLedgerCostExtV0", "contractLedgerCostExt"], + ["configSettingScpTiming", "contractScpTiming"], ], arms: { contractMaxSizeBytes: xdr.lookup("Uint32"), @@ -10827,11 +10844,34 @@ xdr.union("ConfigSettingEntry", { contractDataEntrySizeBytes: xdr.lookup("Uint32"), stateArchivalSettings: xdr.lookup("StateArchivalSettings"), contractExecutionLanes: xdr.lookup("ConfigSettingContractExecutionLanesV0"), - bucketListSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), + liveSorobanStateSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), evictionIterator: xdr.lookup("EvictionIterator"), contractParallelCompute: xdr.lookup("ConfigSettingContractParallelComputeV0"), + contractLedgerCostExt: xdr.lookup("ConfigSettingContractLedgerCostExtV0"), + contractScpTiming: xdr.lookup("ConfigSettingScpTiming"), }, }); +// === xdr source ============================================================ +// +// struct LedgerCloseMetaBatch +// { +// // starting ledger sequence number in the batch +// uint32 startSequence; +// +// // ending ledger sequence number in the batch +// uint32 endSequence; +// +// // Ledger close meta for each ledger within the batch +// LedgerCloseMeta ledgerCloseMetas<>; +// }; +// +// =========================================================================== +xdr.struct("LedgerCloseMetaBatch", [ + ["startSequence", xdr.lookup("Uint32")], + ["endSequence", xdr.lookup("Uint32")], + ["ledgerCloseMeta", xdr.varArray(xdr.lookup("LedgerCloseMeta"), 2147483647)], +]); + }); export default types; diff --git a/src/sorobandata_builder.js b/src/sorobandata_builder.js index 14828d39..49183154 100644 --- a/src/sorobandata_builder.js +++ b/src/sorobandata_builder.js @@ -41,10 +41,10 @@ export class SorobanDataBuilder { resources: new xdr.SorobanResources({ footprint: new xdr.LedgerFootprint({ readOnly: [], readWrite: [] }), instructions: 0, - readBytes: 0, + diskReadBytes: 0, writeBytes: 0 }), - ext: new xdr.ExtensionPoint(0), + ext: new xdr.SorobanTransactionDataExt(0), resourceFee: new xdr.Int64(0) }); } else if ( @@ -88,14 +88,14 @@ export class SorobanDataBuilder { * by transaction simulation/preflight from a Soroban RPC server. * * @param {number} cpuInstrs number of CPU instructions - * @param {number} readBytes number of bytes being read - * @param {number} writeBytes number of bytes being written + * @param {number} diskReadBytes number of bytes being read from disk + * @param {number} writeBytes number of bytes being written to disk/memory * * @returns {SorobanDataBuilder} */ - setResources(cpuInstrs, readBytes, writeBytes) { + setResources(cpuInstrs, diskReadBytes, writeBytes) { this._data.resources().instructions(cpuInstrs); - this._data.resources().readBytes(readBytes); + this._data.resources().diskReadBytes(diskReadBytes); this._data.resources().writeBytes(writeBytes); return this; diff --git a/test/unit/sorobandata_builder_test.js b/test/unit/sorobandata_builder_test.js index aff86f6a..536891ad 100644 --- a/test/unit/sorobandata_builder_test.js +++ b/test/unit/sorobandata_builder_test.js @@ -6,11 +6,11 @@ describe('SorobanTransactionData can be built', function () { const c = new StellarBase.Contract(contractId); const sentinel = new xdr.SorobanTransactionData({ - ext: new xdr.ExtensionPoint(0), + ext: new xdr.SorobanTransactionDataExt(0), resources: new xdr.SorobanResources({ footprint: new xdr.LedgerFootprint({ readOnly: [], readWrite: [] }), instructions: 1, - readBytes: 2, + diskReadBytes: 2, writeBytes: 3 }), resourceFee: new xdr.Int64(5) diff --git a/types/curr.d.ts b/types/curr.d.ts index 00be76e4..897b1f20 100644 --- a/types/curr.d.ts +++ b/types/curr.d.ts @@ -49,7 +49,7 @@ export namespace xdr { * * @param items the key-value pairs to sort. * - * @warning This only performs "best-effort" sorting, working best when the + * @warning This only performs 'best-effort' sorting, working best when the * keys are all either numeric or string-like. */ function scvSortedMap(items: ScMapEntry[]): ScVal; @@ -436,14 +436,6 @@ export namespace xdr { static claimantTypeV0(): ClaimantType; } - class ClaimableBalanceIdType { - readonly name: 'claimableBalanceIdTypeV0'; - - readonly value: 0; - - static claimableBalanceIdTypeV0(): ClaimableBalanceIdType; - } - class ClaimableBalanceFlags { readonly name: 'claimableBalanceClawbackEnabledFlag'; @@ -499,15 +491,13 @@ export namespace xdr { } class BucketListType { - readonly name: 'live' | 'hotArchive' | 'coldArchive'; + readonly name: 'live' | 'hotArchive'; - readonly value: 0 | 1 | 2; + readonly value: 0 | 1; static live(): BucketListType; static hotArchive(): BucketListType; - - static coldArchive(): BucketListType; } class BucketEntryType { @@ -528,39 +518,15 @@ export namespace xdr { readonly name: | 'hotArchiveMetaentry' | 'hotArchiveArchived' - | 'hotArchiveLive' - | 'hotArchiveDeleted'; + | 'hotArchiveLive'; - readonly value: -1 | 0 | 1 | 2; + readonly value: -1 | 0 | 1; static hotArchiveMetaentry(): HotArchiveBucketEntryType; static hotArchiveArchived(): HotArchiveBucketEntryType; static hotArchiveLive(): HotArchiveBucketEntryType; - - static hotArchiveDeleted(): HotArchiveBucketEntryType; - } - - class ColdArchiveBucketEntryType { - readonly name: - | 'coldArchiveMetaentry' - | 'coldArchiveArchivedLeaf' - | 'coldArchiveDeletedLeaf' - | 'coldArchiveBoundaryLeaf' - | 'coldArchiveHash'; - - readonly value: -1 | 0 | 1 | 2 | 3; - - static coldArchiveMetaentry(): ColdArchiveBucketEntryType; - - static coldArchiveArchivedLeaf(): ColdArchiveBucketEntryType; - - static coldArchiveDeletedLeaf(): ColdArchiveBucketEntryType; - - static coldArchiveBoundaryLeaf(): ColdArchiveBucketEntryType; - - static coldArchiveHash(): ColdArchiveBucketEntryType; } class StellarValueType { @@ -628,9 +594,10 @@ export namespace xdr { | 'ledgerEntryCreated' | 'ledgerEntryUpdated' | 'ledgerEntryRemoved' - | 'ledgerEntryState'; + | 'ledgerEntryState' + | 'ledgerEntryRestored'; - readonly value: 0 | 1 | 2 | 3; + readonly value: 0 | 1 | 2 | 3 | 4; static ledgerEntryCreated(): LedgerEntryChangeType; @@ -639,6 +606,8 @@ export namespace xdr { static ledgerEntryRemoved(): LedgerEntryChangeType; static ledgerEntryState(): LedgerEntryChangeType; + + static ledgerEntryRestored(): LedgerEntryChangeType; } class ContractEventType { @@ -653,6 +622,21 @@ export namespace xdr { static diagnostic(): ContractEventType; } + class TransactionEventStage { + readonly name: + | 'transactionEventStageBeforeAllTxes' + | 'transactionEventStageAfterTx' + | 'transactionEventStageAfterAllTxes'; + + readonly value: 0 | 1 | 2; + + static transactionEventStageBeforeAllTxes(): TransactionEventStage; + + static transactionEventStageAfterTx(): TransactionEventStage; + + static transactionEventStageAfterAllTxes(): TransactionEventStage; + } + class ErrorCode { readonly name: 'errMisc' | 'errData' | 'errConf' | 'errAuth' | 'errLoad'; @@ -684,7 +668,6 @@ export namespace xdr { | 'errorMsg' | 'auth' | 'dontHave' - | 'getPeers' | 'peers' | 'getTxSet' | 'txSet' @@ -695,8 +678,6 @@ export namespace xdr { | 'scpMessage' | 'getScpState' | 'hello' - | 'surveyRequest' - | 'surveyResponse' | 'sendMore' | 'sendMoreExtended' | 'floodAdvert' @@ -710,7 +691,6 @@ export namespace xdr { | 0 | 2 | 3 - | 4 | 5 | 6 | 7 @@ -721,8 +701,6 @@ export namespace xdr { | 11 | 12 | 13 - | 14 - | 15 | 16 | 20 | 18 @@ -738,8 +716,6 @@ export namespace xdr { static dontHave(): MessageType; - static getPeers(): MessageType; - static peers(): MessageType; static getTxSet(): MessageType; @@ -760,10 +736,6 @@ export namespace xdr { static hello(): MessageType; - static surveyRequest(): MessageType; - - static surveyResponse(): MessageType; - static sendMore(): MessageType; static sendMoreExtended(): MessageType; @@ -782,26 +754,17 @@ export namespace xdr { } class SurveyMessageCommandType { - readonly name: 'surveyTopology' | 'timeSlicedSurveyTopology'; - - readonly value: 0 | 1; + readonly name: 'timeSlicedSurveyTopology'; - static surveyTopology(): SurveyMessageCommandType; + readonly value: 1; static timeSlicedSurveyTopology(): SurveyMessageCommandType; } class SurveyMessageResponseType { - readonly name: - | 'surveyTopologyResponseV0' - | 'surveyTopologyResponseV1' - | 'surveyTopologyResponseV2'; - - readonly value: 0 | 1 | 2; - - static surveyTopologyResponseV0(): SurveyMessageResponseType; + readonly name: 'surveyTopologyResponseV2'; - static surveyTopologyResponseV1(): SurveyMessageResponseType; + readonly value: 2; static surveyTopologyResponseV2(): SurveyMessageResponseType; } @@ -1020,16 +983,6 @@ export namespace xdr { static precondV2(): PreconditionType; } - class ArchivalProofType { - readonly name: 'existence' | 'nonexistence'; - - readonly value: 0 | 1; - - static existence(): ArchivalProofType; - - static nonexistence(): ArchivalProofType; - } - class ClaimAtomType { readonly name: | 'claimAtomTypeV0' @@ -1969,6 +1922,14 @@ export namespace xdr { static binaryFuseFilter32Bit(): BinaryFuseFilterType; } + class ClaimableBalanceIdType { + readonly name: 'claimableBalanceIdTypeV0'; + + readonly value: 0; + + static claimableBalanceIdTypeV0(): ClaimableBalanceIdType; + } + class ScValType { readonly name: | 'scvBool' @@ -2146,13 +2107,24 @@ export namespace xdr { } class ScAddressType { - readonly name: 'scAddressTypeAccount' | 'scAddressTypeContract'; + readonly name: + | 'scAddressTypeAccount' + | 'scAddressTypeContract' + | 'scAddressTypeMuxedAccount' + | 'scAddressTypeClaimableBalance' + | 'scAddressTypeLiquidityPool'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2 | 3 | 4; static scAddressTypeAccount(): ScAddressType; static scAddressTypeContract(): ScAddressType; + + static scAddressTypeMuxedAccount(): ScAddressType; + + static scAddressTypeClaimableBalance(): ScAddressType; + + static scAddressTypeLiquidityPool(): ScAddressType; } class ScEnvMetaKind { @@ -2191,6 +2163,7 @@ export namespace xdr { | 'scSpecTypeString' | 'scSpecTypeSymbol' | 'scSpecTypeAddress' + | 'scSpecTypeMuxedAddress' | 'scSpecTypeOption' | 'scSpecTypeResult' | 'scSpecTypeVec' @@ -2218,6 +2191,7 @@ export namespace xdr { | 16 | 17 | 19 + | 20 | 1000 | 1001 | 1002 @@ -2262,6 +2236,8 @@ export namespace xdr { static scSpecTypeAddress(): ScSpecType; + static scSpecTypeMuxedAddress(): ScSpecType; + static scSpecTypeOption(): ScSpecType; static scSpecTypeResult(): ScSpecType; @@ -2287,15 +2263,43 @@ export namespace xdr { static scSpecUdtUnionCaseTupleV0(): ScSpecUdtUnionCaseV0Kind; } + class ScSpecEventParamLocationV0 { + readonly name: + | 'scSpecEventParamLocationData' + | 'scSpecEventParamLocationTopicList'; + + readonly value: 0 | 1; + + static scSpecEventParamLocationData(): ScSpecEventParamLocationV0; + + static scSpecEventParamLocationTopicList(): ScSpecEventParamLocationV0; + } + + class ScSpecEventDataFormat { + readonly name: + | 'scSpecEventDataFormatSingleValue' + | 'scSpecEventDataFormatVec' + | 'scSpecEventDataFormatMap'; + + readonly value: 0 | 1 | 2; + + static scSpecEventDataFormatSingleValue(): ScSpecEventDataFormat; + + static scSpecEventDataFormatVec(): ScSpecEventDataFormat; + + static scSpecEventDataFormatMap(): ScSpecEventDataFormat; + } + class ScSpecEntryKind { readonly name: | 'scSpecEntryFunctionV0' | 'scSpecEntryUdtStructV0' | 'scSpecEntryUdtUnionV0' | 'scSpecEntryUdtEnumV0' - | 'scSpecEntryUdtErrorEnumV0'; + | 'scSpecEntryUdtErrorEnumV0' + | 'scSpecEntryEventV0'; - readonly value: 0 | 1 | 2 | 3 | 4; + readonly value: 0 | 1 | 2 | 3 | 4 | 5; static scSpecEntryFunctionV0(): ScSpecEntryKind; @@ -2306,6 +2310,8 @@ export namespace xdr { static scSpecEntryUdtEnumV0(): ScSpecEntryKind; static scSpecEntryUdtErrorEnumV0(): ScSpecEntryKind; + + static scSpecEntryEventV0(): ScSpecEntryKind; } class ContractCostType { @@ -2608,10 +2614,30 @@ export namespace xdr { | 'configSettingContractDataEntrySizeBytes' | 'configSettingStateArchival' | 'configSettingContractExecutionLanes' - | 'configSettingBucketlistSizeWindow' - | 'configSettingEvictionIterator'; + | 'configSettingLiveSorobanStateSizeWindow' + | 'configSettingEvictionIterator' + | 'configSettingContractParallelComputeV0' + | 'configSettingContractLedgerCostExtV0' + | 'configSettingScpTiming'; - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; + readonly value: + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16; static configSettingContractMaxSizeBytes(): ConfigSettingId; @@ -2637,9 +2663,15 @@ export namespace xdr { static configSettingContractExecutionLanes(): ConfigSettingId; - static configSettingBucketlistSizeWindow(): ConfigSettingId; + static configSettingLiveSorobanStateSizeWindow(): ConfigSettingId; static configSettingEvictionIterator(): ConfigSettingId; + + static configSettingContractParallelComputeV0(): ConfigSettingId; + + static configSettingContractLedgerCostExtV0(): ConfigSettingId; + + static configSettingScpTiming(): ConfigSettingId; } const Value: VarOpaque; @@ -2654,8 +2686,6 @@ export namespace xdr { const DataValue: VarOpaque; - type PoolId = Hash; - const AssetCode4: Opaque; const AssetCode12: Opaque; @@ -2664,13 +2694,13 @@ export namespace xdr { const UpgradeType: VarOpaque; - const LedgerEntryChanges: XDRArray; + const DependentTxCluster: XDRArray; - const DiagnosticEvents: XDRArray; + const ParallelTxExecutionStage: XDRArray; - const EncryptedBody: VarOpaque; + const LedgerEntryChanges: XDRArray; - const PeerStatList: XDRArray; + const EncryptedBody: VarOpaque; const TimeSlicedPeerDataList: XDRArray; @@ -2678,7 +2708,7 @@ export namespace xdr { const TxDemandVector: XDRArray; - const ProofLevel: XDRArray; + const SorobanAuthorizationEntries: XDRArray; const Hash: Opaque; @@ -2704,6 +2734,10 @@ export namespace xdr { type AccountId = PublicKey; + type ContractId = Hash; + + type PoolId = Hash; + const ScVec: XDRArray; const ScMap: XDRArray; @@ -4318,132 +4352,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ColdArchiveArchivedLeaf { - constructor(attributes: { index: number; archivedEntry: LedgerEntry }); - - index(value?: number): number; - - archivedEntry(value?: LedgerEntry): LedgerEntry; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveArchivedLeaf; - - static write(value: ColdArchiveArchivedLeaf, io: Buffer): void; - - static isValid(value: ColdArchiveArchivedLeaf): boolean; - - static toXDR(value: ColdArchiveArchivedLeaf): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveArchivedLeaf; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveArchivedLeaf; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ColdArchiveDeletedLeaf { - constructor(attributes: { index: number; deletedKey: LedgerKey }); - - index(value?: number): number; - - deletedKey(value?: LedgerKey): LedgerKey; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveDeletedLeaf; - - static write(value: ColdArchiveDeletedLeaf, io: Buffer): void; - - static isValid(value: ColdArchiveDeletedLeaf): boolean; - - static toXDR(value: ColdArchiveDeletedLeaf): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveDeletedLeaf; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveDeletedLeaf; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ColdArchiveBoundaryLeaf { - constructor(attributes: { index: number; isLowerBound: boolean }); - - index(value?: number): number; - - isLowerBound(value?: boolean): boolean; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveBoundaryLeaf; - - static write(value: ColdArchiveBoundaryLeaf, io: Buffer): void; - - static isValid(value: ColdArchiveBoundaryLeaf): boolean; - - static toXDR(value: ColdArchiveBoundaryLeaf): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveBoundaryLeaf; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveBoundaryLeaf; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ColdArchiveHashEntry { - constructor(attributes: { index: number; level: number; hash: Buffer }); - - index(value?: number): number; - - level(value?: number): number; - - hash(value?: Buffer): Buffer; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveHashEntry; - - static write(value: ColdArchiveHashEntry, io: Buffer): void; - - static isValid(value: ColdArchiveHashEntry): boolean; - - static toXDR(value: ColdArchiveHashEntry): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveHashEntry; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveHashEntry; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class LedgerCloseValueSignature { constructor(attributes: { nodeId: NodeId; signature: Buffer }); @@ -4614,9 +4522,9 @@ export namespace xdr { } class ConfigUpgradeSetKey { - constructor(attributes: { contractId: Buffer; contentHash: Buffer }); + constructor(attributes: { contractId: ContractId; contentHash: Buffer }); - contractId(value?: Buffer): Buffer; + contractId(value?: ContractId): ContractId; contentHash(value?: Buffer): Buffer; @@ -4670,6 +4578,42 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ParallelTxsComponent { + constructor(attributes: { + baseFee: null | Int64; + executionStages: TransactionEnvelope[][][]; + }); + + baseFee(value?: null | Int64): null | Int64; + + executionStages( + value?: TransactionEnvelope[][][], + ): TransactionEnvelope[][][]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ParallelTxsComponent; + + static write(value: ParallelTxsComponent, io: Buffer): void; + + static isValid(value: ParallelTxsComponent): boolean; + + static toXDR(value: ParallelTxsComponent): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ParallelTxsComponent; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ParallelTxsComponent; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class TxSetComponentTxsMaybeDiscountedFee { constructor(attributes: { baseFee: null | Int64; @@ -5129,14 +5073,14 @@ export namespace xdr { class ContractEvent { constructor(attributes: { ext: ExtensionPoint; - contractId: null | Buffer; + contractId: null | ContractId; type: ContractEventType; body: ContractEventBody; }); ext(value?: ExtensionPoint): ExtensionPoint; - contractId(value?: null | Buffer): null | Buffer; + contractId(value?: null | ContractId): null | ContractId; type(value?: ContractEventType): ContractEventType; @@ -5316,10 +5260,16 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InvokeHostFunctionSuccessPreImage { - constructor(attributes: { returnValue: ScVal; events: ContractEvent[] }); + class OperationMetaV2 { + constructor(attributes: { + ext: ExtensionPoint; + changes: LedgerEntryChange[]; + events: ContractEvent[]; + }); - returnValue(value?: ScVal): ScVal; + ext(value?: ExtensionPoint): ExtensionPoint; + + changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; events(value?: ContractEvent[]): ContractEvent[]; @@ -5327,37 +5277,178 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): InvokeHostFunctionSuccessPreImage; + static read(io: Buffer): OperationMetaV2; - static write(value: InvokeHostFunctionSuccessPreImage, io: Buffer): void; + static write(value: OperationMetaV2, io: Buffer): void; - static isValid(value: InvokeHostFunctionSuccessPreImage): boolean; + static isValid(value: OperationMetaV2): boolean; - static toXDR(value: InvokeHostFunctionSuccessPreImage): Buffer; + static toXDR(value: OperationMetaV2): Buffer; - static fromXDR( - input: Buffer, - format?: 'raw', - ): InvokeHostFunctionSuccessPreImage; + static fromXDR(input: Buffer, format?: 'raw'): OperationMetaV2; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): InvokeHostFunctionSuccessPreImage; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationMetaV2; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultMeta { + class SorobanTransactionMetaV2 { constructor(attributes: { - result: TransactionResultPair; - feeProcessing: LedgerEntryChange[]; - txApplyProcessing: TransactionMeta; + ext: SorobanTransactionMetaExt; + returnValue: null | ScVal; }); - result(value?: TransactionResultPair): TransactionResultPair; + ext(value?: SorobanTransactionMetaExt): SorobanTransactionMetaExt; + + returnValue(value?: null | ScVal): null | ScVal; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanTransactionMetaV2; + + static write(value: SorobanTransactionMetaV2, io: Buffer): void; + + static isValid(value: SorobanTransactionMetaV2): boolean; + + static toXDR(value: SorobanTransactionMetaV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionMetaV2; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionMetaV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionEvent { + constructor(attributes: { + stage: TransactionEventStage; + event: ContractEvent; + }); + + stage(value?: TransactionEventStage): TransactionEventStage; + + event(value?: ContractEvent): ContractEvent; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionEvent; + + static write(value: TransactionEvent, io: Buffer): void; + + static isValid(value: TransactionEvent): boolean; + + static toXDR(value: TransactionEvent): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionEvent; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionEvent; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionMetaV4 { + constructor(attributes: { + ext: ExtensionPoint; + txChangesBefore: LedgerEntryChange[]; + operations: OperationMetaV2[]; + txChangesAfter: LedgerEntryChange[]; + sorobanMeta: null | SorobanTransactionMetaV2; + events: TransactionEvent[]; + diagnosticEvents: DiagnosticEvent[]; + }); + + ext(value?: ExtensionPoint): ExtensionPoint; + + txChangesBefore(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + operations(value?: OperationMetaV2[]): OperationMetaV2[]; + + txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + sorobanMeta( + value?: null | SorobanTransactionMetaV2, + ): null | SorobanTransactionMetaV2; + + events(value?: TransactionEvent[]): TransactionEvent[]; + + diagnosticEvents(value?: DiagnosticEvent[]): DiagnosticEvent[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionMetaV4; + + static write(value: TransactionMetaV4, io: Buffer): void; + + static isValid(value: TransactionMetaV4): boolean; + + static toXDR(value: TransactionMetaV4): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV4; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV4; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class InvokeHostFunctionSuccessPreImage { + constructor(attributes: { returnValue: ScVal; events: ContractEvent[] }); + + returnValue(value?: ScVal): ScVal; + + events(value?: ContractEvent[]): ContractEvent[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): InvokeHostFunctionSuccessPreImage; + + static write(value: InvokeHostFunctionSuccessPreImage, io: Buffer): void; + + static isValid(value: InvokeHostFunctionSuccessPreImage): boolean; + + static toXDR(value: InvokeHostFunctionSuccessPreImage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): InvokeHostFunctionSuccessPreImage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): InvokeHostFunctionSuccessPreImage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionResultMeta { + constructor(attributes: { + result: TransactionResultPair; + feeProcessing: LedgerEntryChange[]; + txApplyProcessing: TransactionMeta; + }); + + result(value?: TransactionResultPair): TransactionResultPair; feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; @@ -5387,6 +5478,49 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TransactionResultMetaV1 { + constructor(attributes: { + ext: ExtensionPoint; + result: TransactionResultPair; + feeProcessing: LedgerEntryChange[]; + txApplyProcessing: TransactionMeta; + postTxApplyFeeProcessing: LedgerEntryChange[]; + }); + + ext(value?: ExtensionPoint): ExtensionPoint; + + result(value?: TransactionResultPair): TransactionResultPair; + + feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + txApplyProcessing(value?: TransactionMeta): TransactionMeta; + + postTxApplyFeeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionResultMetaV1; + + static write(value: TransactionResultMetaV1, io: Buffer): void; + + static isValid(value: TransactionResultMetaV1): boolean; + + static toXDR(value: TransactionResultMetaV1): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultMetaV1; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionResultMetaV1; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class UpgradeEntryMeta { constructor(attributes: { upgrade: LedgerUpgrade; @@ -5497,9 +5631,9 @@ export namespace xdr { txProcessing: TransactionResultMeta[]; upgradesProcessing: UpgradeEntryMeta[]; scpInfo: ScpHistoryEntry[]; - totalByteSizeOfBucketList: Uint64; - evictedTemporaryLedgerKeys: LedgerKey[]; - evictedPersistentLedgerEntries: LedgerEntry[]; + totalByteSizeOfLiveSorobanState: Uint64; + evictedKeys: LedgerKey[]; + unused: LedgerEntry[]; }); ext(value?: LedgerCloseMetaExt): LedgerCloseMetaExt; @@ -5514,11 +5648,11 @@ export namespace xdr { scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - totalByteSizeOfBucketList(value?: Uint64): Uint64; + totalByteSizeOfLiveSorobanState(value?: Uint64): Uint64; - evictedTemporaryLedgerKeys(value?: LedgerKey[]): LedgerKey[]; + evictedKeys(value?: LedgerKey[]): LedgerKey[]; - evictedPersistentLedgerEntries(value?: LedgerEntry[]): LedgerEntry[]; + unused(value?: LedgerEntry[]): LedgerEntry[]; toXDR(format?: 'raw'): Buffer; @@ -5541,6 +5675,55 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class LedgerCloseMetaV2 { + constructor(attributes: { + ext: LedgerCloseMetaExt; + ledgerHeader: LedgerHeaderHistoryEntry; + txSet: GeneralizedTransactionSet; + txProcessing: TransactionResultMetaV1[]; + upgradesProcessing: UpgradeEntryMeta[]; + scpInfo: ScpHistoryEntry[]; + totalByteSizeOfLiveSorobanState: Uint64; + evictedKeys: LedgerKey[]; + }); + + ext(value?: LedgerCloseMetaExt): LedgerCloseMetaExt; + + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; + + txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; + + txProcessing(value?: TransactionResultMetaV1[]): TransactionResultMetaV1[]; + + upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; + + scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; + + totalByteSizeOfLiveSorobanState(value?: Uint64): Uint64; + + evictedKeys(value?: LedgerKey[]): LedgerKey[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerCloseMetaV2; + + static write(value: LedgerCloseMetaV2, io: Buffer): void; + + static isValid(value: LedgerCloseMetaV2): boolean; + + static toXDR(value: LedgerCloseMetaV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV2; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class Error { constructor(attributes: { code: ErrorCode; msg: string | Buffer }); @@ -6055,40 +6238,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignedSurveyRequestMessage { - constructor(attributes: { - requestSignature: Buffer; - request: SurveyRequestMessage; - }); - - requestSignature(value?: Buffer): Buffer; - - request(value?: SurveyRequestMessage): SurveyRequestMessage; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): SignedSurveyRequestMessage; - - static write(value: SignedSurveyRequestMessage, io: Buffer): void; - - static isValid(value: SignedSurveyRequestMessage): boolean; - - static toXDR(value: SignedSurveyRequestMessage): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyRequestMessage; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): SignedSurveyRequestMessage; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class SignedTimeSlicedSurveyRequestMessage { constructor(attributes: { requestSignature: Buffer; @@ -6205,40 +6354,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignedSurveyResponseMessage { - constructor(attributes: { - responseSignature: Buffer; - response: SurveyResponseMessage; - }); - - responseSignature(value?: Buffer): Buffer; - - response(value?: SurveyResponseMessage): SurveyResponseMessage; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): SignedSurveyResponseMessage; - - static write(value: SignedSurveyResponseMessage, io: Buffer): void; - - static isValid(value: SignedSurveyResponseMessage): boolean; - - static toXDR(value: SignedSurveyResponseMessage): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyResponseMessage; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): SignedSurveyResponseMessage; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class SignedTimeSlicedSurveyResponseMessage { constructor(attributes: { responseSignature: Buffer; @@ -6434,92 +6549,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TopologyResponseBodyV0 { - constructor(attributes: { - inboundPeers: PeerStats[]; - outboundPeers: PeerStats[]; - totalInboundPeerCount: number; - totalOutboundPeerCount: number; - }); - - inboundPeers(value?: PeerStats[]): PeerStats[]; - - outboundPeers(value?: PeerStats[]): PeerStats[]; - - totalInboundPeerCount(value?: number): number; - - totalOutboundPeerCount(value?: number): number; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): TopologyResponseBodyV0; - - static write(value: TopologyResponseBodyV0, io: Buffer): void; - - static isValid(value: TopologyResponseBodyV0): boolean; - - static toXDR(value: TopologyResponseBodyV0): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV0; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): TopologyResponseBodyV0; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class TopologyResponseBodyV1 { - constructor(attributes: { - inboundPeers: PeerStats[]; - outboundPeers: PeerStats[]; - totalInboundPeerCount: number; - totalOutboundPeerCount: number; - maxInboundPeerCount: number; - maxOutboundPeerCount: number; - }); - - inboundPeers(value?: PeerStats[]): PeerStats[]; - - outboundPeers(value?: PeerStats[]): PeerStats[]; - - totalInboundPeerCount(value?: number): number; - - totalOutboundPeerCount(value?: number): number; - - maxInboundPeerCount(value?: number): number; - - maxOutboundPeerCount(value?: number): number; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): TopologyResponseBodyV1; - - static write(value: TopologyResponseBodyV1, io: Buffer): void; - - static isValid(value: TopologyResponseBodyV1): boolean; - - static toXDR(value: TopologyResponseBodyV1): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV1; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): TopologyResponseBodyV1; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class TopologyResponseBodyV2 { constructor(attributes: { inboundPeers: TimeSlicedPeerData[]; @@ -8090,166 +8119,66 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ArchivalProofNode { - constructor(attributes: { index: number; hash: Buffer }); - - index(value?: number): number; - - hash(value?: Buffer): Buffer; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ArchivalProofNode; - - static write(value: ArchivalProofNode, io: Buffer): void; - - static isValid(value: ArchivalProofNode): boolean; - - static toXDR(value: ArchivalProofNode): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ArchivalProofNode; - - static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProofNode; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class NonexistenceProofBody { - constructor(attributes: { - entriesToProve: ColdArchiveBucketEntry[]; - proofLevels: ArchivalProofNode[][]; - }); - - entriesToProve(value?: ColdArchiveBucketEntry[]): ColdArchiveBucketEntry[]; - - proofLevels(value?: ArchivalProofNode[][]): ArchivalProofNode[][]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): NonexistenceProofBody; - - static write(value: NonexistenceProofBody, io: Buffer): void; - - static isValid(value: NonexistenceProofBody): boolean; - - static toXDR(value: NonexistenceProofBody): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): NonexistenceProofBody; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): NonexistenceProofBody; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ExistenceProofBody { + class SorobanResources { constructor(attributes: { - keysToProve: LedgerKey[]; - lowBoundEntries: ColdArchiveBucketEntry[]; - highBoundEntries: ColdArchiveBucketEntry[]; - proofLevels: ArchivalProofNode[][]; + footprint: LedgerFootprint; + instructions: number; + diskReadBytes: number; + writeBytes: number; }); - keysToProve(value?: LedgerKey[]): LedgerKey[]; - - lowBoundEntries(value?: ColdArchiveBucketEntry[]): ColdArchiveBucketEntry[]; - - highBoundEntries( - value?: ColdArchiveBucketEntry[], - ): ColdArchiveBucketEntry[]; - - proofLevels(value?: ArchivalProofNode[][]): ArchivalProofNode[][]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ExistenceProofBody; - - static write(value: ExistenceProofBody, io: Buffer): void; - - static isValid(value: ExistenceProofBody): boolean; - - static toXDR(value: ExistenceProofBody): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ExistenceProofBody; - - static fromXDR(input: string, format: 'hex' | 'base64'): ExistenceProofBody; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } + footprint(value?: LedgerFootprint): LedgerFootprint; - class ArchivalProof { - constructor(attributes: { epoch: number; body: ArchivalProofBody }); + instructions(value?: number): number; - epoch(value?: number): number; + diskReadBytes(value?: number): number; - body(value?: ArchivalProofBody): ArchivalProofBody; + writeBytes(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ArchivalProof; + static read(io: Buffer): SorobanResources; - static write(value: ArchivalProof, io: Buffer): void; + static write(value: SorobanResources, io: Buffer): void; - static isValid(value: ArchivalProof): boolean; + static isValid(value: SorobanResources): boolean; - static toXDR(value: ArchivalProof): Buffer; + static toXDR(value: SorobanResources): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ArchivalProof; + static fromXDR(input: Buffer, format?: 'raw'): SorobanResources; - static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProof; + static fromXDR(input: string, format: 'hex' | 'base64'): SorobanResources; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SorobanResources { - constructor(attributes: { - footprint: LedgerFootprint; - instructions: number; - readBytes: number; - writeBytes: number; - }); - - footprint(value?: LedgerFootprint): LedgerFootprint; + class SorobanResourcesExtV0 { + constructor(attributes: { archivedSorobanEntries: number[] }); - instructions(value?: number): number; - - readBytes(value?: number): number; - - writeBytes(value?: number): number; + archivedSorobanEntries(value?: number[]): number[]; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SorobanResources; + static read(io: Buffer): SorobanResourcesExtV0; - static write(value: SorobanResources, io: Buffer): void; + static write(value: SorobanResourcesExtV0, io: Buffer): void; - static isValid(value: SorobanResources): boolean; + static isValid(value: SorobanResourcesExtV0): boolean; - static toXDR(value: SorobanResources): Buffer; + static toXDR(value: SorobanResourcesExtV0): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): SorobanResources; + static fromXDR(input: Buffer, format?: 'raw'): SorobanResourcesExtV0; - static fromXDR(input: string, format: 'hex' | 'base64'): SorobanResources; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanResourcesExtV0; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -8258,12 +8187,12 @@ export namespace xdr { class SorobanTransactionData { constructor(attributes: { - ext: ExtensionPoint; + ext: SorobanTransactionDataExt; resources: SorobanResources; resourceFee: Int64; }); - ext(value?: ExtensionPoint): ExtensionPoint; + ext(value?: SorobanTransactionDataExt): SorobanTransactionDataExt; resources(value?: SorobanResources): SorobanResources; @@ -9310,6 +9239,37 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class MuxedEd25519Account { + constructor(attributes: { id: Uint64; ed25519: Buffer }); + + id(value?: Uint64): Uint64; + + ed25519(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): MuxedEd25519Account; + + static write(value: MuxedEd25519Account, io: Buffer): void; + + static isValid(value: MuxedEd25519Account): boolean; + + static toXDR(value: MuxedEd25519Account): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): MuxedEd25519Account; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): MuxedEd25519Account; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScNonceKey { constructor(attributes: { nonce: Int64 }); @@ -10038,15 +9998,95 @@ export namespace xdr { static read(io: Buffer): ScSpecFunctionV0; - static write(value: ScSpecFunctionV0, io: Buffer): void; + static write(value: ScSpecFunctionV0, io: Buffer): void; + + static isValid(value: ScSpecFunctionV0): boolean; + + static toXDR(value: ScSpecFunctionV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecFunctionV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecEventParamV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef; + location: ScSpecEventParamLocationV0; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef): ScSpecTypeDef; + + location(value?: ScSpecEventParamLocationV0): ScSpecEventParamLocationV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecEventParamV0; + + static write(value: ScSpecEventParamV0, io: Buffer): void; + + static isValid(value: ScSpecEventParamV0): boolean; + + static toXDR(value: ScSpecEventParamV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecEventParamV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecEventParamV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecEventV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + prefixTopics: Array; + params: ScSpecEventParamV0[]; + dataFormat: ScSpecEventDataFormat; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + prefixTopics(value?: Array): Array; + + params(value?: ScSpecEventParamV0[]): ScSpecEventParamV0[]; + + dataFormat(value?: ScSpecEventDataFormat): ScSpecEventDataFormat; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecEventV0; + + static write(value: ScSpecEventV0, io: Buffer): void; - static isValid(value: ScSpecFunctionV0): boolean; + static isValid(value: ScSpecEventV0): boolean; - static toXDR(value: ScSpecFunctionV0): Buffer; + static toXDR(value: ScSpecEventV0): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionV0; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecEventV0; - static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecFunctionV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecEventV0; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -10131,54 +10171,89 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ConfigSettingContractParallelComputeV0 { + constructor(attributes: { ledgerMaxDependentTxClusters: number }); + + ledgerMaxDependentTxClusters(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractParallelComputeV0; + + static write( + value: ConfigSettingContractParallelComputeV0, + io: Buffer, + ): void; + + static isValid(value: ConfigSettingContractParallelComputeV0): boolean; + + static toXDR(value: ConfigSettingContractParallelComputeV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractParallelComputeV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractParallelComputeV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ConfigSettingContractLedgerCostV0 { constructor(attributes: { - ledgerMaxReadLedgerEntries: number; - ledgerMaxReadBytes: number; + ledgerMaxDiskReadEntries: number; + ledgerMaxDiskReadBytes: number; ledgerMaxWriteLedgerEntries: number; ledgerMaxWriteBytes: number; - txMaxReadLedgerEntries: number; - txMaxReadBytes: number; + txMaxDiskReadEntries: number; + txMaxDiskReadBytes: number; txMaxWriteLedgerEntries: number; txMaxWriteBytes: number; - feeReadLedgerEntry: Int64; + feeDiskReadLedgerEntry: Int64; feeWriteLedgerEntry: Int64; - feeRead1Kb: Int64; - bucketListTargetSizeBytes: Int64; - writeFee1KbBucketListLow: Int64; - writeFee1KbBucketListHigh: Int64; - bucketListWriteFeeGrowthFactor: number; + feeDiskRead1Kb: Int64; + sorobanStateTargetSizeBytes: Int64; + rentFee1KbSorobanStateSizeLow: Int64; + rentFee1KbSorobanStateSizeHigh: Int64; + sorobanStateRentFeeGrowthFactor: number; }); - ledgerMaxReadLedgerEntries(value?: number): number; + ledgerMaxDiskReadEntries(value?: number): number; - ledgerMaxReadBytes(value?: number): number; + ledgerMaxDiskReadBytes(value?: number): number; ledgerMaxWriteLedgerEntries(value?: number): number; ledgerMaxWriteBytes(value?: number): number; - txMaxReadLedgerEntries(value?: number): number; + txMaxDiskReadEntries(value?: number): number; - txMaxReadBytes(value?: number): number; + txMaxDiskReadBytes(value?: number): number; txMaxWriteLedgerEntries(value?: number): number; txMaxWriteBytes(value?: number): number; - feeReadLedgerEntry(value?: Int64): Int64; + feeDiskReadLedgerEntry(value?: Int64): Int64; feeWriteLedgerEntry(value?: Int64): Int64; - feeRead1Kb(value?: Int64): Int64; + feeDiskRead1Kb(value?: Int64): Int64; - bucketListTargetSizeBytes(value?: Int64): Int64; + sorobanStateTargetSizeBytes(value?: Int64): Int64; - writeFee1KbBucketListLow(value?: Int64): Int64; + rentFee1KbSorobanStateSizeLow(value?: Int64): Int64; - writeFee1KbBucketListHigh(value?: Int64): Int64; + rentFee1KbSorobanStateSizeHigh(value?: Int64): Int64; - bucketListWriteFeeGrowthFactor(value?: number): number; + sorobanStateRentFeeGrowthFactor(value?: number): number; toXDR(format?: 'raw'): Buffer; @@ -10207,6 +10282,43 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ConfigSettingContractLedgerCostExtV0 { + constructor(attributes: { + txMaxFootprintEntries: number; + feeWrite1Kb: Int64; + }); + + txMaxFootprintEntries(value?: number): number; + + feeWrite1Kb(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractLedgerCostExtV0; + + static write(value: ConfigSettingContractLedgerCostExtV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractLedgerCostExtV0): boolean; + + static toXDR(value: ConfigSettingContractLedgerCostExtV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractLedgerCostExtV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractLedgerCostExtV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ConfigSettingContractHistoricalDataV0 { constructor(attributes: { feeHistorical1Kb: Int64 }); @@ -10364,8 +10476,8 @@ export namespace xdr { persistentRentRateDenominator: Int64; tempRentRateDenominator: Int64; maxEntriesToArchive: number; - bucketListSizeWindowSampleSize: number; - bucketListWindowSamplePeriod: number; + liveSorobanStateSizeWindowSampleSize: number; + liveSorobanStateSizeWindowSamplePeriod: number; evictionScanSize: number; startingEvictionScanLevel: number; }); @@ -10382,9 +10494,9 @@ export namespace xdr { maxEntriesToArchive(value?: number): number; - bucketListSizeWindowSampleSize(value?: number): number; + liveSorobanStateSizeWindowSampleSize(value?: number): number; - bucketListWindowSamplePeriod(value?: number): number; + liveSorobanStateSizeWindowSamplePeriod(value?: number): number; evictionScanSize(value?: number): number; @@ -10448,6 +10560,86 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ConfigSettingScpTiming { + constructor(attributes: { + ledgerTargetCloseTimeMilliseconds: number; + nominationTimeoutInitialMilliseconds: number; + nominationTimeoutIncrementMilliseconds: number; + ballotTimeoutInitialMilliseconds: number; + ballotTimeoutIncrementMilliseconds: number; + }); + + ledgerTargetCloseTimeMilliseconds(value?: number): number; + + nominationTimeoutInitialMilliseconds(value?: number): number; + + nominationTimeoutIncrementMilliseconds(value?: number): number; + + ballotTimeoutInitialMilliseconds(value?: number): number; + + ballotTimeoutIncrementMilliseconds(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingScpTiming; + + static write(value: ConfigSettingScpTiming, io: Buffer): void; + + static isValid(value: ConfigSettingScpTiming): boolean; + + static toXDR(value: ConfigSettingScpTiming): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ConfigSettingScpTiming; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingScpTiming; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerCloseMetaBatch { + constructor(attributes: { + startSequence: number; + endSequence: number; + ledgerCloseMeta: LedgerCloseMeta[]; + }); + + startSequence(value?: number): number; + + endSequence(value?: number): number; + + ledgerCloseMeta(value?: LedgerCloseMeta[]): LedgerCloseMeta[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerCloseMetaBatch; + + static write(value: LedgerCloseMetaBatch, io: Buffer): void; + + static isValid(value: LedgerCloseMetaBatch): boolean; + + static toXDR(value: LedgerCloseMetaBatch): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaBatch; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerCloseMetaBatch; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScpStatementPledges { switch(): ScpStatementType; @@ -10950,36 +11142,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimableBalanceId { - switch(): ClaimableBalanceIdType; - - v0(value?: Buffer): Buffer; - - static claimableBalanceIdTypeV0(value: Buffer): ClaimableBalanceId; - - value(): Buffer; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ClaimableBalanceId; - - static write(value: ClaimableBalanceId, io: Buffer): void; - - static isValid(value: ClaimableBalanceId): boolean; - - static toXDR(value: ClaimableBalanceId): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceId; - - static fromXDR(input: string, format: 'hex' | 'base64'): ClaimableBalanceId; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class ClaimableBalanceEntryExtensionV1Ext { switch(): number; @@ -11425,8 +11587,6 @@ export namespace xdr { static hotArchiveLive(value: LedgerKey): HotArchiveBucketEntry; - static hotArchiveDeleted(value: LedgerKey): HotArchiveBucketEntry; - static hotArchiveMetaentry(value: BucketMetadata): HotArchiveBucketEntry; value(): LedgerEntry | LedgerKey | BucketMetadata; @@ -11455,66 +11615,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ColdArchiveBucketEntry { - switch(): ColdArchiveBucketEntryType; - - metaEntry(value?: BucketMetadata): BucketMetadata; - - archivedLeaf(value?: ColdArchiveArchivedLeaf): ColdArchiveArchivedLeaf; - - deletedLeaf(value?: ColdArchiveDeletedLeaf): ColdArchiveDeletedLeaf; - - boundaryLeaf(value?: ColdArchiveBoundaryLeaf): ColdArchiveBoundaryLeaf; - - hashEntry(value?: ColdArchiveHashEntry): ColdArchiveHashEntry; - - static coldArchiveMetaentry(value: BucketMetadata): ColdArchiveBucketEntry; - - static coldArchiveArchivedLeaf( - value: ColdArchiveArchivedLeaf, - ): ColdArchiveBucketEntry; - - static coldArchiveDeletedLeaf( - value: ColdArchiveDeletedLeaf, - ): ColdArchiveBucketEntry; - - static coldArchiveBoundaryLeaf( - value: ColdArchiveBoundaryLeaf, - ): ColdArchiveBucketEntry; - - static coldArchiveHash(value: ColdArchiveHashEntry): ColdArchiveBucketEntry; - - value(): - | BucketMetadata - | ColdArchiveArchivedLeaf - | ColdArchiveDeletedLeaf - | ColdArchiveBoundaryLeaf - | ColdArchiveHashEntry; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveBucketEntry; - - static write(value: ColdArchiveBucketEntry, io: Buffer): void; - - static isValid(value: ColdArchiveBucketEntry): boolean; - - static toXDR(value: ColdArchiveBucketEntry): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveBucketEntry; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveBucketEntry; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class StellarValueExt { switch(): StellarValueType; @@ -11714,9 +11814,13 @@ export namespace xdr { v0Components(value?: TxSetComponent[]): TxSetComponent[]; + parallelTxsComponent(value?: ParallelTxsComponent): ParallelTxsComponent; + static 0(value: TxSetComponent[]): TransactionPhase; - value(): TxSetComponent[]; + static 1(value: ParallelTxsComponent): TransactionPhase; + + value(): TxSetComponent[] | ParallelTxsComponent; toXDR(format?: 'raw'): Buffer; @@ -11915,6 +12019,8 @@ export namespace xdr { state(value?: LedgerEntry): LedgerEntry; + restored(value?: LedgerEntry): LedgerEntry; + static ledgerEntryCreated(value: LedgerEntry): LedgerEntryChange; static ledgerEntryUpdated(value: LedgerEntry): LedgerEntryChange; @@ -11923,7 +12029,9 @@ export namespace xdr { static ledgerEntryState(value: LedgerEntry): LedgerEntryChange; - value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry; + static ledgerEntryRestored(value: LedgerEntry): LedgerEntryChange; + + value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry | LedgerEntry; toXDR(format?: 'raw'): Buffer; @@ -12022,6 +12130,8 @@ export namespace xdr { v3(value?: TransactionMetaV3): TransactionMetaV3; + v4(value?: TransactionMetaV4): TransactionMetaV4; + static 0(value: OperationMeta[]): TransactionMeta; static 1(value: TransactionMetaV1): TransactionMeta; @@ -12030,11 +12140,14 @@ export namespace xdr { static 3(value: TransactionMetaV3): TransactionMeta; + static 4(value: TransactionMetaV4): TransactionMeta; + value(): | OperationMeta[] | TransactionMetaV1 | TransactionMetaV2 - | TransactionMetaV3; + | TransactionMetaV3 + | TransactionMetaV4; toXDR(format?: 'raw'): Buffer; @@ -12096,11 +12209,15 @@ export namespace xdr { v1(value?: LedgerCloseMetaV1): LedgerCloseMetaV1; + v2(value?: LedgerCloseMetaV2): LedgerCloseMetaV2; + static 0(value: LedgerCloseMetaV0): LedgerCloseMeta; static 1(value: LedgerCloseMetaV1): LedgerCloseMeta; - value(): LedgerCloseMetaV0 | LedgerCloseMetaV1; + static 2(value: LedgerCloseMetaV2): LedgerCloseMeta; + + value(): LedgerCloseMetaV0 | LedgerCloseMetaV1 | LedgerCloseMetaV2; toXDR(format?: 'raw'): Buffer; @@ -12160,34 +12277,15 @@ export namespace xdr { class SurveyResponseBody { switch(): SurveyMessageResponseType; - topologyResponseBodyV0( - value?: TopologyResponseBodyV0, - ): TopologyResponseBodyV0; - - topologyResponseBodyV1( - value?: TopologyResponseBodyV1, - ): TopologyResponseBodyV1; - topologyResponseBodyV2( value?: TopologyResponseBodyV2, ): TopologyResponseBodyV2; - static surveyTopologyResponseV0( - value: TopologyResponseBodyV0, - ): SurveyResponseBody; - - static surveyTopologyResponseV1( - value: TopologyResponseBodyV1, - ): SurveyResponseBody; - static surveyTopologyResponseV2( value: TopologyResponseBodyV2, ): SurveyResponseBody; - value(): - | TopologyResponseBodyV0 - | TopologyResponseBodyV1 - | TopologyResponseBodyV2; + value(): TopologyResponseBodyV2; toXDR(format?: 'raw'): Buffer; @@ -12233,14 +12331,6 @@ export namespace xdr { transaction(value?: TransactionEnvelope): TransactionEnvelope; - signedSurveyRequestMessage( - value?: SignedSurveyRequestMessage, - ): SignedSurveyRequestMessage; - - signedSurveyResponseMessage( - value?: SignedSurveyResponseMessage, - ): SignedSurveyResponseMessage; - signedTimeSlicedSurveyRequestMessage( value?: SignedTimeSlicedSurveyRequestMessage, ): SignedTimeSlicedSurveyRequestMessage; @@ -12281,8 +12371,6 @@ export namespace xdr { static dontHave(value: DontHave): StellarMessage; - static getPeers(): StellarMessage; - static peers(value: PeerAddress[]): StellarMessage; static getTxSet(value: Buffer): StellarMessage; @@ -12293,10 +12381,6 @@ export namespace xdr { static transaction(value: TransactionEnvelope): StellarMessage; - static surveyRequest(value: SignedSurveyRequestMessage): StellarMessage; - - static surveyResponse(value: SignedSurveyResponseMessage): StellarMessage; - static timeSlicedSurveyRequest( value: SignedTimeSlicedSurveyRequestMessage, ): StellarMessage; @@ -12339,8 +12423,6 @@ export namespace xdr { | TransactionSet | GeneralizedTransactionSet | TransactionEnvelope - | SignedSurveyRequestMessage - | SignedSurveyResponseMessage | SignedTimeSlicedSurveyRequestMessage | SignedTimeSlicedSurveyResponseMessage | SignedTimeSlicedSurveyStartCollectingMessage @@ -12352,8 +12434,7 @@ export namespace xdr { | SendMore | SendMoreExtended | FloodAdvert - | FloodDemand - | void; + | FloodDemand; toXDR(format?: 'raw'): Buffer; @@ -13048,34 +13129,35 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ArchivalProofBody { - switch(): ArchivalProofType; - - nonexistenceProof(value?: NonexistenceProofBody): NonexistenceProofBody; + class SorobanTransactionDataExt { + switch(): number; - existenceProof(value?: ExistenceProofBody): ExistenceProofBody; + resourceExt(value?: SorobanResourcesExtV0): SorobanResourcesExtV0; - static existence(value: NonexistenceProofBody): ArchivalProofBody; + static 0(): SorobanTransactionDataExt; - static nonexistence(value: ExistenceProofBody): ArchivalProofBody; + static 1(value: SorobanResourcesExtV0): SorobanTransactionDataExt; - value(): NonexistenceProofBody | ExistenceProofBody; + value(): SorobanResourcesExtV0 | void; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ArchivalProofBody; + static read(io: Buffer): SorobanTransactionDataExt; - static write(value: ArchivalProofBody, io: Buffer): void; + static write(value: SorobanTransactionDataExt, io: Buffer): void; - static isValid(value: ArchivalProofBody): boolean; + static isValid(value: SorobanTransactionDataExt): boolean; - static toXDR(value: ArchivalProofBody): Buffer; + static toXDR(value: SorobanTransactionDataExt): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ArchivalProofBody; + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionDataExt; - static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProofBody; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionDataExt; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -15079,6 +15161,36 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ClaimableBalanceId { + switch(): ClaimableBalanceIdType; + + v0(value?: Buffer): Buffer; + + static claimableBalanceIdTypeV0(value: Buffer): ClaimableBalanceId; + + value(): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimableBalanceId; + + static write(value: ClaimableBalanceId, io: Buffer): void; + + static isValid(value: ClaimableBalanceId): boolean; + + static toXDR(value: ClaimableBalanceId): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceId; + + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimableBalanceId; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScError { switch(): ScErrorType; @@ -15166,13 +15278,30 @@ export namespace xdr { accountId(value?: AccountId): AccountId; - contractId(value?: Buffer): Buffer; + contractId(value?: ContractId): ContractId; + + muxedAccount(value?: MuxedEd25519Account): MuxedEd25519Account; + + claimableBalanceId(value?: ClaimableBalanceId): ClaimableBalanceId; + + liquidityPoolId(value?: PoolId): PoolId; static scAddressTypeAccount(value: AccountId): ScAddress; - static scAddressTypeContract(value: Buffer): ScAddress; + static scAddressTypeContract(value: ContractId): ScAddress; + + static scAddressTypeMuxedAccount(value: MuxedEd25519Account): ScAddress; + + static scAddressTypeClaimableBalance(value: ClaimableBalanceId): ScAddress; - value(): AccountId | Buffer; + static scAddressTypeLiquidityPool(value: PoolId): ScAddress; + + value(): + | AccountId + | ContractId + | MuxedEd25519Account + | ClaimableBalanceId + | PoolId; toXDR(format?: 'raw'): Buffer; @@ -15234,10 +15363,10 @@ export namespace xdr { address(value?: ScAddress): ScAddress; - nonceKey(value?: ScNonceKey): ScNonceKey; - instance(value?: ScContractInstance): ScContractInstance; + nonceKey(value?: ScNonceKey): ScNonceKey; + static scvBool(value: boolean): ScVal; static scvVoid(): ScVal; @@ -15276,12 +15405,12 @@ export namespace xdr { static scvAddress(value: ScAddress): ScVal; + static scvContractInstance(value: ScContractInstance): ScVal; + static scvLedgerKeyContractInstance(): ScVal; static scvLedgerKeyNonce(value: ScNonceKey): ScVal; - static scvContractInstance(value: ScContractInstance): ScVal; - value(): | boolean | ScError @@ -15305,8 +15434,8 @@ export namespace xdr { | null | ScMapEntry[] | ScAddress - | ScNonceKey | ScContractInstance + | ScNonceKey | void; toXDR(format?: 'raw'): Buffer; @@ -15447,6 +15576,8 @@ export namespace xdr { static scSpecTypeAddress(): ScSpecTypeDef; + static scSpecTypeMuxedAddress(): ScSpecTypeDef; + static scSpecTypeOption(value: ScSpecTypeOption): ScSpecTypeDef; static scSpecTypeResult(value: ScSpecTypeResult): ScSpecTypeDef; @@ -15546,6 +15677,8 @@ export namespace xdr { udtErrorEnumV0(value?: ScSpecUdtErrorEnumV0): ScSpecUdtErrorEnumV0; + eventV0(value?: ScSpecEventV0): ScSpecEventV0; + static scSpecEntryFunctionV0(value: ScSpecFunctionV0): ScSpecEntry; static scSpecEntryUdtStructV0(value: ScSpecUdtStructV0): ScSpecEntry; @@ -15556,12 +15689,15 @@ export namespace xdr { static scSpecEntryUdtErrorEnumV0(value: ScSpecUdtErrorEnumV0): ScSpecEntry; + static scSpecEntryEventV0(value: ScSpecEventV0): ScSpecEntry; + value(): | ScSpecFunctionV0 | ScSpecUdtStructV0 | ScSpecUdtUnionV0 | ScSpecUdtEnumV0 - | ScSpecUdtErrorEnumV0; + | ScSpecUdtErrorEnumV0 + | ScSpecEventV0; toXDR(format?: 'raw'): Buffer; @@ -15627,10 +15763,20 @@ export namespace xdr { value?: ConfigSettingContractExecutionLanesV0, ): ConfigSettingContractExecutionLanesV0; - bucketListSizeWindow(value?: Uint64[]): Uint64[]; + liveSorobanStateSizeWindow(value?: Uint64[]): Uint64[]; evictionIterator(value?: EvictionIterator): EvictionIterator; + contractParallelCompute( + value?: ConfigSettingContractParallelComputeV0, + ): ConfigSettingContractParallelComputeV0; + + contractLedgerCostExt( + value?: ConfigSettingContractLedgerCostExtV0, + ): ConfigSettingContractLedgerCostExtV0; + + contractScpTiming(value?: ConfigSettingScpTiming): ConfigSettingScpTiming; + static configSettingContractMaxSizeBytes(value: number): ConfigSettingEntry; static configSettingContractComputeV0( @@ -15677,7 +15823,7 @@ export namespace xdr { value: ConfigSettingContractExecutionLanesV0, ): ConfigSettingEntry; - static configSettingBucketlistSizeWindow( + static configSettingLiveSorobanStateSizeWindow( value: Uint64[], ): ConfigSettingEntry; @@ -15685,6 +15831,18 @@ export namespace xdr { value: EvictionIterator, ): ConfigSettingEntry; + static configSettingContractParallelComputeV0( + value: ConfigSettingContractParallelComputeV0, + ): ConfigSettingEntry; + + static configSettingContractLedgerCostExtV0( + value: ConfigSettingContractLedgerCostExtV0, + ): ConfigSettingEntry; + + static configSettingScpTiming( + value: ConfigSettingScpTiming, + ): ConfigSettingEntry; + value(): | number | ConfigSettingContractComputeV0 @@ -15699,7 +15857,10 @@ export namespace xdr { | StateArchivalSettings | ConfigSettingContractExecutionLanesV0 | Uint64[] - | EvictionIterator; + | EvictionIterator + | ConfigSettingContractParallelComputeV0 + | ConfigSettingContractLedgerCostExtV0 + | ConfigSettingScpTiming; toXDR(format?: 'raw'): Buffer; diff --git a/types/index.d.ts b/types/index.d.ts index 5ebc5872..b8502c66 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1190,7 +1190,7 @@ export class SorobanDataBuilder { setResourceFee(fee: IntLike): SorobanDataBuilder; setResources( cpuInstrs: number, - readBytes: number, + diskReadBytes: number, writeBytes: number ): SorobanDataBuilder; diff --git a/types/next.d.ts b/types/next.d.ts index ced3636f..2e87eed3 100644 --- a/types/next.d.ts +++ b/types/next.d.ts @@ -44,6 +44,16 @@ export namespace xdr { type Hash = Opaque[]; // workaround, cause unknown + /** + * Returns an {@link ScVal} with a map type and sorted entries. + * + * @param items the key-value pairs to sort. + * + * @warning This only performs 'best-effort' sorting, working best when the + * keys are all either numeric or string-like. + */ + function scvSortedMap(items: ScMapEntry[]): ScVal; + interface SignedInt { readonly MAX_VALUE: 2147483647; readonly MIN_VALUE: -2147483648; @@ -89,7 +99,7 @@ export namespace xdr { unsigned: boolean; constructor( - values: string | bigint | number | (string | bigint | number)[], + values: string | bigint | number | Array, ); toXDR(format?: 'raw'): Buffer; @@ -133,7 +143,7 @@ export namespace xdr { unsigned: boolean; constructor( - values: string | bigint | number | (string | bigint | number)[], + values: string | bigint | number | Array, ); toXDR(format?: 'raw'): Buffer; @@ -426,14 +436,6 @@ export namespace xdr { static claimantTypeV0(): ClaimantType; } - class ClaimableBalanceIdType { - readonly name: 'claimableBalanceIdTypeV0'; - - readonly value: 0; - - static claimableBalanceIdTypeV0(): ClaimableBalanceIdType; - } - class ClaimableBalanceFlags { readonly name: 'claimableBalanceClawbackEnabledFlag'; @@ -489,15 +491,13 @@ export namespace xdr { } class BucketListType { - readonly name: 'live' | 'hotArchive' | 'coldArchive'; + readonly name: 'live' | 'hotArchive'; - readonly value: 0 | 1 | 2; + readonly value: 0 | 1; static live(): BucketListType; static hotArchive(): BucketListType; - - static coldArchive(): BucketListType; } class BucketEntryType { @@ -518,39 +518,15 @@ export namespace xdr { readonly name: | 'hotArchiveMetaentry' | 'hotArchiveArchived' - | 'hotArchiveLive' - | 'hotArchiveDeleted'; + | 'hotArchiveLive'; - readonly value: -1 | 0 | 1 | 2; + readonly value: -1 | 0 | 1; static hotArchiveMetaentry(): HotArchiveBucketEntryType; static hotArchiveArchived(): HotArchiveBucketEntryType; static hotArchiveLive(): HotArchiveBucketEntryType; - - static hotArchiveDeleted(): HotArchiveBucketEntryType; - } - - class ColdArchiveBucketEntryType { - readonly name: - | 'coldArchiveMetaentry' - | 'coldArchiveArchivedLeaf' - | 'coldArchiveDeletedLeaf' - | 'coldArchiveBoundaryLeaf' - | 'coldArchiveHash'; - - readonly value: -1 | 0 | 1 | 2 | 3; - - static coldArchiveMetaentry(): ColdArchiveBucketEntryType; - - static coldArchiveArchivedLeaf(): ColdArchiveBucketEntryType; - - static coldArchiveDeletedLeaf(): ColdArchiveBucketEntryType; - - static coldArchiveBoundaryLeaf(): ColdArchiveBucketEntryType; - - static coldArchiveHash(): ColdArchiveBucketEntryType; } class StellarValueType { @@ -618,9 +594,10 @@ export namespace xdr { | 'ledgerEntryCreated' | 'ledgerEntryUpdated' | 'ledgerEntryRemoved' - | 'ledgerEntryState'; + | 'ledgerEntryState' + | 'ledgerEntryRestored'; - readonly value: 0 | 1 | 2 | 3; + readonly value: 0 | 1 | 2 | 3 | 4; static ledgerEntryCreated(): LedgerEntryChangeType; @@ -629,6 +606,8 @@ export namespace xdr { static ledgerEntryRemoved(): LedgerEntryChangeType; static ledgerEntryState(): LedgerEntryChangeType; + + static ledgerEntryRestored(): LedgerEntryChangeType; } class ContractEventType { @@ -643,6 +622,21 @@ export namespace xdr { static diagnostic(): ContractEventType; } + class TransactionEventStage { + readonly name: + | 'transactionEventStageBeforeAllTxes' + | 'transactionEventStageAfterTx' + | 'transactionEventStageAfterAllTxes'; + + readonly value: 0 | 1 | 2; + + static transactionEventStageBeforeAllTxes(): TransactionEventStage; + + static transactionEventStageAfterTx(): TransactionEventStage; + + static transactionEventStageAfterAllTxes(): TransactionEventStage; + } + class ErrorCode { readonly name: 'errMisc' | 'errData' | 'errConf' | 'errAuth' | 'errLoad'; @@ -674,7 +668,6 @@ export namespace xdr { | 'errorMsg' | 'auth' | 'dontHave' - | 'getPeers' | 'peers' | 'getTxSet' | 'txSet' @@ -685,8 +678,6 @@ export namespace xdr { | 'scpMessage' | 'getScpState' | 'hello' - | 'surveyRequest' - | 'surveyResponse' | 'sendMore' | 'sendMoreExtended' | 'floodAdvert' @@ -700,7 +691,6 @@ export namespace xdr { | 0 | 2 | 3 - | 4 | 5 | 6 | 7 @@ -711,8 +701,6 @@ export namespace xdr { | 11 | 12 | 13 - | 14 - | 15 | 16 | 20 | 18 @@ -728,8 +716,6 @@ export namespace xdr { static dontHave(): MessageType; - static getPeers(): MessageType; - static peers(): MessageType; static getTxSet(): MessageType; @@ -750,10 +736,6 @@ export namespace xdr { static hello(): MessageType; - static surveyRequest(): MessageType; - - static surveyResponse(): MessageType; - static sendMore(): MessageType; static sendMoreExtended(): MessageType; @@ -772,26 +754,17 @@ export namespace xdr { } class SurveyMessageCommandType { - readonly name: 'surveyTopology' | 'timeSlicedSurveyTopology'; + readonly name: 'timeSlicedSurveyTopology'; - readonly value: 0 | 1; - - static surveyTopology(): SurveyMessageCommandType; + readonly value: 1; static timeSlicedSurveyTopology(): SurveyMessageCommandType; } class SurveyMessageResponseType { - readonly name: - | 'surveyTopologyResponseV0' - | 'surveyTopologyResponseV1' - | 'surveyTopologyResponseV2'; + readonly name: 'surveyTopologyResponseV2'; - readonly value: 0 | 1 | 2; - - static surveyTopologyResponseV0(): SurveyMessageResponseType; - - static surveyTopologyResponseV1(): SurveyMessageResponseType; + readonly value: 2; static surveyTopologyResponseV2(): SurveyMessageResponseType; } @@ -1010,16 +983,6 @@ export namespace xdr { static precondV2(): PreconditionType; } - class ArchivalProofType { - readonly name: 'existence' | 'nonexistence'; - - readonly value: 0 | 1; - - static existence(): ArchivalProofType; - - static nonexistence(): ArchivalProofType; - } - class ClaimAtomType { readonly name: | 'claimAtomTypeV0' @@ -1959,6 +1922,14 @@ export namespace xdr { static binaryFuseFilter32Bit(): BinaryFuseFilterType; } + class ClaimableBalanceIdType { + readonly name: 'claimableBalanceIdTypeV0'; + + readonly value: 0; + + static claimableBalanceIdTypeV0(): ClaimableBalanceIdType; + } + class ScValType { readonly name: | 'scvBool' @@ -2136,13 +2107,24 @@ export namespace xdr { } class ScAddressType { - readonly name: 'scAddressTypeAccount' | 'scAddressTypeContract'; + readonly name: + | 'scAddressTypeAccount' + | 'scAddressTypeContract' + | 'scAddressTypeMuxedAccount' + | 'scAddressTypeClaimableBalance' + | 'scAddressTypeLiquidityPool'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2 | 3 | 4; static scAddressTypeAccount(): ScAddressType; static scAddressTypeContract(): ScAddressType; + + static scAddressTypeMuxedAccount(): ScAddressType; + + static scAddressTypeClaimableBalance(): ScAddressType; + + static scAddressTypeLiquidityPool(): ScAddressType; } class ScEnvMetaKind { @@ -2181,6 +2163,7 @@ export namespace xdr { | 'scSpecTypeString' | 'scSpecTypeSymbol' | 'scSpecTypeAddress' + | 'scSpecTypeMuxedAddress' | 'scSpecTypeOption' | 'scSpecTypeResult' | 'scSpecTypeVec' @@ -2208,6 +2191,7 @@ export namespace xdr { | 16 | 17 | 19 + | 20 | 1000 | 1001 | 1002 @@ -2252,6 +2236,8 @@ export namespace xdr { static scSpecTypeAddress(): ScSpecType; + static scSpecTypeMuxedAddress(): ScSpecType; + static scSpecTypeOption(): ScSpecType; static scSpecTypeResult(): ScSpecType; @@ -2277,15 +2263,43 @@ export namespace xdr { static scSpecUdtUnionCaseTupleV0(): ScSpecUdtUnionCaseV0Kind; } + class ScSpecEventParamLocationV0 { + readonly name: + | 'scSpecEventParamLocationData' + | 'scSpecEventParamLocationTopicList'; + + readonly value: 0 | 1; + + static scSpecEventParamLocationData(): ScSpecEventParamLocationV0; + + static scSpecEventParamLocationTopicList(): ScSpecEventParamLocationV0; + } + + class ScSpecEventDataFormat { + readonly name: + | 'scSpecEventDataFormatSingleValue' + | 'scSpecEventDataFormatVec' + | 'scSpecEventDataFormatMap'; + + readonly value: 0 | 1 | 2; + + static scSpecEventDataFormatSingleValue(): ScSpecEventDataFormat; + + static scSpecEventDataFormatVec(): ScSpecEventDataFormat; + + static scSpecEventDataFormatMap(): ScSpecEventDataFormat; + } + class ScSpecEntryKind { readonly name: | 'scSpecEntryFunctionV0' | 'scSpecEntryUdtStructV0' | 'scSpecEntryUdtUnionV0' | 'scSpecEntryUdtEnumV0' - | 'scSpecEntryUdtErrorEnumV0'; + | 'scSpecEntryUdtErrorEnumV0' + | 'scSpecEntryEventV0'; - readonly value: 0 | 1 | 2 | 3 | 4; + readonly value: 0 | 1 | 2 | 3 | 4 | 5; static scSpecEntryFunctionV0(): ScSpecEntryKind; @@ -2296,6 +2310,8 @@ export namespace xdr { static scSpecEntryUdtEnumV0(): ScSpecEntryKind; static scSpecEntryUdtErrorEnumV0(): ScSpecEntryKind; + + static scSpecEntryEventV0(): ScSpecEntryKind; } class ContractCostType { @@ -2598,9 +2614,11 @@ export namespace xdr { | 'configSettingContractDataEntrySizeBytes' | 'configSettingStateArchival' | 'configSettingContractExecutionLanes' - | 'configSettingBucketlistSizeWindow' + | 'configSettingLiveSorobanStateSizeWindow' | 'configSettingEvictionIterator' - | 'configSettingContractParallelComputeV0'; + | 'configSettingContractParallelComputeV0' + | 'configSettingContractLedgerCostExtV0' + | 'configSettingScpTiming'; readonly value: | 0 @@ -2617,7 +2635,9 @@ export namespace xdr { | 11 | 12 | 13 - | 14; + | 14 + | 15 + | 16; static configSettingContractMaxSizeBytes(): ConfigSettingId; @@ -2643,11 +2663,15 @@ export namespace xdr { static configSettingContractExecutionLanes(): ConfigSettingId; - static configSettingBucketlistSizeWindow(): ConfigSettingId; + static configSettingLiveSorobanStateSizeWindow(): ConfigSettingId; static configSettingEvictionIterator(): ConfigSettingId; static configSettingContractParallelComputeV0(): ConfigSettingId; + + static configSettingContractLedgerCostExtV0(): ConfigSettingId; + + static configSettingScpTiming(): ConfigSettingId; } const Value: VarOpaque; @@ -2662,8 +2686,6 @@ export namespace xdr { const DataValue: VarOpaque; - type PoolId = Hash; - const AssetCode4: Opaque; const AssetCode12: Opaque; @@ -2672,7 +2694,7 @@ export namespace xdr { const UpgradeType: VarOpaque; - const TxExecutionThread: XDRArray; + const DependentTxCluster: XDRArray; const ParallelTxExecutionStage: XDRArray; @@ -2680,15 +2702,13 @@ export namespace xdr { const EncryptedBody: VarOpaque; - const PeerStatList: XDRArray; - const TimeSlicedPeerDataList: XDRArray; const TxAdvertVector: XDRArray; const TxDemandVector: XDRArray; - const ProofLevel: XDRArray; + const SorobanAuthorizationEntries: XDRArray; const Hash: Opaque; @@ -2714,6 +2734,10 @@ export namespace xdr { type AccountId = PublicKey; + type ContractId = Hash; + + type PoolId = Hash; + const ScVec: XDRArray; const ScMap: XDRArray; @@ -4328,132 +4352,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ColdArchiveArchivedLeaf { - constructor(attributes: { index: number; archivedEntry: LedgerEntry }); - - index(value?: number): number; - - archivedEntry(value?: LedgerEntry): LedgerEntry; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveArchivedLeaf; - - static write(value: ColdArchiveArchivedLeaf, io: Buffer): void; - - static isValid(value: ColdArchiveArchivedLeaf): boolean; - - static toXDR(value: ColdArchiveArchivedLeaf): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveArchivedLeaf; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveArchivedLeaf; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ColdArchiveDeletedLeaf { - constructor(attributes: { index: number; deletedKey: LedgerKey }); - - index(value?: number): number; - - deletedKey(value?: LedgerKey): LedgerKey; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveDeletedLeaf; - - static write(value: ColdArchiveDeletedLeaf, io: Buffer): void; - - static isValid(value: ColdArchiveDeletedLeaf): boolean; - - static toXDR(value: ColdArchiveDeletedLeaf): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveDeletedLeaf; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveDeletedLeaf; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ColdArchiveBoundaryLeaf { - constructor(attributes: { index: number; isLowerBound: boolean }); - - index(value?: number): number; - - isLowerBound(value?: boolean): boolean; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveBoundaryLeaf; - - static write(value: ColdArchiveBoundaryLeaf, io: Buffer): void; - - static isValid(value: ColdArchiveBoundaryLeaf): boolean; - - static toXDR(value: ColdArchiveBoundaryLeaf): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveBoundaryLeaf; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveBoundaryLeaf; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ColdArchiveHashEntry { - constructor(attributes: { index: number; level: number; hash: Buffer }); - - index(value?: number): number; - - level(value?: number): number; - - hash(value?: Buffer): Buffer; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveHashEntry; - - static write(value: ColdArchiveHashEntry, io: Buffer): void; - - static isValid(value: ColdArchiveHashEntry): boolean; - - static toXDR(value: ColdArchiveHashEntry): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveHashEntry; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveHashEntry; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class LedgerCloseValueSignature { constructor(attributes: { nodeId: NodeId; signature: Buffer }); @@ -4624,9 +4522,9 @@ export namespace xdr { } class ConfigUpgradeSetKey { - constructor(attributes: { contractId: Buffer; contentHash: Buffer }); + constructor(attributes: { contractId: ContractId; contentHash: Buffer }); - contractId(value?: Buffer): Buffer; + contractId(value?: ContractId): ContractId; contentHash(value?: Buffer): Buffer; @@ -5175,14 +5073,14 @@ export namespace xdr { class ContractEvent { constructor(attributes: { ext: ExtensionPoint; - contractId: null | Buffer; + contractId: null | ContractId; type: ContractEventType; body: ContractEventBody; }); ext(value?: ExtensionPoint): ExtensionPoint; - contractId(value?: null | Buffer): null | Buffer; + contractId(value?: null | ContractId): null | ContractId; type(value?: ContractEventType): ContractEventType; @@ -5362,10 +5260,16 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InvokeHostFunctionSuccessPreImage { - constructor(attributes: { returnValue: ScVal; events: ContractEvent[] }); + class OperationMetaV2 { + constructor(attributes: { + ext: ExtensionPoint; + changes: LedgerEntryChange[]; + events: ContractEvent[]; + }); - returnValue(value?: ScVal): ScVal; + ext(value?: ExtensionPoint): ExtensionPoint; + + changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; events(value?: ContractEvent[]): ContractEvent[]; @@ -5373,117 +5277,301 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): InvokeHostFunctionSuccessPreImage; + static read(io: Buffer): OperationMetaV2; - static write(value: InvokeHostFunctionSuccessPreImage, io: Buffer): void; + static write(value: OperationMetaV2, io: Buffer): void; - static isValid(value: InvokeHostFunctionSuccessPreImage): boolean; + static isValid(value: OperationMetaV2): boolean; - static toXDR(value: InvokeHostFunctionSuccessPreImage): Buffer; + static toXDR(value: OperationMetaV2): Buffer; - static fromXDR( - input: Buffer, - format?: 'raw', - ): InvokeHostFunctionSuccessPreImage; + static fromXDR(input: Buffer, format?: 'raw'): OperationMetaV2; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): InvokeHostFunctionSuccessPreImage; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationMetaV2; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultMeta { + class SorobanTransactionMetaV2 { constructor(attributes: { - result: TransactionResultPair; - feeProcessing: LedgerEntryChange[]; - txApplyProcessing: TransactionMeta; + ext: SorobanTransactionMetaExt; + returnValue: null | ScVal; }); - result(value?: TransactionResultPair): TransactionResultPair; - - feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + ext(value?: SorobanTransactionMetaExt): SorobanTransactionMetaExt; - txApplyProcessing(value?: TransactionMeta): TransactionMeta; + returnValue(value?: null | ScVal): null | ScVal; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResultMeta; + static read(io: Buffer): SorobanTransactionMetaV2; - static write(value: TransactionResultMeta, io: Buffer): void; + static write(value: SorobanTransactionMetaV2, io: Buffer): void; - static isValid(value: TransactionResultMeta): boolean; + static isValid(value: SorobanTransactionMetaV2): boolean; - static toXDR(value: TransactionResultMeta): Buffer; + static toXDR(value: SorobanTransactionMetaV2): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): TransactionResultMeta; + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionMetaV2; static fromXDR( input: string, format: 'hex' | 'base64', - ): TransactionResultMeta; + ): SorobanTransactionMetaV2; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class UpgradeEntryMeta { + class TransactionEvent { constructor(attributes: { - upgrade: LedgerUpgrade; - changes: LedgerEntryChange[]; + stage: TransactionEventStage; + event: ContractEvent; }); - upgrade(value?: LedgerUpgrade): LedgerUpgrade; + stage(value?: TransactionEventStage): TransactionEventStage; - changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; + event(value?: ContractEvent): ContractEvent; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): UpgradeEntryMeta; + static read(io: Buffer): TransactionEvent; - static write(value: UpgradeEntryMeta, io: Buffer): void; + static write(value: TransactionEvent, io: Buffer): void; - static isValid(value: UpgradeEntryMeta): boolean; + static isValid(value: TransactionEvent): boolean; - static toXDR(value: UpgradeEntryMeta): Buffer; + static toXDR(value: TransactionEvent): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): UpgradeEntryMeta; + static fromXDR(input: Buffer, format?: 'raw'): TransactionEvent; - static fromXDR(input: string, format: 'hex' | 'base64'): UpgradeEntryMeta; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionEvent; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerCloseMetaV0 { + class TransactionMetaV4 { constructor(attributes: { - ledgerHeader: LedgerHeaderHistoryEntry; - txSet: TransactionSet; - txProcessing: TransactionResultMeta[]; - upgradesProcessing: UpgradeEntryMeta[]; - scpInfo: ScpHistoryEntry[]; + ext: ExtensionPoint; + txChangesBefore: LedgerEntryChange[]; + operations: OperationMetaV2[]; + txChangesAfter: LedgerEntryChange[]; + sorobanMeta: null | SorobanTransactionMetaV2; + events: TransactionEvent[]; + diagnosticEvents: DiagnosticEvent[]; }); - ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; + ext(value?: ExtensionPoint): ExtensionPoint; - txSet(value?: TransactionSet): TransactionSet; + txChangesBefore(value?: LedgerEntryChange[]): LedgerEntryChange[]; - txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; + operations(value?: OperationMetaV2[]): OperationMetaV2[]; - upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; + txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; - scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; + sorobanMeta( + value?: null | SorobanTransactionMetaV2, + ): null | SorobanTransactionMetaV2; - toXDR(format?: 'raw'): Buffer; + events(value?: TransactionEvent[]): TransactionEvent[]; + + diagnosticEvents(value?: DiagnosticEvent[]): DiagnosticEvent[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionMetaV4; + + static write(value: TransactionMetaV4, io: Buffer): void; + + static isValid(value: TransactionMetaV4): boolean; + + static toXDR(value: TransactionMetaV4): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV4; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV4; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class InvokeHostFunctionSuccessPreImage { + constructor(attributes: { returnValue: ScVal; events: ContractEvent[] }); + + returnValue(value?: ScVal): ScVal; + + events(value?: ContractEvent[]): ContractEvent[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): InvokeHostFunctionSuccessPreImage; + + static write(value: InvokeHostFunctionSuccessPreImage, io: Buffer): void; + + static isValid(value: InvokeHostFunctionSuccessPreImage): boolean; + + static toXDR(value: InvokeHostFunctionSuccessPreImage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): InvokeHostFunctionSuccessPreImage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): InvokeHostFunctionSuccessPreImage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionResultMeta { + constructor(attributes: { + result: TransactionResultPair; + feeProcessing: LedgerEntryChange[]; + txApplyProcessing: TransactionMeta; + }); + + result(value?: TransactionResultPair): TransactionResultPair; + + feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + txApplyProcessing(value?: TransactionMeta): TransactionMeta; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionResultMeta; + + static write(value: TransactionResultMeta, io: Buffer): void; + + static isValid(value: TransactionResultMeta): boolean; + + static toXDR(value: TransactionResultMeta): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultMeta; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionResultMeta; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionResultMetaV1 { + constructor(attributes: { + ext: ExtensionPoint; + result: TransactionResultPair; + feeProcessing: LedgerEntryChange[]; + txApplyProcessing: TransactionMeta; + postTxApplyFeeProcessing: LedgerEntryChange[]; + }); + + ext(value?: ExtensionPoint): ExtensionPoint; + + result(value?: TransactionResultPair): TransactionResultPair; + + feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + txApplyProcessing(value?: TransactionMeta): TransactionMeta; + + postTxApplyFeeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionResultMetaV1; + + static write(value: TransactionResultMetaV1, io: Buffer): void; + + static isValid(value: TransactionResultMetaV1): boolean; + + static toXDR(value: TransactionResultMetaV1): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultMetaV1; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionResultMetaV1; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class UpgradeEntryMeta { + constructor(attributes: { + upgrade: LedgerUpgrade; + changes: LedgerEntryChange[]; + }); + + upgrade(value?: LedgerUpgrade): LedgerUpgrade; + + changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): UpgradeEntryMeta; + + static write(value: UpgradeEntryMeta, io: Buffer): void; + + static isValid(value: UpgradeEntryMeta): boolean; + + static toXDR(value: UpgradeEntryMeta): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): UpgradeEntryMeta; + + static fromXDR(input: string, format: 'hex' | 'base64'): UpgradeEntryMeta; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerCloseMetaV0 { + constructor(attributes: { + ledgerHeader: LedgerHeaderHistoryEntry; + txSet: TransactionSet; + txProcessing: TransactionResultMeta[]; + upgradesProcessing: UpgradeEntryMeta[]; + scpInfo: ScpHistoryEntry[]; + }); + + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; + + txSet(value?: TransactionSet): TransactionSet; + + txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; + + upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; + + scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; + + toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; @@ -5543,9 +5631,9 @@ export namespace xdr { txProcessing: TransactionResultMeta[]; upgradesProcessing: UpgradeEntryMeta[]; scpInfo: ScpHistoryEntry[]; - totalByteSizeOfBucketList: Uint64; - evictedTemporaryLedgerKeys: LedgerKey[]; - evictedPersistentLedgerEntries: LedgerEntry[]; + totalByteSizeOfLiveSorobanState: Uint64; + evictedKeys: LedgerKey[]; + unused: LedgerEntry[]; }); ext(value?: LedgerCloseMetaExt): LedgerCloseMetaExt; @@ -5560,11 +5648,11 @@ export namespace xdr { scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - totalByteSizeOfBucketList(value?: Uint64): Uint64; + totalByteSizeOfLiveSorobanState(value?: Uint64): Uint64; - evictedTemporaryLedgerKeys(value?: LedgerKey[]): LedgerKey[]; + evictedKeys(value?: LedgerKey[]): LedgerKey[]; - evictedPersistentLedgerEntries(value?: LedgerEntry[]): LedgerEntry[]; + unused(value?: LedgerEntry[]): LedgerEntry[]; toXDR(format?: 'raw'): Buffer; @@ -5587,6 +5675,55 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class LedgerCloseMetaV2 { + constructor(attributes: { + ext: LedgerCloseMetaExt; + ledgerHeader: LedgerHeaderHistoryEntry; + txSet: GeneralizedTransactionSet; + txProcessing: TransactionResultMetaV1[]; + upgradesProcessing: UpgradeEntryMeta[]; + scpInfo: ScpHistoryEntry[]; + totalByteSizeOfLiveSorobanState: Uint64; + evictedKeys: LedgerKey[]; + }); + + ext(value?: LedgerCloseMetaExt): LedgerCloseMetaExt; + + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; + + txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; + + txProcessing(value?: TransactionResultMetaV1[]): TransactionResultMetaV1[]; + + upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; + + scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; + + totalByteSizeOfLiveSorobanState(value?: Uint64): Uint64; + + evictedKeys(value?: LedgerKey[]): LedgerKey[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerCloseMetaV2; + + static write(value: LedgerCloseMetaV2, io: Buffer): void; + + static isValid(value: LedgerCloseMetaV2): boolean; + + static toXDR(value: LedgerCloseMetaV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV2; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class Error { constructor(attributes: { code: ErrorCode; msg: string | Buffer }); @@ -6101,40 +6238,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignedSurveyRequestMessage { - constructor(attributes: { - requestSignature: Buffer; - request: SurveyRequestMessage; - }); - - requestSignature(value?: Buffer): Buffer; - - request(value?: SurveyRequestMessage): SurveyRequestMessage; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): SignedSurveyRequestMessage; - - static write(value: SignedSurveyRequestMessage, io: Buffer): void; - - static isValid(value: SignedSurveyRequestMessage): boolean; - - static toXDR(value: SignedSurveyRequestMessage): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyRequestMessage; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): SignedSurveyRequestMessage; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class SignedTimeSlicedSurveyRequestMessage { constructor(attributes: { requestSignature: Buffer; @@ -6251,40 +6354,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignedSurveyResponseMessage { - constructor(attributes: { - responseSignature: Buffer; - response: SurveyResponseMessage; - }); - - responseSignature(value?: Buffer): Buffer; - - response(value?: SurveyResponseMessage): SurveyResponseMessage; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): SignedSurveyResponseMessage; - - static write(value: SignedSurveyResponseMessage, io: Buffer): void; - - static isValid(value: SignedSurveyResponseMessage): boolean; - - static toXDR(value: SignedSurveyResponseMessage): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyResponseMessage; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): SignedSurveyResponseMessage; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class SignedTimeSlicedSurveyResponseMessage { constructor(attributes: { responseSignature: Buffer; @@ -6419,147 +6488,61 @@ export namespace xdr { totalOutboundPeerCount(value?: number): number; - p75ScpFirstToSelfLatencyMs(value?: number): number; - - p75ScpSelfToOtherLatencyMs(value?: number): number; - - lostSyncCount(value?: number): number; - - isValidator(value?: boolean): boolean; - - maxInboundPeerCount(value?: number): number; - - maxOutboundPeerCount(value?: number): number; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): TimeSlicedNodeData; - - static write(value: TimeSlicedNodeData, io: Buffer): void; - - static isValid(value: TimeSlicedNodeData): boolean; - - static toXDR(value: TimeSlicedNodeData): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): TimeSlicedNodeData; - - static fromXDR(input: string, format: 'hex' | 'base64'): TimeSlicedNodeData; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class TimeSlicedPeerData { - constructor(attributes: { peerStats: PeerStats; averageLatencyMs: number }); - - peerStats(value?: PeerStats): PeerStats; - - averageLatencyMs(value?: number): number; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): TimeSlicedPeerData; - - static write(value: TimeSlicedPeerData, io: Buffer): void; - - static isValid(value: TimeSlicedPeerData): boolean; - - static toXDR(value: TimeSlicedPeerData): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): TimeSlicedPeerData; - - static fromXDR(input: string, format: 'hex' | 'base64'): TimeSlicedPeerData; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } + p75ScpFirstToSelfLatencyMs(value?: number): number; - class TopologyResponseBodyV0 { - constructor(attributes: { - inboundPeers: PeerStats[]; - outboundPeers: PeerStats[]; - totalInboundPeerCount: number; - totalOutboundPeerCount: number; - }); + p75ScpSelfToOtherLatencyMs(value?: number): number; - inboundPeers(value?: PeerStats[]): PeerStats[]; + lostSyncCount(value?: number): number; - outboundPeers(value?: PeerStats[]): PeerStats[]; + isValidator(value?: boolean): boolean; - totalInboundPeerCount(value?: number): number; + maxInboundPeerCount(value?: number): number; - totalOutboundPeerCount(value?: number): number; + maxOutboundPeerCount(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TopologyResponseBodyV0; + static read(io: Buffer): TimeSlicedNodeData; - static write(value: TopologyResponseBodyV0, io: Buffer): void; + static write(value: TimeSlicedNodeData, io: Buffer): void; - static isValid(value: TopologyResponseBodyV0): boolean; + static isValid(value: TimeSlicedNodeData): boolean; - static toXDR(value: TopologyResponseBodyV0): Buffer; + static toXDR(value: TimeSlicedNodeData): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV0; + static fromXDR(input: Buffer, format?: 'raw'): TimeSlicedNodeData; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): TopologyResponseBodyV0; + static fromXDR(input: string, format: 'hex' | 'base64'): TimeSlicedNodeData; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TopologyResponseBodyV1 { - constructor(attributes: { - inboundPeers: PeerStats[]; - outboundPeers: PeerStats[]; - totalInboundPeerCount: number; - totalOutboundPeerCount: number; - maxInboundPeerCount: number; - maxOutboundPeerCount: number; - }); - - inboundPeers(value?: PeerStats[]): PeerStats[]; - - outboundPeers(value?: PeerStats[]): PeerStats[]; - - totalInboundPeerCount(value?: number): number; - - totalOutboundPeerCount(value?: number): number; + class TimeSlicedPeerData { + constructor(attributes: { peerStats: PeerStats; averageLatencyMs: number }); - maxInboundPeerCount(value?: number): number; + peerStats(value?: PeerStats): PeerStats; - maxOutboundPeerCount(value?: number): number; + averageLatencyMs(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TopologyResponseBodyV1; + static read(io: Buffer): TimeSlicedPeerData; - static write(value: TopologyResponseBodyV1, io: Buffer): void; + static write(value: TimeSlicedPeerData, io: Buffer): void; - static isValid(value: TopologyResponseBodyV1): boolean; + static isValid(value: TimeSlicedPeerData): boolean; - static toXDR(value: TopologyResponseBodyV1): Buffer; + static toXDR(value: TimeSlicedPeerData): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV1; + static fromXDR(input: Buffer, format?: 'raw'): TimeSlicedPeerData; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): TopologyResponseBodyV1; + static fromXDR(input: string, format: 'hex' | 'base64'): TimeSlicedPeerData; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -7850,37 +7833,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Operation { - constructor(attributes: { - sourceAccount: null | MuxedAccount; - body: OperationBody; - }); - - sourceAccount(value?: null | MuxedAccount): null | MuxedAccount; - - body(value?: OperationBody): OperationBody; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): Operation; - - static write(value: Operation, io: Buffer): void; - - static isValid(value: Operation): boolean; - - static toXDR(value: Operation): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): Operation; - - static fromXDR(input: string, format: 'hex' | 'base64'): Operation; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class HashIdPreimageOperationId { constructor(attributes: { sourceAccount: AccountId; @@ -8167,166 +8119,66 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ArchivalProofNode { - constructor(attributes: { index: number; hash: Buffer }); - - index(value?: number): number; - - hash(value?: Buffer): Buffer; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ArchivalProofNode; - - static write(value: ArchivalProofNode, io: Buffer): void; - - static isValid(value: ArchivalProofNode): boolean; - - static toXDR(value: ArchivalProofNode): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ArchivalProofNode; - - static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProofNode; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class NonexistenceProofBody { - constructor(attributes: { - entriesToProve: ColdArchiveBucketEntry[]; - proofLevels: ArchivalProofNode[][]; - }); - - entriesToProve(value?: ColdArchiveBucketEntry[]): ColdArchiveBucketEntry[]; - - proofLevels(value?: ArchivalProofNode[][]): ArchivalProofNode[][]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): NonexistenceProofBody; - - static write(value: NonexistenceProofBody, io: Buffer): void; - - static isValid(value: NonexistenceProofBody): boolean; - - static toXDR(value: NonexistenceProofBody): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): NonexistenceProofBody; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): NonexistenceProofBody; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class ExistenceProofBody { + class SorobanResources { constructor(attributes: { - keysToProve: LedgerKey[]; - lowBoundEntries: ColdArchiveBucketEntry[]; - highBoundEntries: ColdArchiveBucketEntry[]; - proofLevels: ArchivalProofNode[][]; + footprint: LedgerFootprint; + instructions: number; + diskReadBytes: number; + writeBytes: number; }); - keysToProve(value?: LedgerKey[]): LedgerKey[]; - - lowBoundEntries(value?: ColdArchiveBucketEntry[]): ColdArchiveBucketEntry[]; - - highBoundEntries( - value?: ColdArchiveBucketEntry[], - ): ColdArchiveBucketEntry[]; - - proofLevels(value?: ArchivalProofNode[][]): ArchivalProofNode[][]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ExistenceProofBody; - - static write(value: ExistenceProofBody, io: Buffer): void; - - static isValid(value: ExistenceProofBody): boolean; - - static toXDR(value: ExistenceProofBody): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ExistenceProofBody; - - static fromXDR(input: string, format: 'hex' | 'base64'): ExistenceProofBody; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } + footprint(value?: LedgerFootprint): LedgerFootprint; - class ArchivalProof { - constructor(attributes: { epoch: number; body: ArchivalProofBody }); + instructions(value?: number): number; - epoch(value?: number): number; + diskReadBytes(value?: number): number; - body(value?: ArchivalProofBody): ArchivalProofBody; + writeBytes(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ArchivalProof; + static read(io: Buffer): SorobanResources; - static write(value: ArchivalProof, io: Buffer): void; + static write(value: SorobanResources, io: Buffer): void; - static isValid(value: ArchivalProof): boolean; + static isValid(value: SorobanResources): boolean; - static toXDR(value: ArchivalProof): Buffer; + static toXDR(value: SorobanResources): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ArchivalProof; + static fromXDR(input: Buffer, format?: 'raw'): SorobanResources; - static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProof; + static fromXDR(input: string, format: 'hex' | 'base64'): SorobanResources; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SorobanResources { - constructor(attributes: { - footprint: LedgerFootprint; - instructions: number; - readBytes: number; - writeBytes: number; - }); - - footprint(value?: LedgerFootprint): LedgerFootprint; - - instructions(value?: number): number; - - readBytes(value?: number): number; + class SorobanResourcesExtV0 { + constructor(attributes: { archivedSorobanEntries: number[] }); - writeBytes(value?: number): number; + archivedSorobanEntries(value?: number[]): number[]; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SorobanResources; + static read(io: Buffer): SorobanResourcesExtV0; - static write(value: SorobanResources, io: Buffer): void; + static write(value: SorobanResourcesExtV0, io: Buffer): void; - static isValid(value: SorobanResources): boolean; + static isValid(value: SorobanResourcesExtV0): boolean; - static toXDR(value: SorobanResources): Buffer; + static toXDR(value: SorobanResourcesExtV0): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): SorobanResources; + static fromXDR(input: Buffer, format?: 'raw'): SorobanResourcesExtV0; - static fromXDR(input: string, format: 'hex' | 'base64'): SorobanResources; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanResourcesExtV0; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -9387,6 +9239,37 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class MuxedEd25519Account { + constructor(attributes: { id: Uint64; ed25519: Buffer }); + + id(value?: Uint64): Uint64; + + ed25519(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): MuxedEd25519Account; + + static write(value: MuxedEd25519Account, io: Buffer): void; + + static isValid(value: MuxedEd25519Account): boolean; + + static toXDR(value: MuxedEd25519Account): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): MuxedEd25519Account; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): MuxedEd25519Account; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScNonceKey { constructor(attributes: { nonce: Int64 }); @@ -10081,49 +9964,129 @@ export namespace xdr { static toXDR(value: ScSpecFunctionInputV0): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionInputV0; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionInputV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecFunctionInputV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecFunctionV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + inputs: ScSpecFunctionInputV0[]; + outputs: ScSpecTypeDef[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + inputs(value?: ScSpecFunctionInputV0[]): ScSpecFunctionInputV0[]; + + outputs(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecFunctionV0; + + static write(value: ScSpecFunctionV0, io: Buffer): void; + + static isValid(value: ScSpecFunctionV0): boolean; + + static toXDR(value: ScSpecFunctionV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecFunctionV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecEventParamV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef; + location: ScSpecEventParamLocationV0; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef): ScSpecTypeDef; + + location(value?: ScSpecEventParamLocationV0): ScSpecEventParamLocationV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecEventParamV0; + + static write(value: ScSpecEventParamV0, io: Buffer): void; + + static isValid(value: ScSpecEventParamV0): boolean; + + static toXDR(value: ScSpecEventParamV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecEventParamV0; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ScSpecFunctionInputV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecEventParamV0; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecFunctionV0 { + class ScSpecEventV0 { constructor(attributes: { doc: string | Buffer; + lib: string | Buffer; name: string | Buffer; - inputs: ScSpecFunctionInputV0[]; - outputs: ScSpecTypeDef[]; + prefixTopics: (string | Buffer)[]; + params: ScSpecEventParamV0[]; + dataFormat: ScSpecEventDataFormat; }); doc(value?: string | Buffer): string | Buffer; + lib(value?: string | Buffer): string | Buffer; + name(value?: string | Buffer): string | Buffer; - inputs(value?: ScSpecFunctionInputV0[]): ScSpecFunctionInputV0[]; + prefixTopics(value?: (string | Buffer)[]): (string | Buffer)[]; - outputs(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + params(value?: ScSpecEventParamV0[]): ScSpecEventParamV0[]; + + dataFormat(value?: ScSpecEventDataFormat): ScSpecEventDataFormat; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecFunctionV0; + static read(io: Buffer): ScSpecEventV0; - static write(value: ScSpecFunctionV0, io: Buffer): void; + static write(value: ScSpecEventV0, io: Buffer): void; - static isValid(value: ScSpecFunctionV0): boolean; + static isValid(value: ScSpecEventV0): boolean; - static toXDR(value: ScSpecFunctionV0): Buffer; + static toXDR(value: ScSpecEventV0): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionV0; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecEventV0; - static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecFunctionV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecEventV0; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -10209,9 +10172,9 @@ export namespace xdr { } class ConfigSettingContractParallelComputeV0 { - constructor(attributes: { ledgerMaxParallelThreads: number }); + constructor(attributes: { ledgerMaxDependentTxClusters: number }); - ledgerMaxParallelThreads(value?: number): number; + ledgerMaxDependentTxClusters(value?: number): number; toXDR(format?: 'raw'): Buffer; @@ -10245,52 +10208,52 @@ export namespace xdr { class ConfigSettingContractLedgerCostV0 { constructor(attributes: { - ledgerMaxReadLedgerEntries: number; - ledgerMaxReadBytes: number; + ledgerMaxDiskReadEntries: number; + ledgerMaxDiskReadBytes: number; ledgerMaxWriteLedgerEntries: number; ledgerMaxWriteBytes: number; - txMaxReadLedgerEntries: number; - txMaxReadBytes: number; + txMaxDiskReadEntries: number; + txMaxDiskReadBytes: number; txMaxWriteLedgerEntries: number; txMaxWriteBytes: number; - feeReadLedgerEntry: Int64; + feeDiskReadLedgerEntry: Int64; feeWriteLedgerEntry: Int64; - feeRead1Kb: Int64; - bucketListTargetSizeBytes: Int64; - writeFee1KbBucketListLow: Int64; - writeFee1KbBucketListHigh: Int64; - bucketListWriteFeeGrowthFactor: number; + feeDiskRead1Kb: Int64; + sorobanStateTargetSizeBytes: Int64; + rentFee1KbSorobanStateSizeLow: Int64; + rentFee1KbSorobanStateSizeHigh: Int64; + sorobanStateRentFeeGrowthFactor: number; }); - ledgerMaxReadLedgerEntries(value?: number): number; + ledgerMaxDiskReadEntries(value?: number): number; - ledgerMaxReadBytes(value?: number): number; + ledgerMaxDiskReadBytes(value?: number): number; ledgerMaxWriteLedgerEntries(value?: number): number; ledgerMaxWriteBytes(value?: number): number; - txMaxReadLedgerEntries(value?: number): number; + txMaxDiskReadEntries(value?: number): number; - txMaxReadBytes(value?: number): number; + txMaxDiskReadBytes(value?: number): number; txMaxWriteLedgerEntries(value?: number): number; txMaxWriteBytes(value?: number): number; - feeReadLedgerEntry(value?: Int64): Int64; + feeDiskReadLedgerEntry(value?: Int64): Int64; feeWriteLedgerEntry(value?: Int64): Int64; - feeRead1Kb(value?: Int64): Int64; + feeDiskRead1Kb(value?: Int64): Int64; - bucketListTargetSizeBytes(value?: Int64): Int64; + sorobanStateTargetSizeBytes(value?: Int64): Int64; - writeFee1KbBucketListLow(value?: Int64): Int64; + rentFee1KbSorobanStateSizeLow(value?: Int64): Int64; - writeFee1KbBucketListHigh(value?: Int64): Int64; + rentFee1KbSorobanStateSizeHigh(value?: Int64): Int64; - bucketListWriteFeeGrowthFactor(value?: number): number; + sorobanStateRentFeeGrowthFactor(value?: number): number; toXDR(format?: 'raw'): Buffer; @@ -10319,6 +10282,43 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ConfigSettingContractLedgerCostExtV0 { + constructor(attributes: { + txMaxFootprintEntries: number; + feeWrite1Kb: Int64; + }); + + txMaxFootprintEntries(value?: number): number; + + feeWrite1Kb(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractLedgerCostExtV0; + + static write(value: ConfigSettingContractLedgerCostExtV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractLedgerCostExtV0): boolean; + + static toXDR(value: ConfigSettingContractLedgerCostExtV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractLedgerCostExtV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractLedgerCostExtV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ConfigSettingContractHistoricalDataV0 { constructor(attributes: { feeHistorical1Kb: Int64 }); @@ -10476,8 +10476,8 @@ export namespace xdr { persistentRentRateDenominator: Int64; tempRentRateDenominator: Int64; maxEntriesToArchive: number; - bucketListSizeWindowSampleSize: number; - bucketListWindowSamplePeriod: number; + liveSorobanStateSizeWindowSampleSize: number; + liveSorobanStateSizeWindowSamplePeriod: number; evictionScanSize: number; startingEvictionScanLevel: number; }); @@ -10494,9 +10494,9 @@ export namespace xdr { maxEntriesToArchive(value?: number): number; - bucketListSizeWindowSampleSize(value?: number): number; + liveSorobanStateSizeWindowSampleSize(value?: number): number; - bucketListWindowSamplePeriod(value?: number): number; + liveSorobanStateSizeWindowSamplePeriod(value?: number): number; evictionScanSize(value?: number): number; @@ -10560,6 +10560,86 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ConfigSettingScpTiming { + constructor(attributes: { + ledgerTargetCloseTimeMilliseconds: number; + nominationTimeoutInitialMilliseconds: number; + nominationTimeoutIncrementMilliseconds: number; + ballotTimeoutInitialMilliseconds: number; + ballotTimeoutIncrementMilliseconds: number; + }); + + ledgerTargetCloseTimeMilliseconds(value?: number): number; + + nominationTimeoutInitialMilliseconds(value?: number): number; + + nominationTimeoutIncrementMilliseconds(value?: number): number; + + ballotTimeoutInitialMilliseconds(value?: number): number; + + ballotTimeoutIncrementMilliseconds(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingScpTiming; + + static write(value: ConfigSettingScpTiming, io: Buffer): void; + + static isValid(value: ConfigSettingScpTiming): boolean; + + static toXDR(value: ConfigSettingScpTiming): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ConfigSettingScpTiming; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingScpTiming; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerCloseMetaBatch { + constructor(attributes: { + startSequence: number; + endSequence: number; + ledgerCloseMeta: LedgerCloseMeta[]; + }); + + startSequence(value?: number): number; + + endSequence(value?: number): number; + + ledgerCloseMeta(value?: LedgerCloseMeta[]): LedgerCloseMeta[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerCloseMetaBatch; + + static write(value: LedgerCloseMetaBatch, io: Buffer): void; + + static isValid(value: LedgerCloseMetaBatch): boolean; + + static toXDR(value: LedgerCloseMetaBatch): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaBatch; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerCloseMetaBatch; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScpStatementPledges { switch(): ScpStatementType; @@ -11062,36 +11142,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimableBalanceId { - switch(): ClaimableBalanceIdType; - - v0(value?: Buffer): Buffer; - - static claimableBalanceIdTypeV0(value: Buffer): ClaimableBalanceId; - - value(): Buffer; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ClaimableBalanceId; - - static write(value: ClaimableBalanceId, io: Buffer): void; - - static isValid(value: ClaimableBalanceId): boolean; - - static toXDR(value: ClaimableBalanceId): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceId; - - static fromXDR(input: string, format: 'hex' | 'base64'): ClaimableBalanceId; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class ClaimableBalanceEntryExtensionV1Ext { switch(): number; @@ -11537,8 +11587,6 @@ export namespace xdr { static hotArchiveLive(value: LedgerKey): HotArchiveBucketEntry; - static hotArchiveDeleted(value: LedgerKey): HotArchiveBucketEntry; - static hotArchiveMetaentry(value: BucketMetadata): HotArchiveBucketEntry; value(): LedgerEntry | LedgerKey | BucketMetadata; @@ -11567,66 +11615,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ColdArchiveBucketEntry { - switch(): ColdArchiveBucketEntryType; - - metaEntry(value?: BucketMetadata): BucketMetadata; - - archivedLeaf(value?: ColdArchiveArchivedLeaf): ColdArchiveArchivedLeaf; - - deletedLeaf(value?: ColdArchiveDeletedLeaf): ColdArchiveDeletedLeaf; - - boundaryLeaf(value?: ColdArchiveBoundaryLeaf): ColdArchiveBoundaryLeaf; - - hashEntry(value?: ColdArchiveHashEntry): ColdArchiveHashEntry; - - static coldArchiveMetaentry(value: BucketMetadata): ColdArchiveBucketEntry; - - static coldArchiveArchivedLeaf( - value: ColdArchiveArchivedLeaf, - ): ColdArchiveBucketEntry; - - static coldArchiveDeletedLeaf( - value: ColdArchiveDeletedLeaf, - ): ColdArchiveBucketEntry; - - static coldArchiveBoundaryLeaf( - value: ColdArchiveBoundaryLeaf, - ): ColdArchiveBucketEntry; - - static coldArchiveHash(value: ColdArchiveHashEntry): ColdArchiveBucketEntry; - - value(): - | BucketMetadata - | ColdArchiveArchivedLeaf - | ColdArchiveDeletedLeaf - | ColdArchiveBoundaryLeaf - | ColdArchiveHashEntry; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ColdArchiveBucketEntry; - - static write(value: ColdArchiveBucketEntry, io: Buffer): void; - - static isValid(value: ColdArchiveBucketEntry): boolean; - - static toXDR(value: ColdArchiveBucketEntry): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveBucketEntry; - - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): ColdArchiveBucketEntry; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class StellarValueExt { switch(): StellarValueType; @@ -12031,6 +12019,8 @@ export namespace xdr { state(value?: LedgerEntry): LedgerEntry; + restored(value?: LedgerEntry): LedgerEntry; + static ledgerEntryCreated(value: LedgerEntry): LedgerEntryChange; static ledgerEntryUpdated(value: LedgerEntry): LedgerEntryChange; @@ -12039,7 +12029,9 @@ export namespace xdr { static ledgerEntryState(value: LedgerEntry): LedgerEntryChange; - value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry; + static ledgerEntryRestored(value: LedgerEntry): LedgerEntryChange; + + value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry | LedgerEntry; toXDR(format?: 'raw'): Buffer; @@ -12138,6 +12130,8 @@ export namespace xdr { v3(value?: TransactionMetaV3): TransactionMetaV3; + v4(value?: TransactionMetaV4): TransactionMetaV4; + static 0(value: OperationMeta[]): TransactionMeta; static 1(value: TransactionMetaV1): TransactionMeta; @@ -12146,11 +12140,14 @@ export namespace xdr { static 3(value: TransactionMetaV3): TransactionMeta; + static 4(value: TransactionMetaV4): TransactionMeta; + value(): | OperationMeta[] | TransactionMetaV1 | TransactionMetaV2 - | TransactionMetaV3; + | TransactionMetaV3 + | TransactionMetaV4; toXDR(format?: 'raw'): Buffer; @@ -12212,11 +12209,15 @@ export namespace xdr { v1(value?: LedgerCloseMetaV1): LedgerCloseMetaV1; + v2(value?: LedgerCloseMetaV2): LedgerCloseMetaV2; + static 0(value: LedgerCloseMetaV0): LedgerCloseMeta; static 1(value: LedgerCloseMetaV1): LedgerCloseMeta; - value(): LedgerCloseMetaV0 | LedgerCloseMetaV1; + static 2(value: LedgerCloseMetaV2): LedgerCloseMeta; + + value(): LedgerCloseMetaV0 | LedgerCloseMetaV1 | LedgerCloseMetaV2; toXDR(format?: 'raw'): Buffer; @@ -12276,34 +12277,15 @@ export namespace xdr { class SurveyResponseBody { switch(): SurveyMessageResponseType; - topologyResponseBodyV0( - value?: TopologyResponseBodyV0, - ): TopologyResponseBodyV0; - - topologyResponseBodyV1( - value?: TopologyResponseBodyV1, - ): TopologyResponseBodyV1; - topologyResponseBodyV2( value?: TopologyResponseBodyV2, ): TopologyResponseBodyV2; - static surveyTopologyResponseV0( - value: TopologyResponseBodyV0, - ): SurveyResponseBody; - - static surveyTopologyResponseV1( - value: TopologyResponseBodyV1, - ): SurveyResponseBody; - static surveyTopologyResponseV2( value: TopologyResponseBodyV2, ): SurveyResponseBody; - value(): - | TopologyResponseBodyV0 - | TopologyResponseBodyV1 - | TopologyResponseBodyV2; + value(): TopologyResponseBodyV2; toXDR(format?: 'raw'): Buffer; @@ -12349,14 +12331,6 @@ export namespace xdr { transaction(value?: TransactionEnvelope): TransactionEnvelope; - signedSurveyRequestMessage( - value?: SignedSurveyRequestMessage, - ): SignedSurveyRequestMessage; - - signedSurveyResponseMessage( - value?: SignedSurveyResponseMessage, - ): SignedSurveyResponseMessage; - signedTimeSlicedSurveyRequestMessage( value?: SignedTimeSlicedSurveyRequestMessage, ): SignedTimeSlicedSurveyRequestMessage; @@ -12397,8 +12371,6 @@ export namespace xdr { static dontHave(value: DontHave): StellarMessage; - static getPeers(): StellarMessage; - static peers(value: PeerAddress[]): StellarMessage; static getTxSet(value: Buffer): StellarMessage; @@ -12409,10 +12381,6 @@ export namespace xdr { static transaction(value: TransactionEnvelope): StellarMessage; - static surveyRequest(value: SignedSurveyRequestMessage): StellarMessage; - - static surveyResponse(value: SignedSurveyResponseMessage): StellarMessage; - static timeSlicedSurveyRequest( value: SignedTimeSlicedSurveyRequestMessage, ): StellarMessage; @@ -12455,8 +12423,6 @@ export namespace xdr { | TransactionSet | GeneralizedTransactionSet | TransactionEnvelope - | SignedSurveyRequestMessage - | SignedSurveyResponseMessage | SignedTimeSlicedSurveyRequestMessage | SignedTimeSlicedSurveyResponseMessage | SignedTimeSlicedSurveyStartCollectingMessage @@ -12468,8 +12434,7 @@ export namespace xdr { | SendMore | SendMoreExtended | FloodAdvert - | FloodDemand - | void; + | FloodDemand; toXDR(format?: 'raw'): Buffer; @@ -13164,50 +13129,16 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ArchivalProofBody { - switch(): ArchivalProofType; - - nonexistenceProof(value?: NonexistenceProofBody): NonexistenceProofBody; - - existenceProof(value?: ExistenceProofBody): ExistenceProofBody; - - static existence(value: NonexistenceProofBody): ArchivalProofBody; - - static nonexistence(value: ExistenceProofBody): ArchivalProofBody; - - value(): NonexistenceProofBody | ExistenceProofBody; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): ArchivalProofBody; - - static write(value: ArchivalProofBody, io: Buffer): void; - - static isValid(value: ArchivalProofBody): boolean; - - static toXDR(value: ArchivalProofBody): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): ArchivalProofBody; - - static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProofBody; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class SorobanTransactionDataExt { switch(): number; - proofs(value?: ArchivalProof[]): ArchivalProof[]; + resourceExt(value?: SorobanResourcesExtV0): SorobanResourcesExtV0; static 0(): SorobanTransactionDataExt; - static 1(value: ArchivalProof[]): SorobanTransactionDataExt; + static 1(value: SorobanResourcesExtV0): SorobanTransactionDataExt; - value(): ArchivalProof[] | void; + value(): SorobanResourcesExtV0 | void; toXDR(format?: 'raw'): Buffer; @@ -15230,6 +15161,36 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ClaimableBalanceId { + switch(): ClaimableBalanceIdType; + + v0(value?: Buffer): Buffer; + + static claimableBalanceIdTypeV0(value: Buffer): ClaimableBalanceId; + + value(): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimableBalanceId; + + static write(value: ClaimableBalanceId, io: Buffer): void; + + static isValid(value: ClaimableBalanceId): boolean; + + static toXDR(value: ClaimableBalanceId): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceId; + + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimableBalanceId; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScError { switch(): ScErrorType; @@ -15317,13 +15278,30 @@ export namespace xdr { accountId(value?: AccountId): AccountId; - contractId(value?: Buffer): Buffer; + contractId(value?: ContractId): ContractId; + + muxedAccount(value?: MuxedEd25519Account): MuxedEd25519Account; + + claimableBalanceId(value?: ClaimableBalanceId): ClaimableBalanceId; + + liquidityPoolId(value?: PoolId): PoolId; static scAddressTypeAccount(value: AccountId): ScAddress; - static scAddressTypeContract(value: Buffer): ScAddress; + static scAddressTypeContract(value: ContractId): ScAddress; + + static scAddressTypeMuxedAccount(value: MuxedEd25519Account): ScAddress; + + static scAddressTypeClaimableBalance(value: ClaimableBalanceId): ScAddress; + + static scAddressTypeLiquidityPool(value: PoolId): ScAddress; - value(): AccountId | Buffer; + value(): + | AccountId + | ContractId + | MuxedEd25519Account + | ClaimableBalanceId + | PoolId; toXDR(format?: 'raw'): Buffer; @@ -15385,10 +15363,10 @@ export namespace xdr { address(value?: ScAddress): ScAddress; - nonceKey(value?: ScNonceKey): ScNonceKey; - instance(value?: ScContractInstance): ScContractInstance; + nonceKey(value?: ScNonceKey): ScNonceKey; + static scvBool(value: boolean): ScVal; static scvVoid(): ScVal; @@ -15427,12 +15405,12 @@ export namespace xdr { static scvAddress(value: ScAddress): ScVal; + static scvContractInstance(value: ScContractInstance): ScVal; + static scvLedgerKeyContractInstance(): ScVal; static scvLedgerKeyNonce(value: ScNonceKey): ScVal; - static scvContractInstance(value: ScContractInstance): ScVal; - value(): | boolean | ScError @@ -15456,8 +15434,8 @@ export namespace xdr { | null | ScMapEntry[] | ScAddress - | ScNonceKey | ScContractInstance + | ScNonceKey | void; toXDR(format?: 'raw'): Buffer; @@ -15598,6 +15576,8 @@ export namespace xdr { static scSpecTypeAddress(): ScSpecTypeDef; + static scSpecTypeMuxedAddress(): ScSpecTypeDef; + static scSpecTypeOption(value: ScSpecTypeOption): ScSpecTypeDef; static scSpecTypeResult(value: ScSpecTypeResult): ScSpecTypeDef; @@ -15697,6 +15677,8 @@ export namespace xdr { udtErrorEnumV0(value?: ScSpecUdtErrorEnumV0): ScSpecUdtErrorEnumV0; + eventV0(value?: ScSpecEventV0): ScSpecEventV0; + static scSpecEntryFunctionV0(value: ScSpecFunctionV0): ScSpecEntry; static scSpecEntryUdtStructV0(value: ScSpecUdtStructV0): ScSpecEntry; @@ -15707,12 +15689,15 @@ export namespace xdr { static scSpecEntryUdtErrorEnumV0(value: ScSpecUdtErrorEnumV0): ScSpecEntry; + static scSpecEntryEventV0(value: ScSpecEventV0): ScSpecEntry; + value(): | ScSpecFunctionV0 | ScSpecUdtStructV0 | ScSpecUdtUnionV0 | ScSpecUdtEnumV0 - | ScSpecUdtErrorEnumV0; + | ScSpecUdtErrorEnumV0 + | ScSpecEventV0; toXDR(format?: 'raw'): Buffer; @@ -15778,7 +15763,7 @@ export namespace xdr { value?: ConfigSettingContractExecutionLanesV0, ): ConfigSettingContractExecutionLanesV0; - bucketListSizeWindow(value?: Uint64[]): Uint64[]; + liveSorobanStateSizeWindow(value?: Uint64[]): Uint64[]; evictionIterator(value?: EvictionIterator): EvictionIterator; @@ -15786,6 +15771,12 @@ export namespace xdr { value?: ConfigSettingContractParallelComputeV0, ): ConfigSettingContractParallelComputeV0; + contractLedgerCostExt( + value?: ConfigSettingContractLedgerCostExtV0, + ): ConfigSettingContractLedgerCostExtV0; + + contractScpTiming(value?: ConfigSettingScpTiming): ConfigSettingScpTiming; + static configSettingContractMaxSizeBytes(value: number): ConfigSettingEntry; static configSettingContractComputeV0( @@ -15832,7 +15823,7 @@ export namespace xdr { value: ConfigSettingContractExecutionLanesV0, ): ConfigSettingEntry; - static configSettingBucketlistSizeWindow( + static configSettingLiveSorobanStateSizeWindow( value: Uint64[], ): ConfigSettingEntry; @@ -15844,6 +15835,14 @@ export namespace xdr { value: ConfigSettingContractParallelComputeV0, ): ConfigSettingEntry; + static configSettingContractLedgerCostExtV0( + value: ConfigSettingContractLedgerCostExtV0, + ): ConfigSettingEntry; + + static configSettingScpTiming( + value: ConfigSettingScpTiming, + ): ConfigSettingEntry; + value(): | number | ConfigSettingContractComputeV0 @@ -15859,7 +15858,9 @@ export namespace xdr { | ConfigSettingContractExecutionLanesV0 | Uint64[] | EvictionIterator - | ConfigSettingContractParallelComputeV0; + | ConfigSettingContractParallelComputeV0 + | ConfigSettingContractLedgerCostExtV0 + | ConfigSettingScpTiming; toXDR(format?: 'raw'): Buffer; diff --git a/xdr/curr/Stellar-contract-config-setting.x b/xdr/curr/Stellar-contract-config-setting.x index 9f09c7b0..b075c6b4 100644 --- a/xdr/curr/Stellar-contract-config-setting.x +++ b/xdr/curr/Stellar-contract-config-setting.x @@ -23,41 +23,62 @@ struct ConfigSettingContractComputeV0 uint32 txMemoryLimit; }; +// Settings for running the contract transactions in parallel. +struct ConfigSettingContractParallelComputeV0 +{ + // Maximum number of clusters with dependent transactions allowed in a + // stage of parallel tx set component. + // This effectively sets the lower bound on the number of physical threads + // necessary to effectively apply transaction sets in parallel. + uint32 ledgerMaxDependentTxClusters; +}; + // Ledger access settings for contracts. struct ConfigSettingContractLedgerCostV0 { - // Maximum number of ledger entry read operations per ledger - uint32 ledgerMaxReadLedgerEntries; - // Maximum number of bytes that can be read per ledger - uint32 ledgerMaxReadBytes; + // Maximum number of disk entry read operations per ledger + uint32 ledgerMaxDiskReadEntries; + // Maximum number of bytes of disk reads that can be performed per ledger + uint32 ledgerMaxDiskReadBytes; // Maximum number of ledger entry write operations per ledger uint32 ledgerMaxWriteLedgerEntries; // Maximum number of bytes that can be written per ledger uint32 ledgerMaxWriteBytes; - // Maximum number of ledger entry read operations per transaction - uint32 txMaxReadLedgerEntries; - // Maximum number of bytes that can be read per transaction - uint32 txMaxReadBytes; + // Maximum number of disk entry read operations per transaction + uint32 txMaxDiskReadEntries; + // Maximum number of bytes of disk reads that can be performed per transaction + uint32 txMaxDiskReadBytes; // Maximum number of ledger entry write operations per transaction uint32 txMaxWriteLedgerEntries; // Maximum number of bytes that can be written per transaction uint32 txMaxWriteBytes; - int64 feeReadLedgerEntry; // Fee per ledger entry read - int64 feeWriteLedgerEntry; // Fee per ledger entry write + int64 feeDiskReadLedgerEntry; // Fee per disk ledger entry read + int64 feeWriteLedgerEntry; // Fee per ledger entry write - int64 feeRead1KB; // Fee for reading 1KB + int64 feeDiskRead1KB; // Fee for reading 1KB disk // The following parameters determine the write fee per 1KB. - // Write fee grows linearly until bucket list reaches this size - int64 bucketListTargetSizeBytes; - // Fee per 1KB write when the bucket list is empty - int64 writeFee1KBBucketListLow; - // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` - int64 writeFee1KBBucketListHigh; - // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` - uint32 bucketListWriteFeeGrowthFactor; + // Rent fee grows linearly until soroban state reaches this size + int64 sorobanStateTargetSizeBytes; + // Fee per 1KB rent when the soroban state is empty + int64 rentFee1KBSorobanStateSizeLow; + // Fee per 1KB rent when the soroban state has reached `sorobanStateTargetSizeBytes` + int64 rentFee1KBSorobanStateSizeHigh; + // Rent fee multiplier for any additional data past the first `sorobanStateTargetSizeBytes` + uint32 sorobanStateRentFeeGrowthFactor; +}; + +// Ledger access settings for contracts. +struct ConfigSettingContractLedgerCostExtV0 +{ + // Maximum number of RO+RW entries in the transaction footprint. + uint32 txMaxFootprintEntries; + // Fee per 1 KB of data written to the ledger. + // Unlike the rent fee, this is a flat fee that is charged for any ledger + // write, independent of the type of the entry being written. + int64 feeWrite1KB; }; // Historical data (pushed to core archives) settings for contracts. @@ -262,11 +283,11 @@ struct StateArchivalSettings { // max number of entries that emit archival meta in a single ledger uint32 maxEntriesToArchive; - // Number of snapshots to use when calculating average BucketList size - uint32 bucketListSizeWindowSampleSize; + // Number of snapshots to use when calculating average live Soroban State size + uint32 liveSorobanStateSizeWindowSampleSize; - // How often to sample the BucketList size for the average, in ledgers - uint32 bucketListWindowSamplePeriod; + // How often to sample the live Soroban State size for the average, in ledgers + uint32 liveSorobanStateSizeWindowSamplePeriod; // Maximum number of bytes that we scan for eviction per ledger uint32 evictionScanSize; @@ -281,6 +302,14 @@ struct EvictionIterator { uint64 bucketFileOffset; }; +struct ConfigSettingSCPTiming { + uint32 ledgerTargetCloseTimeMilliseconds; + uint32 nominationTimeoutInitialMilliseconds; + uint32 nominationTimeoutIncrementMilliseconds; + uint32 ballotTimeoutInitialMilliseconds; + uint32 ballotTimeoutIncrementMilliseconds; +}; + // limits the ContractCostParams size to 20kB const CONTRACT_COST_COUNT_LIMIT = 1024; @@ -301,8 +330,11 @@ enum ConfigSettingID CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, CONFIG_SETTING_STATE_ARCHIVAL = 10, CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, - CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, - CONFIG_SETTING_EVICTION_ITERATOR = 13 + CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW = 12, + CONFIG_SETTING_EVICTION_ITERATOR = 13, + CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14, + CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0 = 15, + CONFIG_SETTING_SCP_TIMING = 16 }; union ConfigSettingEntry switch (ConfigSettingID configSettingID) @@ -331,9 +363,15 @@ case CONFIG_SETTING_STATE_ARCHIVAL: StateArchivalSettings stateArchivalSettings; case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: ConfigSettingContractExecutionLanesV0 contractExecutionLanes; -case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: - uint64 bucketListSizeWindow<>; +case CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW: + uint64 liveSorobanStateSizeWindow<>; case CONFIG_SETTING_EVICTION_ITERATOR: EvictionIterator evictionIterator; +case CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0: + ConfigSettingContractParallelComputeV0 contractParallelCompute; +case CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0: + ConfigSettingContractLedgerCostExtV0 contractLedgerCostExt; +case CONFIG_SETTING_SCP_TIMING: + ConfigSettingSCPTiming contractSCPTiming; }; } diff --git a/xdr/curr/Stellar-contract-spec.x b/xdr/curr/Stellar-contract-spec.x index 6988a633..ce6e0307 100644 --- a/xdr/curr/Stellar-contract-spec.x +++ b/xdr/curr/Stellar-contract-spec.x @@ -34,6 +34,7 @@ enum SCSpecType SC_SPEC_TYPE_STRING = 16, SC_SPEC_TYPE_SYMBOL = 17, SC_SPEC_TYPE_ADDRESS = 19, + SC_SPEC_TYPE_MUXED_ADDRESS = 20, // Types with parameters. SC_SPEC_TYPE_OPTION = 1000, @@ -104,6 +105,7 @@ case SC_SPEC_TYPE_BYTES: case SC_SPEC_TYPE_STRING: case SC_SPEC_TYPE_SYMBOL: case SC_SPEC_TYPE_ADDRESS: +case SC_SPEC_TYPE_MUXED_ADDRESS: void; case SC_SPEC_TYPE_OPTION: SCSpecTypeOption option; @@ -216,13 +218,45 @@ struct SCSpecFunctionV0 SCSpecTypeDef outputs<1>; }; +enum SCSpecEventParamLocationV0 +{ + SC_SPEC_EVENT_PARAM_LOCATION_DATA = 0, + SC_SPEC_EVENT_PARAM_LOCATION_TOPIC_LIST = 1 +}; + +struct SCSpecEventParamV0 +{ + string doc; + string name<30>; + SCSpecTypeDef type; + SCSpecEventParamLocationV0 location; +}; + +enum SCSpecEventDataFormat +{ + SC_SPEC_EVENT_DATA_FORMAT_SINGLE_VALUE = 0, + SC_SPEC_EVENT_DATA_FORMAT_VEC = 1, + SC_SPEC_EVENT_DATA_FORMAT_MAP = 2 +}; + +struct SCSpecEventV0 +{ + string doc; + string lib<80>; + SCSymbol name; + SCSymbol prefixTopics<2>; + SCSpecEventParamV0 params<50>; + SCSpecEventDataFormat dataFormat; +}; + enum SCSpecEntryKind { SC_SPEC_ENTRY_FUNCTION_V0 = 0, SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, SC_SPEC_ENTRY_UDT_UNION_V0 = 2, SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, - SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 + SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4, + SC_SPEC_ENTRY_EVENT_V0 = 5 }; union SCSpecEntry switch (SCSpecEntryKind kind) @@ -237,6 +271,8 @@ case SC_SPEC_ENTRY_UDT_ENUM_V0: SCSpecUDTEnumV0 udtEnumV0; case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: SCSpecUDTErrorEnumV0 udtErrorEnumV0; +case SC_SPEC_ENTRY_EVENT_V0: + SCSpecEventV0 eventV0; }; } diff --git a/xdr/curr/Stellar-contract.x b/xdr/curr/Stellar-contract.x index 51130056..0e67dc3f 100644 --- a/xdr/curr/Stellar-contract.x +++ b/xdr/curr/Stellar-contract.x @@ -179,7 +179,16 @@ case CONTRACT_EXECUTABLE_STELLAR_ASSET: enum SCAddressType { SC_ADDRESS_TYPE_ACCOUNT = 0, - SC_ADDRESS_TYPE_CONTRACT = 1 + SC_ADDRESS_TYPE_CONTRACT = 1, + SC_ADDRESS_TYPE_MUXED_ACCOUNT = 2, + SC_ADDRESS_TYPE_CLAIMABLE_BALANCE = 3, + SC_ADDRESS_TYPE_LIQUIDITY_POOL = 4 +}; + +struct MuxedEd25519Account +{ + uint64 id; + uint256 ed25519; }; union SCAddress switch (SCAddressType type) @@ -187,7 +196,13 @@ union SCAddress switch (SCAddressType type) case SC_ADDRESS_TYPE_ACCOUNT: AccountID accountId; case SC_ADDRESS_TYPE_CONTRACT: - Hash contractId; + ContractID contractId; +case SC_ADDRESS_TYPE_MUXED_ACCOUNT: + MuxedEd25519Account muxedAccount; +case SC_ADDRESS_TYPE_CLAIMABLE_BALANCE: + ClaimableBalanceID claimableBalanceId; +case SC_ADDRESS_TYPE_LIQUIDITY_POOL: + PoolID liquidityPoolId; }; %struct SCVal; @@ -264,13 +279,12 @@ case SCV_ADDRESS: // Special SCVals reserved for system-constructed contract-data // ledger keys, not generally usable elsewhere. +case SCV_CONTRACT_INSTANCE: + SCContractInstance instance; case SCV_LEDGER_KEY_CONTRACT_INSTANCE: void; case SCV_LEDGER_KEY_NONCE: SCNonceKey nonce_key; - -case SCV_CONTRACT_INSTANCE: - SCContractInstance instance; }; struct SCMapEntry diff --git a/xdr/curr/Stellar-exporter.x b/xdr/curr/Stellar-exporter.x new file mode 100644 index 00000000..4ac92654 --- /dev/null +++ b/xdr/curr/Stellar-exporter.x @@ -0,0 +1,23 @@ +// Copyright 2024 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +%#include "xdr/Stellar-ledger.h" + +namespace stellar +{ + +// Batch of ledgers along with their transaction metadata +struct LedgerCloseMetaBatch +{ + // starting ledger sequence number in the batch + uint32 startSequence; + + // ending ledger sequence number in the batch + uint32 endSequence; + + // Ledger close meta for each ledger within the batch + LedgerCloseMeta ledgerCloseMetas<>; +}; + +} diff --git a/xdr/curr/Stellar-ledger-entries.x b/xdr/curr/Stellar-ledger-entries.x index 5bf4f9d3..b9a9a168 100644 --- a/xdr/curr/Stellar-ledger-entries.x +++ b/xdr/curr/Stellar-ledger-entries.x @@ -14,7 +14,6 @@ typedef string string32<32>; typedef string string64<64>; typedef int64 SequenceNumber; typedef opaque DataValue<64>; -typedef Hash PoolID; // SHA256(LiquidityPoolParameters) // 1-4 alphanumeric characters right-padded with 0 bytes typedef opaque AssetCode4[4]; @@ -409,17 +408,6 @@ case CLAIMANT_TYPE_V0: } v0; }; -enum ClaimableBalanceIDType -{ - CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 -}; - -union ClaimableBalanceID switch (ClaimableBalanceIDType type) -{ -case CLAIMABLE_BALANCE_ID_TYPE_V0: - Hash v0; -}; - enum ClaimableBalanceFlags { // If set, the issuer account of the asset held by the claimable balance may @@ -682,8 +670,7 @@ enum EnvelopeType enum BucketListType { LIVE = 0, - HOT_ARCHIVE = 1, - COLD_ARCHIVE = 2 + HOT_ARCHIVE = 1 }; /* Entries used to define the bucket list */ @@ -701,19 +688,9 @@ enum HotArchiveBucketEntryType { HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived - HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but + HOT_ARCHIVE_LIVE = 1 // Entry was previously HOT_ARCHIVE_ARCHIVED, but // has been added back to the live BucketList. // Does not need to be persisted. - HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) -}; - -enum ColdArchiveBucketEntryType -{ - COLD_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. - COLD_ARCHIVE_ARCHIVED_LEAF = 0, // Full LedgerEntry that was archived during the epoch - COLD_ARCHIVE_DELETED_LEAF = 1, // LedgerKey that was deleted during the epoch - COLD_ARCHIVE_BOUNDARY_LEAF = 2, // Dummy leaf representing low/high bound - COLD_ARCHIVE_HASH = 3 // Intermediary Merkle hash entry }; struct BucketMetadata @@ -750,48 +727,8 @@ case HOT_ARCHIVE_ARCHIVED: LedgerEntry archivedEntry; case HOT_ARCHIVE_LIVE: -case HOT_ARCHIVE_DELETED: LedgerKey key; case HOT_ARCHIVE_METAENTRY: BucketMetadata metaEntry; }; - -struct ColdArchiveArchivedLeaf -{ - uint32 index; - LedgerEntry archivedEntry; -}; - -struct ColdArchiveDeletedLeaf -{ - uint32 index; - LedgerKey deletedKey; -}; - -struct ColdArchiveBoundaryLeaf -{ - uint32 index; - bool isLowerBound; -}; - -struct ColdArchiveHashEntry -{ - uint32 index; - uint32 level; - Hash hash; -}; - -union ColdArchiveBucketEntry switch (ColdArchiveBucketEntryType type) -{ -case COLD_ARCHIVE_METAENTRY: - BucketMetadata metaEntry; -case COLD_ARCHIVE_ARCHIVED_LEAF: - ColdArchiveArchivedLeaf archivedLeaf; -case COLD_ARCHIVE_DELETED_LEAF: - ColdArchiveDeletedLeaf deletedLeaf; -case COLD_ARCHIVE_BOUNDARY_LEAF: - ColdArchiveBoundaryLeaf boundaryLeaf; -case COLD_ARCHIVE_HASH: - ColdArchiveHashEntry hashEntry; -}; -} \ No newline at end of file +} diff --git a/xdr/curr/Stellar-ledger.x b/xdr/curr/Stellar-ledger.x index 0fc03e2a..a17036b8 100644 --- a/xdr/curr/Stellar-ledger.x +++ b/xdr/curr/Stellar-ledger.x @@ -128,7 +128,7 @@ enum LedgerUpgradeType }; struct ConfigUpgradeSetKey { - Hash contractID; + ContractID contractID; Hash contentHash; }; @@ -164,6 +164,33 @@ enum TxSetComponentType TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 }; +// A collection of transactions that *may* have arbitrary read-write data +// dependencies between each other, i.e. in a general case the transaction +// execution order within a cluster may not be arbitrarily shuffled without +// affecting the end result. +typedef TransactionEnvelope DependentTxCluster<>; +// A collection of clusters such that are *guaranteed* to not have read-write +// data dependencies in-between clusters, i.e. such that the cluster execution +// order can be arbitrarily shuffled without affecting the end result. Thus +// clusters can be executed in parallel with respect to each other. +typedef DependentTxCluster ParallelTxExecutionStage<>; + +// Transaction set component that contains transactions organized in a +// parallelism-friendly fashion. +// +// The component consists of several stages that have to be executed in +// sequential order, each stage consists of several clusters that can be +// executed in parallel, and the cluster itself consists of several +// transactions that have to be executed in sequential order in a general case. +struct ParallelTxsComponent +{ + int64* baseFee; + // A sequence of stages that *may* have arbitrary data dependencies between + // each other, i.e. in a general case the stage execution order may not be + // arbitrarily shuffled without affecting the end result. + ParallelTxExecutionStage executionStages<>; +}; + union TxSetComponent switch (TxSetComponentType type) { case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE: @@ -178,6 +205,8 @@ union TransactionPhase switch (int v) { case 0: TxSetComponent v0Components<>; +case 1: + ParallelTxsComponent parallelTxsComponent; }; // Transaction sets are the unit used by SCP to decide on transitions @@ -292,7 +321,8 @@ enum LedgerEntryChangeType LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger - LEDGER_ENTRY_STATE = 3 // value of the entry + LEDGER_ENTRY_STATE = 3, // value of the entry + LEDGER_ENTRY_RESTORED = 4 // archived entry was restored in the ledger }; union LedgerEntryChange switch (LedgerEntryChangeType type) @@ -305,6 +335,8 @@ case LEDGER_ENTRY_REMOVED: LedgerKey removed; case LEDGER_ENTRY_STATE: LedgerEntry state; +case LEDGER_ENTRY_RESTORED: + LedgerEntry restored; }; typedef LedgerEntryChange LedgerEntryChanges<>; @@ -342,7 +374,7 @@ struct ContractEvent // is first, to change ContractEvent into a union. ExtensionPoint ext; - Hash* contractID; + ContractID* contractID; ContractEventType type; union switch (int v) @@ -363,8 +395,6 @@ struct DiagnosticEvent ContractEvent event; }; -typedef DiagnosticEvent DiagnosticEvents<>; - struct SorobanTransactionMetaExtV1 { ExtensionPoint ext; @@ -434,6 +464,64 @@ struct TransactionMetaV3 // Soroban transactions). }; +struct OperationMetaV2 +{ + ExtensionPoint ext; + + LedgerEntryChanges changes; + + ContractEvent events<>; +}; + +struct SorobanTransactionMetaV2 +{ + SorobanTransactionMetaExt ext; + + SCVal* returnValue; +}; + +// Transaction-level events happen at different stages of the ledger apply flow +// (as opposed to the operation events that all happen atomically after +// a transaction is applied). +// This enum represents the possible stages during which an event has been +// emitted. +enum TransactionEventStage { + // The event has happened before any one of the transactions has its + // operations applied. + TRANSACTION_EVENT_STAGE_BEFORE_ALL_TXS = 0, + // The event has happened immediately after operations of the transaction + // have been applied. + TRANSACTION_EVENT_STAGE_AFTER_TX = 1, + // The event has happened after every transaction had its operations + // applied. + TRANSACTION_EVENT_STAGE_AFTER_ALL_TXS = 2 +}; + +// Represents a transaction-level event in metadata. +// Currently this is limited to the fee events (when fee is charged or +// refunded). +struct TransactionEvent { + TransactionEventStage stage; // Stage at which an event has occurred. + ContractEvent event; // The contract event that has occurred. +}; + +struct TransactionMetaV4 +{ + ExtensionPoint ext; + + LedgerEntryChanges txChangesBefore; // tx level changes before operations + // are applied if any + OperationMetaV2 operations<>; // meta for each operation + LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // applied if any + SorobanTransactionMetaV2* sorobanMeta; // Soroban-specific meta (only for + // Soroban transactions). + + TransactionEvent events<>; // Used for transaction-level events (like fee payment) + DiagnosticEvent diagnosticEvents<>; // Used for all diagnostic information +}; + + // This is in Stellar-ledger.x to due to a circular dependency struct InvokeHostFunctionSuccessPreImage { @@ -453,6 +541,8 @@ case 2: TransactionMetaV2 v2; case 3: TransactionMetaV3 v3; +case 4: + TransactionMetaV4 v4; }; // This struct groups together changes on a per transaction basis @@ -465,6 +555,20 @@ struct TransactionResultMeta TransactionMeta txApplyProcessing; }; +// This struct groups together changes on a per transaction basis +// note however that fees and transaction application are done in separate +// phases +struct TransactionResultMetaV1 +{ + ExtensionPoint ext; + + TransactionResultPair result; + LedgerEntryChanges feeProcessing; + TransactionMeta txApplyProcessing; + + LedgerEntryChanges postTxApplyFeeProcessing; +}; + // this represents a single upgrade that was performed as part of a ledger // upgrade struct UpgradeEntryMeta @@ -524,16 +628,42 @@ struct LedgerCloseMetaV1 // other misc information attached to the ledger close SCPHistoryEntry scpInfo<>; - // Size in bytes of BucketList, to support downstream + // Size in bytes of live Soroban state, to support downstream // systems calculating storage fees correctly. - uint64 totalByteSizeOfBucketList; + uint64 totalByteSizeOfLiveSorobanState; - // Temp keys that are being evicted at this ledger. - LedgerKey evictedTemporaryLedgerKeys<>; + // TTL and data/code keys that have been evicted at this ledger. + LedgerKey evictedKeys<>; - // Archived restorable ledger entries that are being - // evicted at this ledger. - LedgerEntry evictedPersistentLedgerEntries<>; + // Maintained for backwards compatibility, should never be populated. + LedgerEntry unused<>; +}; + +struct LedgerCloseMetaV2 +{ + LedgerCloseMetaExt ext; + + LedgerHeaderHistoryEntry ledgerHeader; + + GeneralizedTransactionSet txSet; + + // NB: transactions are sorted in apply order here + // fees for all transactions are processed first + // followed by applying transactions + TransactionResultMetaV1 txProcessing<>; + + // upgrades are applied last + UpgradeEntryMeta upgradesProcessing<>; + + // other misc information attached to the ledger close + SCPHistoryEntry scpInfo<>; + + // Size in bytes of live Soroban state, to support downstream + // systems calculating storage fees correctly. + uint64 totalByteSizeOfLiveSorobanState; + + // TTL and data/code keys that have been evicted at this ledger. + LedgerKey evictedKeys<>; }; union LedgerCloseMeta switch (int v) @@ -542,5 +672,7 @@ case 0: LedgerCloseMetaV0 v0; case 1: LedgerCloseMetaV1 v1; +case 2: + LedgerCloseMetaV2 v2; }; } diff --git a/xdr/curr/Stellar-overlay.x b/xdr/curr/Stellar-overlay.x index b398f883..1eda1fc1 100644 --- a/xdr/curr/Stellar-overlay.x +++ b/xdr/curr/Stellar-overlay.x @@ -87,14 +87,14 @@ struct PeerAddress uint32 numFailures; }; -// Next ID: 21 +// Next ID: 25 enum MessageType { ERROR_MSG = 0, AUTH = 2, DONT_HAVE = 3, + // GET_PEERS (4) is deprecated - GET_PEERS = 4, // gets a list of peers this guy knows about PEERS = 5, GET_TX_SET = 6, // gets a particular txset by hash @@ -112,8 +112,8 @@ enum MessageType // new messages HELLO = 13, - SURVEY_REQUEST = 14, - SURVEY_RESPONSE = 15, + // SURVEY_REQUEST (14) removed and replaced by TIME_SLICED_SURVEY_REQUEST + // SURVEY_RESPONSE (15) removed and replaced by TIME_SLICED_SURVEY_RESPONSE SEND_MORE = 16, SEND_MORE_EXTENDED = 20, @@ -135,14 +135,11 @@ struct DontHave enum SurveyMessageCommandType { - SURVEY_TOPOLOGY = 0, TIME_SLICED_SURVEY_TOPOLOGY = 1 }; enum SurveyMessageResponseType { - SURVEY_TOPOLOGY_RESPONSE_V0 = 0, - SURVEY_TOPOLOGY_RESPONSE_V1 = 1, SURVEY_TOPOLOGY_RESPONSE_V2 = 2 }; @@ -189,12 +186,6 @@ struct TimeSlicedSurveyRequestMessage uint32 outboundPeersIndex; }; -struct SignedSurveyRequestMessage -{ - Signature requestSignature; - SurveyRequestMessage request; -}; - struct SignedTimeSlicedSurveyRequestMessage { Signature requestSignature; @@ -217,12 +208,6 @@ struct TimeSlicedSurveyResponseMessage uint32 nonce; }; -struct SignedSurveyResponseMessage -{ - Signature responseSignature; - SurveyResponseMessage response; -}; - struct SignedTimeSlicedSurveyResponseMessage { Signature responseSignature; @@ -250,8 +235,6 @@ struct PeerStats uint64 duplicateFetchMessageRecv; }; -typedef PeerStats PeerStatList<25>; - struct TimeSlicedNodeData { uint32 addedAuthenticatedPeers; @@ -280,27 +263,6 @@ struct TimeSlicedPeerData typedef TimeSlicedPeerData TimeSlicedPeerDataList<25>; -struct TopologyResponseBodyV0 -{ - PeerStatList inboundPeers; - PeerStatList outboundPeers; - - uint32 totalInboundPeerCount; - uint32 totalOutboundPeerCount; -}; - -struct TopologyResponseBodyV1 -{ - PeerStatList inboundPeers; - PeerStatList outboundPeers; - - uint32 totalInboundPeerCount; - uint32 totalOutboundPeerCount; - - uint32 maxInboundPeerCount; - uint32 maxOutboundPeerCount; -}; - struct TopologyResponseBodyV2 { TimeSlicedPeerDataList inboundPeers; @@ -310,10 +272,6 @@ struct TopologyResponseBodyV2 union SurveyResponseBody switch (SurveyMessageResponseType type) { -case SURVEY_TOPOLOGY_RESPONSE_V0: - TopologyResponseBodyV0 topologyResponseBodyV0; -case SURVEY_TOPOLOGY_RESPONSE_V1: - TopologyResponseBodyV1 topologyResponseBodyV1; case SURVEY_TOPOLOGY_RESPONSE_V2: TopologyResponseBodyV2 topologyResponseBodyV2; }; @@ -344,8 +302,6 @@ case AUTH: Auth auth; case DONT_HAVE: DontHave dontHave; -case GET_PEERS: - void; case PEERS: PeerAddress peers<100>; @@ -359,12 +315,6 @@ case GENERALIZED_TX_SET: case TRANSACTION: TransactionEnvelope transaction; -case SURVEY_REQUEST: - SignedSurveyRequestMessage signedSurveyRequestMessage; - -case SURVEY_RESPONSE: - SignedSurveyResponseMessage signedSurveyResponseMessage; - case TIME_SLICED_SURVEY_REQUEST: SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; diff --git a/xdr/curr/Stellar-transaction.x b/xdr/curr/Stellar-transaction.x index 7d324810..9a14d6e4 100644 --- a/xdr/curr/Stellar-transaction.x +++ b/xdr/curr/Stellar-transaction.x @@ -594,6 +594,8 @@ struct SorobanAuthorizationEntry SorobanAuthorizedInvocation rootInvocation; }; +typedef SorobanAuthorizationEntry SorobanAuthorizationEntries<>; + /* Upload Wasm, create, and invoke contracts in Soroban. Threshold: med @@ -823,56 +825,6 @@ struct LedgerFootprint LedgerKey readWrite<>; }; -enum ArchivalProofType -{ - EXISTENCE = 0, - NONEXISTENCE = 1 -}; - -struct ArchivalProofNode -{ - uint32 index; - Hash hash; -}; - -typedef ArchivalProofNode ProofLevel<>; - -struct NonexistenceProofBody -{ - ColdArchiveBucketEntry entriesToProve<>; - - // Vector of vectors, where proofLevels[level] - // contains all HashNodes that correspond with that level - ProofLevel proofLevels<>; -}; - -struct ExistenceProofBody -{ - LedgerKey keysToProve<>; - - // Bounds for each key being proved, where bound[n] - // corresponds to keysToProve[n] - ColdArchiveBucketEntry lowBoundEntries<>; - ColdArchiveBucketEntry highBoundEntries<>; - - // Vector of vectors, where proofLevels[level] - // contains all HashNodes that correspond with that level - ProofLevel proofLevels<>; -}; - -struct ArchivalProof -{ - uint32 epoch; // AST Subtree for this proof - - union switch (ArchivalProofType t) - { - case EXISTENCE: - NonexistenceProofBody nonexistenceProof; - case NONEXISTENCE: - ExistenceProofBody existenceProof; - } body; -}; - // Resource limits for a Soroban transaction. // The transaction will fail if it exceeds any of these limits. struct SorobanResources @@ -882,16 +834,30 @@ struct SorobanResources // The maximum number of instructions this transaction can use uint32 instructions; - // The maximum number of bytes this transaction can read from ledger - uint32 readBytes; + // The maximum number of bytes this transaction can read from disk backed entries + uint32 diskReadBytes; // The maximum number of bytes this transaction can write to ledger uint32 writeBytes; }; +struct SorobanResourcesExtV0 +{ + // Vector of indices representing what Soroban + // entries in the footprint are archived, based on the + // order of keys provided in the readWrite footprint. + uint32 archivedSorobanEntries<>; +}; + // The transaction extension for Soroban. struct SorobanTransactionData { - ExtensionPoint ext; + union switch (int v) + { + case 0: + void; + case 1: + SorobanResourcesExtV0 resourceExt; + } ext; SorobanResources resources; // Amount of the transaction `fee` allocated to the Soroban resource fees. // The fraction of `resourceFee` corresponding to `resources` specified @@ -960,7 +926,6 @@ struct Transaction Operation operations; - // reserved for future use union switch (int v) { case 0: diff --git a/xdr/curr/Stellar-types.x b/xdr/curr/Stellar-types.x index 73c4e795..f383d2e4 100644 --- a/xdr/curr/Stellar-types.x +++ b/xdr/curr/Stellar-types.x @@ -84,6 +84,8 @@ typedef opaque SignatureHint[4]; typedef PublicKey NodeID; typedef PublicKey AccountID; +typedef Hash ContractID; + struct Curve25519Secret { opaque key[32]; @@ -134,4 +136,17 @@ struct SerializedBinaryFuseFilter // Array of uint8_t, uint16_t, or uint32_t depending on filter type opaque fingerprints<>; }; + +typedef Hash PoolID; // SHA256(LiquidityPoolParameters) + +enum ClaimableBalanceIDType +{ + CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 +}; + +union ClaimableBalanceID switch (ClaimableBalanceIDType type) +{ +case CLAIMABLE_BALANCE_ID_TYPE_V0: + Hash v0; +}; } \ No newline at end of file diff --git a/xdr/next/Stellar-contract-config-setting.x b/xdr/next/Stellar-contract-config-setting.x index bd96f9f4..b075c6b4 100644 --- a/xdr/next/Stellar-contract-config-setting.x +++ b/xdr/next/Stellar-contract-config-setting.x @@ -26,50 +26,59 @@ struct ConfigSettingContractComputeV0 // Settings for running the contract transactions in parallel. struct ConfigSettingContractParallelComputeV0 { - // Maximum number of threads that can be used to apply a - // transaction set to close the ledger. - // This doesn't limit or defined the actual number of - // threads used and instead only defines the minimum number - // of physical threads that a tier-1 validator has to support - // in order to not fall out of sync with the network. - uint32 ledgerMaxParallelThreads; + // Maximum number of clusters with dependent transactions allowed in a + // stage of parallel tx set component. + // This effectively sets the lower bound on the number of physical threads + // necessary to effectively apply transaction sets in parallel. + uint32 ledgerMaxDependentTxClusters; }; // Ledger access settings for contracts. struct ConfigSettingContractLedgerCostV0 { - // Maximum number of ledger entry read operations per ledger - uint32 ledgerMaxReadLedgerEntries; - // Maximum number of bytes that can be read per ledger - uint32 ledgerMaxReadBytes; + // Maximum number of disk entry read operations per ledger + uint32 ledgerMaxDiskReadEntries; + // Maximum number of bytes of disk reads that can be performed per ledger + uint32 ledgerMaxDiskReadBytes; // Maximum number of ledger entry write operations per ledger uint32 ledgerMaxWriteLedgerEntries; // Maximum number of bytes that can be written per ledger uint32 ledgerMaxWriteBytes; - // Maximum number of ledger entry read operations per transaction - uint32 txMaxReadLedgerEntries; - // Maximum number of bytes that can be read per transaction - uint32 txMaxReadBytes; + // Maximum number of disk entry read operations per transaction + uint32 txMaxDiskReadEntries; + // Maximum number of bytes of disk reads that can be performed per transaction + uint32 txMaxDiskReadBytes; // Maximum number of ledger entry write operations per transaction uint32 txMaxWriteLedgerEntries; // Maximum number of bytes that can be written per transaction uint32 txMaxWriteBytes; - int64 feeReadLedgerEntry; // Fee per ledger entry read - int64 feeWriteLedgerEntry; // Fee per ledger entry write + int64 feeDiskReadLedgerEntry; // Fee per disk ledger entry read + int64 feeWriteLedgerEntry; // Fee per ledger entry write - int64 feeRead1KB; // Fee for reading 1KB + int64 feeDiskRead1KB; // Fee for reading 1KB disk // The following parameters determine the write fee per 1KB. - // Write fee grows linearly until bucket list reaches this size - int64 bucketListTargetSizeBytes; - // Fee per 1KB write when the bucket list is empty - int64 writeFee1KBBucketListLow; - // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` - int64 writeFee1KBBucketListHigh; - // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` - uint32 bucketListWriteFeeGrowthFactor; + // Rent fee grows linearly until soroban state reaches this size + int64 sorobanStateTargetSizeBytes; + // Fee per 1KB rent when the soroban state is empty + int64 rentFee1KBSorobanStateSizeLow; + // Fee per 1KB rent when the soroban state has reached `sorobanStateTargetSizeBytes` + int64 rentFee1KBSorobanStateSizeHigh; + // Rent fee multiplier for any additional data past the first `sorobanStateTargetSizeBytes` + uint32 sorobanStateRentFeeGrowthFactor; +}; + +// Ledger access settings for contracts. +struct ConfigSettingContractLedgerCostExtV0 +{ + // Maximum number of RO+RW entries in the transaction footprint. + uint32 txMaxFootprintEntries; + // Fee per 1 KB of data written to the ledger. + // Unlike the rent fee, this is a flat fee that is charged for any ledger + // write, independent of the type of the entry being written. + int64 feeWrite1KB; }; // Historical data (pushed to core archives) settings for contracts. @@ -274,11 +283,11 @@ struct StateArchivalSettings { // max number of entries that emit archival meta in a single ledger uint32 maxEntriesToArchive; - // Number of snapshots to use when calculating average BucketList size - uint32 bucketListSizeWindowSampleSize; + // Number of snapshots to use when calculating average live Soroban State size + uint32 liveSorobanStateSizeWindowSampleSize; - // How often to sample the BucketList size for the average, in ledgers - uint32 bucketListWindowSamplePeriod; + // How often to sample the live Soroban State size for the average, in ledgers + uint32 liveSorobanStateSizeWindowSamplePeriod; // Maximum number of bytes that we scan for eviction per ledger uint32 evictionScanSize; @@ -293,6 +302,14 @@ struct EvictionIterator { uint64 bucketFileOffset; }; +struct ConfigSettingSCPTiming { + uint32 ledgerTargetCloseTimeMilliseconds; + uint32 nominationTimeoutInitialMilliseconds; + uint32 nominationTimeoutIncrementMilliseconds; + uint32 ballotTimeoutInitialMilliseconds; + uint32 ballotTimeoutIncrementMilliseconds; +}; + // limits the ContractCostParams size to 20kB const CONTRACT_COST_COUNT_LIMIT = 1024; @@ -313,9 +330,11 @@ enum ConfigSettingID CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, CONFIG_SETTING_STATE_ARCHIVAL = 10, CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, - CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, + CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW = 12, CONFIG_SETTING_EVICTION_ITERATOR = 13, - CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14 + CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14, + CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0 = 15, + CONFIG_SETTING_SCP_TIMING = 16 }; union ConfigSettingEntry switch (ConfigSettingID configSettingID) @@ -344,11 +363,15 @@ case CONFIG_SETTING_STATE_ARCHIVAL: StateArchivalSettings stateArchivalSettings; case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: ConfigSettingContractExecutionLanesV0 contractExecutionLanes; -case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: - uint64 bucketListSizeWindow<>; +case CONFIG_SETTING_LIVE_SOROBAN_STATE_SIZE_WINDOW: + uint64 liveSorobanStateSizeWindow<>; case CONFIG_SETTING_EVICTION_ITERATOR: EvictionIterator evictionIterator; case CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0: ConfigSettingContractParallelComputeV0 contractParallelCompute; +case CONFIG_SETTING_CONTRACT_LEDGER_COST_EXT_V0: + ConfigSettingContractLedgerCostExtV0 contractLedgerCostExt; +case CONFIG_SETTING_SCP_TIMING: + ConfigSettingSCPTiming contractSCPTiming; }; } diff --git a/xdr/next/Stellar-contract-spec.x b/xdr/next/Stellar-contract-spec.x index 6988a633..ce6e0307 100644 --- a/xdr/next/Stellar-contract-spec.x +++ b/xdr/next/Stellar-contract-spec.x @@ -34,6 +34,7 @@ enum SCSpecType SC_SPEC_TYPE_STRING = 16, SC_SPEC_TYPE_SYMBOL = 17, SC_SPEC_TYPE_ADDRESS = 19, + SC_SPEC_TYPE_MUXED_ADDRESS = 20, // Types with parameters. SC_SPEC_TYPE_OPTION = 1000, @@ -104,6 +105,7 @@ case SC_SPEC_TYPE_BYTES: case SC_SPEC_TYPE_STRING: case SC_SPEC_TYPE_SYMBOL: case SC_SPEC_TYPE_ADDRESS: +case SC_SPEC_TYPE_MUXED_ADDRESS: void; case SC_SPEC_TYPE_OPTION: SCSpecTypeOption option; @@ -216,13 +218,45 @@ struct SCSpecFunctionV0 SCSpecTypeDef outputs<1>; }; +enum SCSpecEventParamLocationV0 +{ + SC_SPEC_EVENT_PARAM_LOCATION_DATA = 0, + SC_SPEC_EVENT_PARAM_LOCATION_TOPIC_LIST = 1 +}; + +struct SCSpecEventParamV0 +{ + string doc; + string name<30>; + SCSpecTypeDef type; + SCSpecEventParamLocationV0 location; +}; + +enum SCSpecEventDataFormat +{ + SC_SPEC_EVENT_DATA_FORMAT_SINGLE_VALUE = 0, + SC_SPEC_EVENT_DATA_FORMAT_VEC = 1, + SC_SPEC_EVENT_DATA_FORMAT_MAP = 2 +}; + +struct SCSpecEventV0 +{ + string doc; + string lib<80>; + SCSymbol name; + SCSymbol prefixTopics<2>; + SCSpecEventParamV0 params<50>; + SCSpecEventDataFormat dataFormat; +}; + enum SCSpecEntryKind { SC_SPEC_ENTRY_FUNCTION_V0 = 0, SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, SC_SPEC_ENTRY_UDT_UNION_V0 = 2, SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, - SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 + SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4, + SC_SPEC_ENTRY_EVENT_V0 = 5 }; union SCSpecEntry switch (SCSpecEntryKind kind) @@ -237,6 +271,8 @@ case SC_SPEC_ENTRY_UDT_ENUM_V0: SCSpecUDTEnumV0 udtEnumV0; case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: SCSpecUDTErrorEnumV0 udtErrorEnumV0; +case SC_SPEC_ENTRY_EVENT_V0: + SCSpecEventV0 eventV0; }; } diff --git a/xdr/next/Stellar-contract.x b/xdr/next/Stellar-contract.x index 51130056..0e67dc3f 100644 --- a/xdr/next/Stellar-contract.x +++ b/xdr/next/Stellar-contract.x @@ -179,7 +179,16 @@ case CONTRACT_EXECUTABLE_STELLAR_ASSET: enum SCAddressType { SC_ADDRESS_TYPE_ACCOUNT = 0, - SC_ADDRESS_TYPE_CONTRACT = 1 + SC_ADDRESS_TYPE_CONTRACT = 1, + SC_ADDRESS_TYPE_MUXED_ACCOUNT = 2, + SC_ADDRESS_TYPE_CLAIMABLE_BALANCE = 3, + SC_ADDRESS_TYPE_LIQUIDITY_POOL = 4 +}; + +struct MuxedEd25519Account +{ + uint64 id; + uint256 ed25519; }; union SCAddress switch (SCAddressType type) @@ -187,7 +196,13 @@ union SCAddress switch (SCAddressType type) case SC_ADDRESS_TYPE_ACCOUNT: AccountID accountId; case SC_ADDRESS_TYPE_CONTRACT: - Hash contractId; + ContractID contractId; +case SC_ADDRESS_TYPE_MUXED_ACCOUNT: + MuxedEd25519Account muxedAccount; +case SC_ADDRESS_TYPE_CLAIMABLE_BALANCE: + ClaimableBalanceID claimableBalanceId; +case SC_ADDRESS_TYPE_LIQUIDITY_POOL: + PoolID liquidityPoolId; }; %struct SCVal; @@ -264,13 +279,12 @@ case SCV_ADDRESS: // Special SCVals reserved for system-constructed contract-data // ledger keys, not generally usable elsewhere. +case SCV_CONTRACT_INSTANCE: + SCContractInstance instance; case SCV_LEDGER_KEY_CONTRACT_INSTANCE: void; case SCV_LEDGER_KEY_NONCE: SCNonceKey nonce_key; - -case SCV_CONTRACT_INSTANCE: - SCContractInstance instance; }; struct SCMapEntry diff --git a/xdr/next/Stellar-exporter.x b/xdr/next/Stellar-exporter.x new file mode 100644 index 00000000..4ac92654 --- /dev/null +++ b/xdr/next/Stellar-exporter.x @@ -0,0 +1,23 @@ +// Copyright 2024 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +%#include "xdr/Stellar-ledger.h" + +namespace stellar +{ + +// Batch of ledgers along with their transaction metadata +struct LedgerCloseMetaBatch +{ + // starting ledger sequence number in the batch + uint32 startSequence; + + // ending ledger sequence number in the batch + uint32 endSequence; + + // Ledger close meta for each ledger within the batch + LedgerCloseMeta ledgerCloseMetas<>; +}; + +} diff --git a/xdr/next/Stellar-ledger-entries.x b/xdr/next/Stellar-ledger-entries.x index 9238fcda..b9a9a168 100644 --- a/xdr/next/Stellar-ledger-entries.x +++ b/xdr/next/Stellar-ledger-entries.x @@ -14,7 +14,6 @@ typedef string string32<32>; typedef string string64<64>; typedef int64 SequenceNumber; typedef opaque DataValue<64>; -typedef Hash PoolID; // SHA256(LiquidityPoolParameters) // 1-4 alphanumeric characters right-padded with 0 bytes typedef opaque AssetCode4[4]; @@ -409,17 +408,6 @@ case CLAIMANT_TYPE_V0: } v0; }; -enum ClaimableBalanceIDType -{ - CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 -}; - -union ClaimableBalanceID switch (ClaimableBalanceIDType type) -{ -case CLAIMABLE_BALANCE_ID_TYPE_V0: - Hash v0; -}; - enum ClaimableBalanceFlags { // If set, the issuer account of the asset held by the claimable balance may @@ -682,8 +670,7 @@ enum EnvelopeType enum BucketListType { LIVE = 0, - HOT_ARCHIVE = 1, - COLD_ARCHIVE = 2 + HOT_ARCHIVE = 1 }; /* Entries used to define the bucket list */ @@ -701,19 +688,9 @@ enum HotArchiveBucketEntryType { HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived - HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but + HOT_ARCHIVE_LIVE = 1 // Entry was previously HOT_ARCHIVE_ARCHIVED, but // has been added back to the live BucketList. // Does not need to be persisted. - HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) -}; - -enum ColdArchiveBucketEntryType -{ - COLD_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. - COLD_ARCHIVE_ARCHIVED_LEAF = 0, // Full LedgerEntry that was archived during the epoch - COLD_ARCHIVE_DELETED_LEAF = 1, // LedgerKey that was deleted during the epoch - COLD_ARCHIVE_BOUNDARY_LEAF = 2, // Dummy leaf representing low/high bound - COLD_ARCHIVE_HASH = 3 // Intermediary Merkle hash entry }; struct BucketMetadata @@ -750,48 +727,8 @@ case HOT_ARCHIVE_ARCHIVED: LedgerEntry archivedEntry; case HOT_ARCHIVE_LIVE: -case HOT_ARCHIVE_DELETED: LedgerKey key; case HOT_ARCHIVE_METAENTRY: BucketMetadata metaEntry; }; - -struct ColdArchiveArchivedLeaf -{ - uint32 index; - LedgerEntry archivedEntry; -}; - -struct ColdArchiveDeletedLeaf -{ - uint32 index; - LedgerKey deletedKey; -}; - -struct ColdArchiveBoundaryLeaf -{ - uint32 index; - bool isLowerBound; -}; - -struct ColdArchiveHashEntry -{ - uint32 index; - uint32 level; - Hash hash; -}; - -union ColdArchiveBucketEntry switch (ColdArchiveBucketEntryType type) -{ -case COLD_ARCHIVE_METAENTRY: - BucketMetadata metaEntry; -case COLD_ARCHIVE_ARCHIVED_LEAF: - ColdArchiveArchivedLeaf archivedLeaf; -case COLD_ARCHIVE_DELETED_LEAF: - ColdArchiveDeletedLeaf deletedLeaf; -case COLD_ARCHIVE_BOUNDARY_LEAF: - ColdArchiveBoundaryLeaf boundaryLeaf; -case COLD_ARCHIVE_HASH: - ColdArchiveHashEntry hashEntry; -}; } diff --git a/xdr/next/Stellar-ledger.x b/xdr/next/Stellar-ledger.x index 9c0d0360..a17036b8 100644 --- a/xdr/next/Stellar-ledger.x +++ b/xdr/next/Stellar-ledger.x @@ -128,7 +128,7 @@ enum LedgerUpgradeType }; struct ConfigUpgradeSetKey { - Hash contractID; + ContractID contractID; Hash contentHash; }; @@ -164,12 +164,30 @@ enum TxSetComponentType TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 }; -typedef TransactionEnvelope TxExecutionThread<>; -typedef TxExecutionThread ParallelTxExecutionStage<>; - +// A collection of transactions that *may* have arbitrary read-write data +// dependencies between each other, i.e. in a general case the transaction +// execution order within a cluster may not be arbitrarily shuffled without +// affecting the end result. +typedef TransactionEnvelope DependentTxCluster<>; +// A collection of clusters such that are *guaranteed* to not have read-write +// data dependencies in-between clusters, i.e. such that the cluster execution +// order can be arbitrarily shuffled without affecting the end result. Thus +// clusters can be executed in parallel with respect to each other. +typedef DependentTxCluster ParallelTxExecutionStage<>; + +// Transaction set component that contains transactions organized in a +// parallelism-friendly fashion. +// +// The component consists of several stages that have to be executed in +// sequential order, each stage consists of several clusters that can be +// executed in parallel, and the cluster itself consists of several +// transactions that have to be executed in sequential order in a general case. struct ParallelTxsComponent { int64* baseFee; + // A sequence of stages that *may* have arbitrary data dependencies between + // each other, i.e. in a general case the stage execution order may not be + // arbitrarily shuffled without affecting the end result. ParallelTxExecutionStage executionStages<>; }; @@ -303,7 +321,8 @@ enum LedgerEntryChangeType LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger - LEDGER_ENTRY_STATE = 3 // value of the entry + LEDGER_ENTRY_STATE = 3, // value of the entry + LEDGER_ENTRY_RESTORED = 4 // archived entry was restored in the ledger }; union LedgerEntryChange switch (LedgerEntryChangeType type) @@ -316,6 +335,8 @@ case LEDGER_ENTRY_REMOVED: LedgerKey removed; case LEDGER_ENTRY_STATE: LedgerEntry state; +case LEDGER_ENTRY_RESTORED: + LedgerEntry restored; }; typedef LedgerEntryChange LedgerEntryChanges<>; @@ -353,7 +374,7 @@ struct ContractEvent // is first, to change ContractEvent into a union. ExtensionPoint ext; - Hash* contractID; + ContractID* contractID; ContractEventType type; union switch (int v) @@ -443,6 +464,64 @@ struct TransactionMetaV3 // Soroban transactions). }; +struct OperationMetaV2 +{ + ExtensionPoint ext; + + LedgerEntryChanges changes; + + ContractEvent events<>; +}; + +struct SorobanTransactionMetaV2 +{ + SorobanTransactionMetaExt ext; + + SCVal* returnValue; +}; + +// Transaction-level events happen at different stages of the ledger apply flow +// (as opposed to the operation events that all happen atomically after +// a transaction is applied). +// This enum represents the possible stages during which an event has been +// emitted. +enum TransactionEventStage { + // The event has happened before any one of the transactions has its + // operations applied. + TRANSACTION_EVENT_STAGE_BEFORE_ALL_TXS = 0, + // The event has happened immediately after operations of the transaction + // have been applied. + TRANSACTION_EVENT_STAGE_AFTER_TX = 1, + // The event has happened after every transaction had its operations + // applied. + TRANSACTION_EVENT_STAGE_AFTER_ALL_TXS = 2 +}; + +// Represents a transaction-level event in metadata. +// Currently this is limited to the fee events (when fee is charged or +// refunded). +struct TransactionEvent { + TransactionEventStage stage; // Stage at which an event has occurred. + ContractEvent event; // The contract event that has occurred. +}; + +struct TransactionMetaV4 +{ + ExtensionPoint ext; + + LedgerEntryChanges txChangesBefore; // tx level changes before operations + // are applied if any + OperationMetaV2 operations<>; // meta for each operation + LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // applied if any + SorobanTransactionMetaV2* sorobanMeta; // Soroban-specific meta (only for + // Soroban transactions). + + TransactionEvent events<>; // Used for transaction-level events (like fee payment) + DiagnosticEvent diagnosticEvents<>; // Used for all diagnostic information +}; + + // This is in Stellar-ledger.x to due to a circular dependency struct InvokeHostFunctionSuccessPreImage { @@ -462,6 +541,8 @@ case 2: TransactionMetaV2 v2; case 3: TransactionMetaV3 v3; +case 4: + TransactionMetaV4 v4; }; // This struct groups together changes on a per transaction basis @@ -474,6 +555,20 @@ struct TransactionResultMeta TransactionMeta txApplyProcessing; }; +// This struct groups together changes on a per transaction basis +// note however that fees and transaction application are done in separate +// phases +struct TransactionResultMetaV1 +{ + ExtensionPoint ext; + + TransactionResultPair result; + LedgerEntryChanges feeProcessing; + TransactionMeta txApplyProcessing; + + LedgerEntryChanges postTxApplyFeeProcessing; +}; + // this represents a single upgrade that was performed as part of a ledger // upgrade struct UpgradeEntryMeta @@ -533,16 +628,42 @@ struct LedgerCloseMetaV1 // other misc information attached to the ledger close SCPHistoryEntry scpInfo<>; - // Size in bytes of BucketList, to support downstream + // Size in bytes of live Soroban state, to support downstream // systems calculating storage fees correctly. - uint64 totalByteSizeOfBucketList; + uint64 totalByteSizeOfLiveSorobanState; - // Temp keys that are being evicted at this ledger. - LedgerKey evictedTemporaryLedgerKeys<>; + // TTL and data/code keys that have been evicted at this ledger. + LedgerKey evictedKeys<>; - // Archived restorable ledger entries that are being - // evicted at this ledger. - LedgerEntry evictedPersistentLedgerEntries<>; + // Maintained for backwards compatibility, should never be populated. + LedgerEntry unused<>; +}; + +struct LedgerCloseMetaV2 +{ + LedgerCloseMetaExt ext; + + LedgerHeaderHistoryEntry ledgerHeader; + + GeneralizedTransactionSet txSet; + + // NB: transactions are sorted in apply order here + // fees for all transactions are processed first + // followed by applying transactions + TransactionResultMetaV1 txProcessing<>; + + // upgrades are applied last + UpgradeEntryMeta upgradesProcessing<>; + + // other misc information attached to the ledger close + SCPHistoryEntry scpInfo<>; + + // Size in bytes of live Soroban state, to support downstream + // systems calculating storage fees correctly. + uint64 totalByteSizeOfLiveSorobanState; + + // TTL and data/code keys that have been evicted at this ledger. + LedgerKey evictedKeys<>; }; union LedgerCloseMeta switch (int v) @@ -551,5 +672,7 @@ case 0: LedgerCloseMetaV0 v0; case 1: LedgerCloseMetaV1 v1; +case 2: + LedgerCloseMetaV2 v2; }; } diff --git a/xdr/next/Stellar-overlay.x b/xdr/next/Stellar-overlay.x index b398f883..1eda1fc1 100644 --- a/xdr/next/Stellar-overlay.x +++ b/xdr/next/Stellar-overlay.x @@ -87,14 +87,14 @@ struct PeerAddress uint32 numFailures; }; -// Next ID: 21 +// Next ID: 25 enum MessageType { ERROR_MSG = 0, AUTH = 2, DONT_HAVE = 3, + // GET_PEERS (4) is deprecated - GET_PEERS = 4, // gets a list of peers this guy knows about PEERS = 5, GET_TX_SET = 6, // gets a particular txset by hash @@ -112,8 +112,8 @@ enum MessageType // new messages HELLO = 13, - SURVEY_REQUEST = 14, - SURVEY_RESPONSE = 15, + // SURVEY_REQUEST (14) removed and replaced by TIME_SLICED_SURVEY_REQUEST + // SURVEY_RESPONSE (15) removed and replaced by TIME_SLICED_SURVEY_RESPONSE SEND_MORE = 16, SEND_MORE_EXTENDED = 20, @@ -135,14 +135,11 @@ struct DontHave enum SurveyMessageCommandType { - SURVEY_TOPOLOGY = 0, TIME_SLICED_SURVEY_TOPOLOGY = 1 }; enum SurveyMessageResponseType { - SURVEY_TOPOLOGY_RESPONSE_V0 = 0, - SURVEY_TOPOLOGY_RESPONSE_V1 = 1, SURVEY_TOPOLOGY_RESPONSE_V2 = 2 }; @@ -189,12 +186,6 @@ struct TimeSlicedSurveyRequestMessage uint32 outboundPeersIndex; }; -struct SignedSurveyRequestMessage -{ - Signature requestSignature; - SurveyRequestMessage request; -}; - struct SignedTimeSlicedSurveyRequestMessage { Signature requestSignature; @@ -217,12 +208,6 @@ struct TimeSlicedSurveyResponseMessage uint32 nonce; }; -struct SignedSurveyResponseMessage -{ - Signature responseSignature; - SurveyResponseMessage response; -}; - struct SignedTimeSlicedSurveyResponseMessage { Signature responseSignature; @@ -250,8 +235,6 @@ struct PeerStats uint64 duplicateFetchMessageRecv; }; -typedef PeerStats PeerStatList<25>; - struct TimeSlicedNodeData { uint32 addedAuthenticatedPeers; @@ -280,27 +263,6 @@ struct TimeSlicedPeerData typedef TimeSlicedPeerData TimeSlicedPeerDataList<25>; -struct TopologyResponseBodyV0 -{ - PeerStatList inboundPeers; - PeerStatList outboundPeers; - - uint32 totalInboundPeerCount; - uint32 totalOutboundPeerCount; -}; - -struct TopologyResponseBodyV1 -{ - PeerStatList inboundPeers; - PeerStatList outboundPeers; - - uint32 totalInboundPeerCount; - uint32 totalOutboundPeerCount; - - uint32 maxInboundPeerCount; - uint32 maxOutboundPeerCount; -}; - struct TopologyResponseBodyV2 { TimeSlicedPeerDataList inboundPeers; @@ -310,10 +272,6 @@ struct TopologyResponseBodyV2 union SurveyResponseBody switch (SurveyMessageResponseType type) { -case SURVEY_TOPOLOGY_RESPONSE_V0: - TopologyResponseBodyV0 topologyResponseBodyV0; -case SURVEY_TOPOLOGY_RESPONSE_V1: - TopologyResponseBodyV1 topologyResponseBodyV1; case SURVEY_TOPOLOGY_RESPONSE_V2: TopologyResponseBodyV2 topologyResponseBodyV2; }; @@ -344,8 +302,6 @@ case AUTH: Auth auth; case DONT_HAVE: DontHave dontHave; -case GET_PEERS: - void; case PEERS: PeerAddress peers<100>; @@ -359,12 +315,6 @@ case GENERALIZED_TX_SET: case TRANSACTION: TransactionEnvelope transaction; -case SURVEY_REQUEST: - SignedSurveyRequestMessage signedSurveyRequestMessage; - -case SURVEY_RESPONSE: - SignedSurveyResponseMessage signedSurveyResponseMessage; - case TIME_SLICED_SURVEY_REQUEST: SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; diff --git a/xdr/next/Stellar-transaction.x b/xdr/next/Stellar-transaction.x index f285506f..9a14d6e4 100644 --- a/xdr/next/Stellar-transaction.x +++ b/xdr/next/Stellar-transaction.x @@ -594,6 +594,8 @@ struct SorobanAuthorizationEntry SorobanAuthorizedInvocation rootInvocation; }; +typedef SorobanAuthorizationEntry SorobanAuthorizationEntries<>; + /* Upload Wasm, create, and invoke contracts in Soroban. Threshold: med @@ -823,56 +825,6 @@ struct LedgerFootprint LedgerKey readWrite<>; }; -enum ArchivalProofType -{ - EXISTENCE = 0, - NONEXISTENCE = 1 -}; - -struct ArchivalProofNode -{ - uint32 index; - Hash hash; -}; - -typedef ArchivalProofNode ProofLevel<>; - -struct NonexistenceProofBody -{ - ColdArchiveBucketEntry entriesToProve<>; - - // Vector of vectors, where proofLevels[level] - // contains all HashNodes that correspond with that level - ProofLevel proofLevels<>; -}; - -struct ExistenceProofBody -{ - LedgerKey keysToProve<>; - - // Bounds for each key being proved, where bound[n] - // corresponds to keysToProve[n] - ColdArchiveBucketEntry lowBoundEntries<>; - ColdArchiveBucketEntry highBoundEntries<>; - - // Vector of vectors, where proofLevels[level] - // contains all HashNodes that correspond with that level - ProofLevel proofLevels<>; -}; - -struct ArchivalProof -{ - uint32 epoch; // AST Subtree for this proof - - union switch (ArchivalProofType t) - { - case EXISTENCE: - NonexistenceProofBody nonexistenceProof; - case NONEXISTENCE: - ExistenceProofBody existenceProof; - } body; -}; - // Resource limits for a Soroban transaction. // The transaction will fail if it exceeds any of these limits. struct SorobanResources @@ -882,12 +834,20 @@ struct SorobanResources // The maximum number of instructions this transaction can use uint32 instructions; - // The maximum number of bytes this transaction can read from ledger - uint32 readBytes; + // The maximum number of bytes this transaction can read from disk backed entries + uint32 diskReadBytes; // The maximum number of bytes this transaction can write to ledger uint32 writeBytes; }; +struct SorobanResourcesExtV0 +{ + // Vector of indices representing what Soroban + // entries in the footprint are archived, based on the + // order of keys provided in the readWrite footprint. + uint32 archivedSorobanEntries<>; +}; + // The transaction extension for Soroban. struct SorobanTransactionData { @@ -896,7 +856,7 @@ struct SorobanTransactionData case 0: void; case 1: - ArchivalProof proofs<>; + SorobanResourcesExtV0 resourceExt; } ext; SorobanResources resources; // Amount of the transaction `fee` allocated to the Soroban resource fees. @@ -966,7 +926,6 @@ struct Transaction Operation operations; - // reserved for future use union switch (int v) { case 0: diff --git a/xdr/next/Stellar-types.x b/xdr/next/Stellar-types.x index 758c2954..f383d2e4 100644 --- a/xdr/next/Stellar-types.x +++ b/xdr/next/Stellar-types.x @@ -84,6 +84,8 @@ typedef opaque SignatureHint[4]; typedef PublicKey NodeID; typedef PublicKey AccountID; +typedef Hash ContractID; + struct Curve25519Secret { opaque key[32]; @@ -134,4 +136,17 @@ struct SerializedBinaryFuseFilter // Array of uint8_t, uint16_t, or uint32_t depending on filter type opaque fingerprints<>; }; -} + +typedef Hash PoolID; // SHA256(LiquidityPoolParameters) + +enum ClaimableBalanceIDType +{ + CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 +}; + +union ClaimableBalanceID switch (ClaimableBalanceIDType type) +{ +case CLAIMABLE_BALANCE_ID_TYPE_V0: + Hash v0; +}; +} \ No newline at end of file