diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..0c600db7 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,26 @@ +name: Code Formatting + +on: + push: + branches: [ master ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use Node.js 20 + uses: actions/setup-node@v3 + with: + node-version: 20 + + # Workaround for some `yarn` nonsense, see: + # https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210 + - name: Install Dependencies + run: yarn install --network-concurrency 1 + + - name: Run Linter Checks + run: yarn fmt && yarn lint && (git diff-index --quiet HEAD; git diff) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index e90ab61d..06c04b2e 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -24,9 +24,9 @@ jobs: - name: Publish npm package to both places run: | - yarn publish --access public + yarn publish --access public --tag protocol-22-beta sed -i -e 's#"@stellar/stellar-base"#"stellar-base"#' package.json - yarn publish + yarn publish --tag protocol-22-beta env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b0ebb1f..f49c3891 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,6 +37,3 @@ jobs: - name: Run Browser Tests run: yarn test:browser - - - name: Run Linter Checks - run: yarn fmt && yarn lint && (git diff-index --quiet HEAD; git diff) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8318bf49..94074114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ ## Unreleased +## [`v13.0.0-beta.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.1...v13.0.0-beta.1) + +**This is the first release that supports Protocol 22.** While the network has not upgraded yet, you can start integrating the new features into your codebase if you want a head start. Keep in mind that while the binary XDR is backwards-compatible, the naming and layout of structures is not. In other words, this build will continue to work on Protocol 21, but you may have to update code that references XDR directly. + +### Breaking Changes +* XDR definitions have been upgraded to Protocol 22 ([#777](https://github.com/stellar/js-stellar-base/pull/777)). + +### Added +* You can create contracts with constructors a new, optional parameter of `Operation.createCustomContract`, `constructorArgs: xdr.ScVal[]` ([#770](https://github.com/stellar/js-stellar-base/pull/770)). + + ## [`v12.1.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.0...v12.1.1) ### Fixed diff --git a/Makefile b/Makefile index 63632e56..85313fdd 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/1a04392432dacc0092caaeae22a600ea1af3c6a5 +XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/529d5176f24c73eeccfa5eba481d4e89c19b1181 XDR_BASE_LOCAL_CURR=xdr/curr XDR_FILES_CURR= \ Stellar-SCP.x \ @@ -14,7 +14,7 @@ XDR_FILES_CURR= \ Stellar-contract-config-setting.x XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR)) -XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/4bd4827b3361f266d295cbc83c5d7f7396d782d9 +XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/8c88608d0a20b01873056a5ec13be245e1f2aa27 XDR_BASE_LOCAL_NEXT=xdr/next XDR_FILES_NEXT= \ Stellar-SCP.x \ diff --git a/package.json b/package.json index 6df089dd..46fde34f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/stellar-base", - "version": "12.1.1", + "version": "13.0.0-beta.1", "description": "Low-level support library for the Stellar network.", "main": "./lib/index.js", "browser": { diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index 90e88f57..db4b4f40 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -1,4 +1,4 @@ -// Automatically generated by xdrgen +// Automatically generated by xdrgen on 2024-09-12T11:09:00-08:00 // DO NOT EDIT or your changes may be overwritten /* jshint maxstatements:2147483647 */ @@ -2054,6 +2054,285 @@ xdr.enum("EnvelopeType", { envelopeTypeSorobanAuthorization: 9, }); +// === xdr source ============================================================ +// +// enum BucketListType +// { +// LIVE = 0, +// HOT_ARCHIVE = 1, +// COLD_ARCHIVE = 2 +// }; +// +// =========================================================================== +xdr.enum("BucketListType", { + live: 0, + hotArchive: 1, + coldArchive: 2, +}); + +// === xdr source ============================================================ +// +// enum BucketEntryType +// { +// METAENTRY = +// -1, // At-and-after protocol 11: bucket metadata, should come first. +// LIVEENTRY = 0, // Before protocol 11: created-or-updated; +// // At-and-after protocol 11: only updated. +// DEADENTRY = 1, +// INITENTRY = 2 // At-and-after protocol 11: only created. +// }; +// +// =========================================================================== +xdr.enum("BucketEntryType", { + metaentry: -1, + liveentry: 0, + deadentry: 1, + initentry: 2, +}); + +// === xdr source ============================================================ +// +// 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 +// // 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) +// }; +// +// =========================================================================== +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 ============================================================ +// +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// BucketListType bucketListType; +// } +// +// =========================================================================== +xdr.union("BucketMetadataExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "bucketListType"], + ], + arms: { + bucketListType: xdr.lookup("BucketListType"), + }, +}); + +// === xdr source ============================================================ +// +// struct BucketMetadata +// { +// // Indicates the protocol version used to create / merge this bucket. +// uint32 ledgerVersion; +// +// // reserved for future use +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// BucketListType bucketListType; +// } +// ext; +// }; +// +// =========================================================================== +xdr.struct("BucketMetadata", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["ext", xdr.lookup("BucketMetadataExt")], +]); + +// === xdr source ============================================================ +// +// union BucketEntry switch (BucketEntryType type) +// { +// case LIVEENTRY: +// case INITENTRY: +// LedgerEntry liveEntry; +// +// case DEADENTRY: +// LedgerKey deadEntry; +// case METAENTRY: +// BucketMetadata metaEntry; +// }; +// +// =========================================================================== +xdr.union("BucketEntry", { + switchOn: xdr.lookup("BucketEntryType"), + switchName: "type", + switches: [ + ["liveentry", "liveEntry"], + ["initentry", "liveEntry"], + ["deadentry", "deadEntry"], + ["metaentry", "metaEntry"], + ], + arms: { + liveEntry: xdr.lookup("LedgerEntry"), + deadEntry: xdr.lookup("LedgerKey"), + metaEntry: xdr.lookup("BucketMetadata"), + }, +}); + +// === xdr source ============================================================ +// +// union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) +// { +// case HOT_ARCHIVE_ARCHIVED: +// LedgerEntry archivedEntry; +// +// case HOT_ARCHIVE_LIVE: +// case HOT_ARCHIVE_DELETED: +// LedgerKey key; +// case HOT_ARCHIVE_METAENTRY: +// BucketMetadata metaEntry; +// }; +// +// =========================================================================== +xdr.union("HotArchiveBucketEntry", { + switchOn: xdr.lookup("HotArchiveBucketEntryType"), + switchName: "type", + switches: [ + ["hotArchiveArchived", "archivedEntry"], + ["hotArchiveLive", "key"], + ["hotArchiveDeleted", "key"], + ["hotArchiveMetaentry", "metaEntry"], + ], + arms: { + archivedEntry: xdr.lookup("LedgerEntry"), + key: xdr.lookup("LedgerKey"), + metaEntry: xdr.lookup("BucketMetadata"), + }, +}); + +// === 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>; @@ -2367,117 +2646,25 @@ xdr.union("LedgerUpgrade", { arms: { newLedgerVersion: xdr.lookup("Uint32"), newBaseFee: xdr.lookup("Uint32"), - newMaxTxSetSize: xdr.lookup("Uint32"), - newBaseReserve: xdr.lookup("Uint32"), - newFlags: xdr.lookup("Uint32"), - newConfig: xdr.lookup("ConfigUpgradeSetKey"), - newMaxSorobanTxSetSize: xdr.lookup("Uint32"), - }, -}); - -// === xdr source ============================================================ -// -// struct ConfigUpgradeSet { -// ConfigSettingEntry updatedEntry<>; -// }; -// -// =========================================================================== -xdr.struct("ConfigUpgradeSet", [ - ["updatedEntry", xdr.varArray(xdr.lookup("ConfigSettingEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// enum BucketEntryType -// { -// METAENTRY = -// -1, // At-and-after protocol 11: bucket metadata, should come first. -// LIVEENTRY = 0, // Before protocol 11: created-or-updated; -// // At-and-after protocol 11: only updated. -// DEADENTRY = 1, -// INITENTRY = 2 // At-and-after protocol 11: only created. -// }; -// -// =========================================================================== -xdr.enum("BucketEntryType", { - metaentry: -1, - liveentry: 0, - deadentry: 1, - initentry: 2, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("BucketMetadataExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct BucketMetadata -// { -// // Indicates the protocol version used to create / merge this bucket. -// uint32 ledgerVersion; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("BucketMetadata", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["ext", xdr.lookup("BucketMetadataExt")], -]); - -// === xdr source ============================================================ -// -// union BucketEntry switch (BucketEntryType type) -// { -// case LIVEENTRY: -// case INITENTRY: -// LedgerEntry liveEntry; -// -// case DEADENTRY: -// LedgerKey deadEntry; -// case METAENTRY: -// BucketMetadata metaEntry; -// }; -// -// =========================================================================== -xdr.union("BucketEntry", { - switchOn: xdr.lookup("BucketEntryType"), - switchName: "type", - switches: [ - ["liveentry", "liveEntry"], - ["initentry", "liveEntry"], - ["deadentry", "deadEntry"], - ["metaentry", "metaEntry"], - ], - arms: { - liveEntry: xdr.lookup("LedgerEntry"), - deadEntry: xdr.lookup("LedgerKey"), - metaEntry: xdr.lookup("BucketMetadata"), + newMaxTxSetSize: xdr.lookup("Uint32"), + newBaseReserve: xdr.lookup("Uint32"), + newFlags: xdr.lookup("Uint32"), + newConfig: xdr.lookup("ConfigUpgradeSetKey"), + newMaxSorobanTxSetSize: xdr.lookup("Uint32"), }, }); +// === xdr source ============================================================ +// +// struct ConfigUpgradeSet { +// ConfigSettingEntry updatedEntry<>; +// }; +// +// =========================================================================== +xdr.struct("ConfigUpgradeSet", [ + ["updatedEntry", xdr.varArray(xdr.lookup("ConfigSettingEntry"), 2147483647)], +]); + // === xdr source ============================================================ // // enum TxSetComponentType @@ -3005,6 +3192,13 @@ 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 @@ -3549,7 +3743,12 @@ xdr.struct("PeerAddress", [ // SEND_MORE_EXTENDED = 20, // // FLOOD_ADVERT = 18, -// FLOOD_DEMAND = 19 +// FLOOD_DEMAND = 19, +// +// TIME_SLICED_SURVEY_REQUEST = 21, +// TIME_SLICED_SURVEY_RESPONSE = 22, +// TIME_SLICED_SURVEY_START_COLLECTING = 23, +// TIME_SLICED_SURVEY_STOP_COLLECTING = 24 // }; // // =========================================================================== @@ -3574,6 +3773,10 @@ xdr.enum("MessageType", { sendMoreExtended: 20, floodAdvert: 18, floodDemand: 19, + timeSlicedSurveyRequest: 21, + timeSlicedSurveyResponse: 22, + timeSlicedSurveyStartCollecting: 23, + timeSlicedSurveyStopCollecting: 24, }); // === xdr source ============================================================ @@ -3594,12 +3797,14 @@ xdr.struct("DontHave", [ // // enum SurveyMessageCommandType // { -// SURVEY_TOPOLOGY = 0 +// SURVEY_TOPOLOGY = 0, +// TIME_SLICED_SURVEY_TOPOLOGY = 1 // }; // // =========================================================================== xdr.enum("SurveyMessageCommandType", { surveyTopology: 0, + timeSlicedSurveyTopology: 1, }); // === xdr source ============================================================ @@ -3607,15 +3812,77 @@ xdr.enum("SurveyMessageCommandType", { // enum SurveyMessageResponseType // { // SURVEY_TOPOLOGY_RESPONSE_V0 = 0, -// SURVEY_TOPOLOGY_RESPONSE_V1 = 1 +// SURVEY_TOPOLOGY_RESPONSE_V1 = 1, +// SURVEY_TOPOLOGY_RESPONSE_V2 = 2 // }; // // =========================================================================== xdr.enum("SurveyMessageResponseType", { surveyTopologyResponseV0: 0, surveyTopologyResponseV1: 1, + surveyTopologyResponseV2: 2, }); +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyStartCollectingMessage +// { +// NodeID surveyorID; +// uint32 nonce; +// uint32 ledgerNum; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyStartCollectingMessage", [ + ["surveyorId", xdr.lookup("NodeId")], + ["nonce", xdr.lookup("Uint32")], + ["ledgerNum", xdr.lookup("Uint32")], +]); + +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyStartCollectingMessage +// { +// Signature signature; +// TimeSlicedSurveyStartCollectingMessage startCollecting; +// }; +// +// =========================================================================== +xdr.struct("SignedTimeSlicedSurveyStartCollectingMessage", [ + ["signature", xdr.lookup("Signature")], + ["startCollecting", xdr.lookup("TimeSlicedSurveyStartCollectingMessage")], +]); + +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyStopCollectingMessage +// { +// NodeID surveyorID; +// uint32 nonce; +// uint32 ledgerNum; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyStopCollectingMessage", [ + ["surveyorId", xdr.lookup("NodeId")], + ["nonce", xdr.lookup("Uint32")], + ["ledgerNum", xdr.lookup("Uint32")], +]); + +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyStopCollectingMessage +// { +// Signature signature; +// TimeSlicedSurveyStopCollectingMessage stopCollecting; +// }; +// +// =========================================================================== +xdr.struct("SignedTimeSlicedSurveyStopCollectingMessage", [ + ["signature", xdr.lookup("Signature")], + ["stopCollecting", xdr.lookup("TimeSlicedSurveyStopCollectingMessage")], +]); + // === xdr source ============================================================ // // struct SurveyRequestMessage @@ -3636,6 +3903,24 @@ xdr.struct("SurveyRequestMessage", [ ["commandType", xdr.lookup("SurveyMessageCommandType")], ]); +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyRequestMessage +// { +// SurveyRequestMessage request; +// uint32 nonce; +// uint32 inboundPeersIndex; +// uint32 outboundPeersIndex; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyRequestMessage", [ + ["request", xdr.lookup("SurveyRequestMessage")], + ["nonce", xdr.lookup("Uint32")], + ["inboundPeersIndex", xdr.lookup("Uint32")], + ["outboundPeersIndex", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // struct SignedSurveyRequestMessage @@ -3650,6 +3935,20 @@ xdr.struct("SignedSurveyRequestMessage", [ ["request", xdr.lookup("SurveyRequestMessage")], ]); +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyRequestMessage +// { +// Signature requestSignature; +// TimeSlicedSurveyRequestMessage request; +// }; +// +// =========================================================================== +xdr.struct("SignedTimeSlicedSurveyRequestMessage", [ + ["requestSignature", xdr.lookup("Signature")], + ["request", xdr.lookup("TimeSlicedSurveyRequestMessage")], +]); + // === xdr source ============================================================ // // typedef opaque EncryptedBody<64000>; @@ -3677,6 +3976,20 @@ xdr.struct("SurveyResponseMessage", [ ["encryptedBody", xdr.lookup("EncryptedBody")], ]); +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyResponseMessage +// { +// SurveyResponseMessage response; +// uint32 nonce; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyResponseMessage", [ + ["response", xdr.lookup("SurveyResponseMessage")], + ["nonce", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // struct SignedSurveyResponseMessage @@ -3691,6 +4004,20 @@ xdr.struct("SignedSurveyResponseMessage", [ ["response", xdr.lookup("SurveyResponseMessage")], ]); +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyResponseMessage +// { +// Signature responseSignature; +// TimeSlicedSurveyResponseMessage response; +// }; +// +// =========================================================================== +xdr.struct("SignedTimeSlicedSurveyResponseMessage", [ + ["responseSignature", xdr.lookup("Signature")], + ["response", xdr.lookup("TimeSlicedSurveyResponseMessage")], +]); + // === xdr source ============================================================ // // struct PeerStats @@ -3740,6 +4067,63 @@ xdr.struct("PeerStats", [ // =========================================================================== xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); +// === xdr source ============================================================ +// +// struct TimeSlicedNodeData +// { +// uint32 addedAuthenticatedPeers; +// uint32 droppedAuthenticatedPeers; +// uint32 totalInboundPeerCount; +// uint32 totalOutboundPeerCount; +// +// // SCP stats +// uint32 p75SCPFirstToSelfLatencyMs; +// uint32 p75SCPSelfToOtherLatencyMs; +// +// // How many times the node lost sync in the time slice +// uint32 lostSyncCount; +// +// // Config data +// bool isValidator; +// uint32 maxInboundPeerCount; +// uint32 maxOutboundPeerCount; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedNodeData", [ + ["addedAuthenticatedPeers", xdr.lookup("Uint32")], + ["droppedAuthenticatedPeers", xdr.lookup("Uint32")], + ["totalInboundPeerCount", xdr.lookup("Uint32")], + ["totalOutboundPeerCount", xdr.lookup("Uint32")], + ["p75ScpFirstToSelfLatencyMs", xdr.lookup("Uint32")], + ["p75ScpSelfToOtherLatencyMs", xdr.lookup("Uint32")], + ["lostSyncCount", xdr.lookup("Uint32")], + ["isValidator", xdr.bool()], + ["maxInboundPeerCount", xdr.lookup("Uint32")], + ["maxOutboundPeerCount", xdr.lookup("Uint32")], +]); + +// === 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 @@ -3783,6 +4167,22 @@ xdr.struct("TopologyResponseBodyV1", [ ["maxOutboundPeerCount", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// struct TopologyResponseBodyV2 +// { +// TimeSlicedPeerDataList inboundPeers; +// TimeSlicedPeerDataList outboundPeers; +// TimeSlicedNodeData nodeData; +// }; +// +// =========================================================================== +xdr.struct("TopologyResponseBodyV2", [ + ["inboundPeers", xdr.lookup("TimeSlicedPeerDataList")], + ["outboundPeers", xdr.lookup("TimeSlicedPeerDataList")], + ["nodeData", xdr.lookup("TimeSlicedNodeData")], +]); + // === xdr source ============================================================ // // union SurveyResponseBody switch (SurveyMessageResponseType type) @@ -3791,6 +4191,8 @@ xdr.struct("TopologyResponseBodyV1", [ // TopologyResponseBodyV0 topologyResponseBodyV0; // case SURVEY_TOPOLOGY_RESPONSE_V1: // TopologyResponseBodyV1 topologyResponseBodyV1; +// case SURVEY_TOPOLOGY_RESPONSE_V2: +// TopologyResponseBodyV2 topologyResponseBodyV2; // }; // // =========================================================================== @@ -3800,10 +4202,12 @@ xdr.union("SurveyResponseBody", { switches: [ ["surveyTopologyResponseV0", "topologyResponseBodyV0"], ["surveyTopologyResponseV1", "topologyResponseBodyV1"], + ["surveyTopologyResponseV2", "topologyResponseBodyV2"], ], arms: { topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), + topologyResponseBodyV2: xdr.lookup("TopologyResponseBodyV2"), }, }); @@ -3892,6 +4296,20 @@ xdr.struct("FloodDemand", [ // case SURVEY_RESPONSE: // SignedSurveyResponseMessage signedSurveyResponseMessage; // +// case TIME_SLICED_SURVEY_REQUEST: +// SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; +// +// case TIME_SLICED_SURVEY_RESPONSE: +// SignedTimeSlicedSurveyResponseMessage signedTimeSlicedSurveyResponseMessage; +// +// case TIME_SLICED_SURVEY_START_COLLECTING: +// SignedTimeSlicedSurveyStartCollectingMessage +// signedTimeSlicedSurveyStartCollectingMessage; +// +// case TIME_SLICED_SURVEY_STOP_COLLECTING: +// SignedTimeSlicedSurveyStopCollectingMessage +// signedTimeSlicedSurveyStopCollectingMessage; +// // // SCP // case GET_SCP_QUORUMSET: // uint256 qSetHash; @@ -3929,6 +4347,10 @@ xdr.union("StellarMessage", { ["transaction", "transaction"], ["surveyRequest", "signedSurveyRequestMessage"], ["surveyResponse", "signedSurveyResponseMessage"], + ["timeSlicedSurveyRequest", "signedTimeSlicedSurveyRequestMessage"], + ["timeSlicedSurveyResponse", "signedTimeSlicedSurveyResponseMessage"], + ["timeSlicedSurveyStartCollecting", "signedTimeSlicedSurveyStartCollectingMessage"], + ["timeSlicedSurveyStopCollecting", "signedTimeSlicedSurveyStopCollectingMessage"], ["getScpQuorumset", "qSetHash"], ["scpQuorumset", "qSet"], ["scpMessage", "envelope"], @@ -3950,6 +4372,10 @@ xdr.union("StellarMessage", { transaction: xdr.lookup("TransactionEnvelope"), signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), + signedTimeSlicedSurveyRequestMessage: xdr.lookup("SignedTimeSlicedSurveyRequestMessage"), + signedTimeSlicedSurveyResponseMessage: xdr.lookup("SignedTimeSlicedSurveyResponseMessage"), + signedTimeSlicedSurveyStartCollectingMessage: xdr.lookup("SignedTimeSlicedSurveyStartCollectingMessage"), + signedTimeSlicedSurveyStopCollectingMessage: xdr.lookup("SignedTimeSlicedSurveyStopCollectingMessage"), qSetHash: xdr.lookup("Uint256"), qSet: xdr.lookup("ScpQuorumSet"), envelope: xdr.lookup("ScpEnvelope"), @@ -4619,7 +5045,8 @@ xdr.struct("LiquidityPoolWithdrawOp", [ // { // HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, // HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, -// HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 +// HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2, +// HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3 // }; // // =========================================================================== @@ -4627,6 +5054,7 @@ xdr.enum("HostFunctionType", { hostFunctionTypeInvokeContract: 0, hostFunctionTypeCreateContract: 1, hostFunctionTypeUploadContractWasm: 2, + hostFunctionTypeCreateContractV2: 3, }); // === xdr source ============================================================ @@ -4699,6 +5127,23 @@ xdr.struct("CreateContractArgs", [ ["executable", xdr.lookup("ContractExecutable")], ]); +// === xdr source ============================================================ +// +// struct CreateContractArgsV2 +// { +// ContractIDPreimage contractIDPreimage; +// ContractExecutable executable; +// // Arguments of the contract's constructor. +// SCVal constructorArgs<>; +// }; +// +// =========================================================================== +xdr.struct("CreateContractArgsV2", [ + ["contractIdPreimage", xdr.lookup("ContractIdPreimage")], + ["executable", xdr.lookup("ContractExecutable")], + ["constructorArgs", xdr.varArray(xdr.lookup("ScVal"), 2147483647)], +]); + // === xdr source ============================================================ // // struct InvokeContractArgs { @@ -4724,6 +5169,8 @@ xdr.struct("InvokeContractArgs", [ // CreateContractArgs createContract; // case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: // opaque wasm<>; +// case HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2: +// CreateContractArgsV2 createContractV2; // }; // // =========================================================================== @@ -4734,11 +5181,13 @@ xdr.union("HostFunction", { ["hostFunctionTypeInvokeContract", "invokeContract"], ["hostFunctionTypeCreateContract", "createContract"], ["hostFunctionTypeUploadContractWasm", "wasm"], + ["hostFunctionTypeCreateContractV2", "createContractV2"], ], arms: { invokeContract: xdr.lookup("InvokeContractArgs"), createContract: xdr.lookup("CreateContractArgs"), wasm: xdr.varOpaque(), + createContractV2: xdr.lookup("CreateContractArgsV2"), }, }); @@ -4747,13 +5196,15 @@ xdr.union("HostFunction", { // enum SorobanAuthorizedFunctionType // { // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, -// SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 +// SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1, +// SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2 // }; // // =========================================================================== xdr.enum("SorobanAuthorizedFunctionType", { sorobanAuthorizedFunctionTypeContractFn: 0, sorobanAuthorizedFunctionTypeCreateContractHostFn: 1, + sorobanAuthorizedFunctionTypeCreateContractV2HostFn: 2, }); // === xdr source ============================================================ @@ -4762,8 +5213,18 @@ xdr.enum("SorobanAuthorizedFunctionType", { // { // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: // InvokeContractArgs contractFn; +// // This variant of auth payload for creating new contract instances +// // doesn't allow specifying the constructor arguments, creating contracts +// // with constructors that take arguments is only possible by authorizing +// // `SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN` +// // (protocol 22+). // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: // CreateContractArgs createContractHostFn; +// // This variant of auth payload for creating new contract instances +// // is only accepted in and after protocol 22. It allows authorizing the +// // contract constructor arguments. +// case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN: +// CreateContractArgsV2 createContractV2HostFn; // }; // // =========================================================================== @@ -4773,10 +5234,12 @@ xdr.union("SorobanAuthorizedFunction", { switches: [ ["sorobanAuthorizedFunctionTypeContractFn", "contractFn"], ["sorobanAuthorizedFunctionTypeCreateContractHostFn", "createContractHostFn"], + ["sorobanAuthorizedFunctionTypeCreateContractV2HostFn", "createContractV2HostFn"], ], arms: { contractFn: xdr.lookup("InvokeContractArgs"), createContractHostFn: xdr.lookup("CreateContractArgs"), + createContractV2HostFn: xdr.lookup("CreateContractArgsV2"), }, }); @@ -5409,6 +5872,127 @@ 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 @@ -8420,6 +9004,68 @@ xdr.struct("HmacSha256Mac", [ ["mac", xdr.opaque(32)], ]); +// === xdr source ============================================================ +// +// struct ShortHashSeed +// { +// opaque seed[16]; +// }; +// +// =========================================================================== +xdr.struct("ShortHashSeed", [ + ["seed", xdr.opaque(16)], +]); + +// === xdr source ============================================================ +// +// enum BinaryFuseFilterType +// { +// BINARY_FUSE_FILTER_8_BIT = 0, +// BINARY_FUSE_FILTER_16_BIT = 1, +// BINARY_FUSE_FILTER_32_BIT = 2 +// }; +// +// =========================================================================== +xdr.enum("BinaryFuseFilterType", { + binaryFuseFilter8Bit: 0, + binaryFuseFilter16Bit: 1, + binaryFuseFilter32Bit: 2, +}); + +// === xdr source ============================================================ +// +// struct SerializedBinaryFuseFilter +// { +// BinaryFuseFilterType type; +// +// // Seed used to hash input to filter +// ShortHashSeed inputHashSeed; +// +// // Seed used for internal filter hash operations +// ShortHashSeed filterSeed; +// uint32 segmentLength; +// uint32 segementLengthMask; +// uint32 segmentCount; +// uint32 segmentCountLength; +// uint32 fingerprintLength; // Length in terms of element count, not bytes +// +// // Array of uint8_t, uint16_t, or uint32_t depending on filter type +// opaque fingerprints<>; +// }; +// +// =========================================================================== +xdr.struct("SerializedBinaryFuseFilter", [ + ["type", xdr.lookup("BinaryFuseFilterType")], + ["inputHashSeed", xdr.lookup("ShortHashSeed")], + ["filterSeed", xdr.lookup("ShortHashSeed")], + ["segmentLength", xdr.lookup("Uint32")], + ["segementLengthMask", xdr.lookup("Uint32")], + ["segmentCount", xdr.lookup("Uint32")], + ["segmentCountLength", xdr.lookup("Uint32")], + ["fingerprintLength", xdr.lookup("Uint32")], + ["fingerprints", xdr.varOpaque()], +]); + // === xdr source ============================================================ // // enum SCValType @@ -8946,12 +9592,28 @@ xdr.enum("ScEnvMetaKind", { scEnvMetaKindInterfaceVersion: 0, }); +// === xdr source ============================================================ +// +// struct { +// uint32 protocol; +// uint32 preRelease; +// } +// +// =========================================================================== +xdr.struct("ScEnvMetaEntryInterfaceVersion", [ + ["protocol", xdr.lookup("Uint32")], + ["preRelease", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // union SCEnvMetaEntry switch (SCEnvMetaKind kind) // { // case SC_ENV_META_KIND_INTERFACE_VERSION: -// uint64 interfaceVersion; +// struct { +// uint32 protocol; +// uint32 preRelease; +// } interfaceVersion; // }; // // =========================================================================== @@ -8962,7 +9624,7 @@ xdr.union("ScEnvMetaEntry", { ["scEnvMetaKindInterfaceVersion", "interfaceVersion"], ], arms: { - interfaceVersion: xdr.lookup("Uint64"), + interfaceVersion: xdr.lookup("ScEnvMetaEntryInterfaceVersion"), }, }); @@ -9775,7 +10437,58 @@ xdr.struct("ConfigSettingContractBandwidthV0", [ // // point on a 256-bit elliptic curve // Sec1DecodePointUncompressed = 43, // // Cost of verifying an ECDSA Secp256r1 signature -// VerifyEcdsaSecp256r1Sig = 44 +// VerifyEcdsaSecp256r1Sig = 44, +// +// // Cost of encoding a BLS12-381 Fp (base field element) +// Bls12381EncodeFp = 45, +// // Cost of decoding a BLS12-381 Fp (base field element) +// Bls12381DecodeFp = 46, +// // Cost of checking a G1 point lies on the curve +// Bls12381G1CheckPointOnCurve = 47, +// // Cost of checking a G1 point belongs to the correct subgroup +// Bls12381G1CheckPointInSubgroup = 48, +// // Cost of checking a G2 point lies on the curve +// Bls12381G2CheckPointOnCurve = 49, +// // Cost of checking a G2 point belongs to the correct subgroup +// Bls12381G2CheckPointInSubgroup = 50, +// // Cost of converting a BLS12-381 G1 point from projective to affine coordinates +// Bls12381G1ProjectiveToAffine = 51, +// // Cost of converting a BLS12-381 G2 point from projective to affine coordinates +// Bls12381G2ProjectiveToAffine = 52, +// // Cost of performing BLS12-381 G1 point addition +// Bls12381G1Add = 53, +// // Cost of performing BLS12-381 G1 scalar multiplication +// Bls12381G1Mul = 54, +// // Cost of performing BLS12-381 G1 multi-scalar multiplication (MSM) +// Bls12381G1Msm = 55, +// // Cost of mapping a BLS12-381 Fp field element to a G1 point +// Bls12381MapFpToG1 = 56, +// // Cost of hashing to a BLS12-381 G1 point +// Bls12381HashToG1 = 57, +// // Cost of performing BLS12-381 G2 point addition +// Bls12381G2Add = 58, +// // Cost of performing BLS12-381 G2 scalar multiplication +// Bls12381G2Mul = 59, +// // Cost of performing BLS12-381 G2 multi-scalar multiplication (MSM) +// Bls12381G2Msm = 60, +// // Cost of mapping a BLS12-381 Fp2 field element to a G2 point +// Bls12381MapFp2ToG2 = 61, +// // Cost of hashing to a BLS12-381 G2 point +// Bls12381HashToG2 = 62, +// // Cost of performing BLS12-381 pairing operation +// Bls12381Pairing = 63, +// // Cost of converting a BLS12-381 scalar element from U256 +// Bls12381FrFromU256 = 64, +// // Cost of converting a BLS12-381 scalar element to U256 +// Bls12381FrToU256 = 65, +// // Cost of performing BLS12-381 scalar element addition/subtraction +// Bls12381FrAddSub = 66, +// // Cost of performing BLS12-381 scalar element multiplication +// Bls12381FrMul = 67, +// // Cost of performing BLS12-381 scalar element exponentiation +// Bls12381FrPow = 68, +// // Cost of performing BLS12-381 scalar element inversion +// Bls12381FrInv = 69 // }; // // =========================================================================== @@ -9825,6 +10538,31 @@ xdr.enum("ContractCostType", { instantiateWasmDataSegmentBytes: 42, sec1DecodePointUncompressed: 43, verifyEcdsaSecp256r1Sig: 44, + bls12381EncodeFp: 45, + bls12381DecodeFp: 46, + bls12381G1CheckPointOnCurve: 47, + bls12381G1CheckPointInSubgroup: 48, + bls12381G2CheckPointOnCurve: 49, + bls12381G2CheckPointInSubgroup: 50, + bls12381G1ProjectiveToAffine: 51, + bls12381G2ProjectiveToAffine: 52, + bls12381G1Add: 53, + bls12381G1Mul: 54, + bls12381G1Msm: 55, + bls12381MapFpToG1: 56, + bls12381HashToG1: 57, + bls12381G2Add: 58, + bls12381G2Mul: 59, + bls12381G2Msm: 60, + bls12381MapFp2ToG2: 61, + bls12381HashToG2: 62, + bls12381Pairing: 63, + bls12381FrFromU256: 64, + bls12381FrToU256: 65, + bls12381FrAddSub: 66, + bls12381FrMul: 67, + bls12381FrPow: 68, + bls12381FrInv: 69, }); // === xdr source ============================================================ diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index 90e88f57..fe8ce869 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -1,4 +1,4 @@ -// Automatically generated by xdrgen +// Automatically generated by xdrgen on 2024-09-12T11:09:00-08:00 // DO NOT EDIT or your changes may be overwritten /* jshint maxstatements:2147483647 */ @@ -15,13 +15,6 @@ 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 @@ -2054,6 +2047,285 @@ xdr.enum("EnvelopeType", { envelopeTypeSorobanAuthorization: 9, }); +// === xdr source ============================================================ +// +// enum BucketListType +// { +// LIVE = 0, +// HOT_ARCHIVE = 1, +// COLD_ARCHIVE = 2 +// }; +// +// =========================================================================== +xdr.enum("BucketListType", { + live: 0, + hotArchive: 1, + coldArchive: 2, +}); + +// === xdr source ============================================================ +// +// enum BucketEntryType +// { +// METAENTRY = +// -1, // At-and-after protocol 11: bucket metadata, should come first. +// LIVEENTRY = 0, // Before protocol 11: created-or-updated; +// // At-and-after protocol 11: only updated. +// DEADENTRY = 1, +// INITENTRY = 2 // At-and-after protocol 11: only created. +// }; +// +// =========================================================================== +xdr.enum("BucketEntryType", { + metaentry: -1, + liveentry: 0, + deadentry: 1, + initentry: 2, +}); + +// === xdr source ============================================================ +// +// 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 +// // 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) +// }; +// +// =========================================================================== +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 ============================================================ +// +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// BucketListType bucketListType; +// } +// +// =========================================================================== +xdr.union("BucketMetadataExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "bucketListType"], + ], + arms: { + bucketListType: xdr.lookup("BucketListType"), + }, +}); + +// === xdr source ============================================================ +// +// struct BucketMetadata +// { +// // Indicates the protocol version used to create / merge this bucket. +// uint32 ledgerVersion; +// +// // reserved for future use +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// BucketListType bucketListType; +// } +// ext; +// }; +// +// =========================================================================== +xdr.struct("BucketMetadata", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["ext", xdr.lookup("BucketMetadataExt")], +]); + +// === xdr source ============================================================ +// +// union BucketEntry switch (BucketEntryType type) +// { +// case LIVEENTRY: +// case INITENTRY: +// LedgerEntry liveEntry; +// +// case DEADENTRY: +// LedgerKey deadEntry; +// case METAENTRY: +// BucketMetadata metaEntry; +// }; +// +// =========================================================================== +xdr.union("BucketEntry", { + switchOn: xdr.lookup("BucketEntryType"), + switchName: "type", + switches: [ + ["liveentry", "liveEntry"], + ["initentry", "liveEntry"], + ["deadentry", "deadEntry"], + ["metaentry", "metaEntry"], + ], + arms: { + liveEntry: xdr.lookup("LedgerEntry"), + deadEntry: xdr.lookup("LedgerKey"), + metaEntry: xdr.lookup("BucketMetadata"), + }, +}); + +// === xdr source ============================================================ +// +// union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) +// { +// case HOT_ARCHIVE_ARCHIVED: +// LedgerEntry archivedEntry; +// +// case HOT_ARCHIVE_LIVE: +// case HOT_ARCHIVE_DELETED: +// LedgerKey key; +// case HOT_ARCHIVE_METAENTRY: +// BucketMetadata metaEntry; +// }; +// +// =========================================================================== +xdr.union("HotArchiveBucketEntry", { + switchOn: xdr.lookup("HotArchiveBucketEntryType"), + switchName: "type", + switches: [ + ["hotArchiveArchived", "archivedEntry"], + ["hotArchiveLive", "key"], + ["hotArchiveDeleted", "key"], + ["hotArchiveMetaentry", "metaEntry"], + ], + arms: { + archivedEntry: xdr.lookup("LedgerEntry"), + key: xdr.lookup("LedgerKey"), + metaEntry: xdr.lookup("BucketMetadata"), + }, +}); + +// === 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>; @@ -2388,109 +2660,45 @@ xdr.struct("ConfigUpgradeSet", [ // === xdr source ============================================================ // -// enum BucketEntryType +// enum TxSetComponentType // { -// METAENTRY = -// -1, // At-and-after protocol 11: bucket metadata, should come first. -// LIVEENTRY = 0, // Before protocol 11: created-or-updated; -// // At-and-after protocol 11: only updated. -// DEADENTRY = 1, -// INITENTRY = 2 // At-and-after protocol 11: only created. +// // txs with effective fee <= bid derived from a base fee (if any). +// // If base fee is not specified, no discount is applied. +// TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 // }; // // =========================================================================== -xdr.enum("BucketEntryType", { - metaentry: -1, - liveentry: 0, - deadentry: 1, - initentry: 2, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("BucketMetadataExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, +xdr.enum("TxSetComponentType", { + txsetCompTxsMaybeDiscountedFee: 0, }); // === xdr source ============================================================ // -// struct BucketMetadata -// { -// // Indicates the protocol version used to create / merge this bucket. -// uint32 ledgerVersion; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; +// typedef TransactionEnvelope TxExecutionThread<>; // // =========================================================================== -xdr.struct("BucketMetadata", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["ext", xdr.lookup("BucketMetadataExt")], -]); +xdr.typedef("TxExecutionThread", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)); // === xdr source ============================================================ // -// union BucketEntry switch (BucketEntryType type) -// { -// case LIVEENTRY: -// case INITENTRY: -// LedgerEntry liveEntry; -// -// case DEADENTRY: -// LedgerKey deadEntry; -// case METAENTRY: -// BucketMetadata metaEntry; -// }; +// typedef TxExecutionThread ParallelTxExecutionStage<>; // // =========================================================================== -xdr.union("BucketEntry", { - switchOn: xdr.lookup("BucketEntryType"), - switchName: "type", - switches: [ - ["liveentry", "liveEntry"], - ["initentry", "liveEntry"], - ["deadentry", "deadEntry"], - ["metaentry", "metaEntry"], - ], - arms: { - liveEntry: xdr.lookup("LedgerEntry"), - deadEntry: xdr.lookup("LedgerKey"), - metaEntry: xdr.lookup("BucketMetadata"), - }, -}); +xdr.typedef("ParallelTxExecutionStage", xdr.varArray(xdr.lookup("TxExecutionThread"), 2147483647)); // === xdr source ============================================================ // -// enum TxSetComponentType +// struct ParallelTxsComponent // { -// // txs with effective fee <= bid derived from a base fee (if any). -// // If base fee is not specified, no discount is applied. -// TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 +// int64* baseFee; +// ParallelTxExecutionStage executionStages<>; // }; // // =========================================================================== -xdr.enum("TxSetComponentType", { - txsetCompTxsMaybeDiscountedFee: 0, -}); +xdr.struct("ParallelTxsComponent", [ + ["baseFee", xdr.option(xdr.lookup("Int64"))], + ["executionStages", xdr.varArray(xdr.lookup("ParallelTxExecutionStage"), 2147483647)], +]); // === xdr source ============================================================ // @@ -2536,6 +2744,8 @@ xdr.union("TxSetComponent", { // { // case 0: // TxSetComponent v0Components<>; +// case 1: +// ParallelTxsComponent parallelTxsComponent; // }; // // =========================================================================== @@ -2544,9 +2754,11 @@ xdr.union("TransactionPhase", { switchName: "v", switches: [ [0, "v0Components"], + [1, "parallelTxsComponent"], ], arms: { v0Components: xdr.varArray(xdr.lookup("TxSetComponent"), 2147483647), + parallelTxsComponent: xdr.lookup("ParallelTxsComponent"), }, }); @@ -3549,7 +3761,12 @@ xdr.struct("PeerAddress", [ // SEND_MORE_EXTENDED = 20, // // FLOOD_ADVERT = 18, -// FLOOD_DEMAND = 19 +// FLOOD_DEMAND = 19, +// +// TIME_SLICED_SURVEY_REQUEST = 21, +// TIME_SLICED_SURVEY_RESPONSE = 22, +// TIME_SLICED_SURVEY_START_COLLECTING = 23, +// TIME_SLICED_SURVEY_STOP_COLLECTING = 24 // }; // // =========================================================================== @@ -3574,47 +3791,115 @@ xdr.enum("MessageType", { sendMoreExtended: 20, floodAdvert: 18, floodDemand: 19, + timeSlicedSurveyRequest: 21, + timeSlicedSurveyResponse: 22, + timeSlicedSurveyStartCollecting: 23, + timeSlicedSurveyStopCollecting: 24, }); // === xdr source ============================================================ // -// struct DontHave +// struct DontHave +// { +// MessageType type; +// uint256 reqHash; +// }; +// +// =========================================================================== +xdr.struct("DontHave", [ + ["type", xdr.lookup("MessageType")], + ["reqHash", xdr.lookup("Uint256")], +]); + +// === xdr source ============================================================ +// +// enum SurveyMessageCommandType +// { +// SURVEY_TOPOLOGY = 0, +// TIME_SLICED_SURVEY_TOPOLOGY = 1 +// }; +// +// =========================================================================== +xdr.enum("SurveyMessageCommandType", { + surveyTopology: 0, + timeSlicedSurveyTopology: 1, +}); + +// === xdr source ============================================================ +// +// 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, +}); + +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyStartCollectingMessage +// { +// NodeID surveyorID; +// uint32 nonce; +// uint32 ledgerNum; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyStartCollectingMessage", [ + ["surveyorId", xdr.lookup("NodeId")], + ["nonce", xdr.lookup("Uint32")], + ["ledgerNum", xdr.lookup("Uint32")], +]); + +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyStartCollectingMessage // { -// MessageType type; -// uint256 reqHash; +// Signature signature; +// TimeSlicedSurveyStartCollectingMessage startCollecting; // }; // // =========================================================================== -xdr.struct("DontHave", [ - ["type", xdr.lookup("MessageType")], - ["reqHash", xdr.lookup("Uint256")], +xdr.struct("SignedTimeSlicedSurveyStartCollectingMessage", [ + ["signature", xdr.lookup("Signature")], + ["startCollecting", xdr.lookup("TimeSlicedSurveyStartCollectingMessage")], ]); // === xdr source ============================================================ // -// enum SurveyMessageCommandType +// struct TimeSlicedSurveyStopCollectingMessage // { -// SURVEY_TOPOLOGY = 0 +// NodeID surveyorID; +// uint32 nonce; +// uint32 ledgerNum; // }; // // =========================================================================== -xdr.enum("SurveyMessageCommandType", { - surveyTopology: 0, -}); +xdr.struct("TimeSlicedSurveyStopCollectingMessage", [ + ["surveyorId", xdr.lookup("NodeId")], + ["nonce", xdr.lookup("Uint32")], + ["ledgerNum", xdr.lookup("Uint32")], +]); // === xdr source ============================================================ // -// enum SurveyMessageResponseType +// struct SignedTimeSlicedSurveyStopCollectingMessage // { -// SURVEY_TOPOLOGY_RESPONSE_V0 = 0, -// SURVEY_TOPOLOGY_RESPONSE_V1 = 1 +// Signature signature; +// TimeSlicedSurveyStopCollectingMessage stopCollecting; // }; // // =========================================================================== -xdr.enum("SurveyMessageResponseType", { - surveyTopologyResponseV0: 0, - surveyTopologyResponseV1: 1, -}); +xdr.struct("SignedTimeSlicedSurveyStopCollectingMessage", [ + ["signature", xdr.lookup("Signature")], + ["stopCollecting", xdr.lookup("TimeSlicedSurveyStopCollectingMessage")], +]); // === xdr source ============================================================ // @@ -3636,6 +3921,24 @@ xdr.struct("SurveyRequestMessage", [ ["commandType", xdr.lookup("SurveyMessageCommandType")], ]); +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyRequestMessage +// { +// SurveyRequestMessage request; +// uint32 nonce; +// uint32 inboundPeersIndex; +// uint32 outboundPeersIndex; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyRequestMessage", [ + ["request", xdr.lookup("SurveyRequestMessage")], + ["nonce", xdr.lookup("Uint32")], + ["inboundPeersIndex", xdr.lookup("Uint32")], + ["outboundPeersIndex", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // struct SignedSurveyRequestMessage @@ -3650,6 +3953,20 @@ xdr.struct("SignedSurveyRequestMessage", [ ["request", xdr.lookup("SurveyRequestMessage")], ]); +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyRequestMessage +// { +// Signature requestSignature; +// TimeSlicedSurveyRequestMessage request; +// }; +// +// =========================================================================== +xdr.struct("SignedTimeSlicedSurveyRequestMessage", [ + ["requestSignature", xdr.lookup("Signature")], + ["request", xdr.lookup("TimeSlicedSurveyRequestMessage")], +]); + // === xdr source ============================================================ // // typedef opaque EncryptedBody<64000>; @@ -3677,6 +3994,20 @@ xdr.struct("SurveyResponseMessage", [ ["encryptedBody", xdr.lookup("EncryptedBody")], ]); +// === xdr source ============================================================ +// +// struct TimeSlicedSurveyResponseMessage +// { +// SurveyResponseMessage response; +// uint32 nonce; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedSurveyResponseMessage", [ + ["response", xdr.lookup("SurveyResponseMessage")], + ["nonce", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // struct SignedSurveyResponseMessage @@ -3691,6 +4022,20 @@ xdr.struct("SignedSurveyResponseMessage", [ ["response", xdr.lookup("SurveyResponseMessage")], ]); +// === xdr source ============================================================ +// +// struct SignedTimeSlicedSurveyResponseMessage +// { +// Signature responseSignature; +// TimeSlicedSurveyResponseMessage response; +// }; +// +// =========================================================================== +xdr.struct("SignedTimeSlicedSurveyResponseMessage", [ + ["responseSignature", xdr.lookup("Signature")], + ["response", xdr.lookup("TimeSlicedSurveyResponseMessage")], +]); + // === xdr source ============================================================ // // struct PeerStats @@ -3740,6 +4085,63 @@ xdr.struct("PeerStats", [ // =========================================================================== xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); +// === xdr source ============================================================ +// +// struct TimeSlicedNodeData +// { +// uint32 addedAuthenticatedPeers; +// uint32 droppedAuthenticatedPeers; +// uint32 totalInboundPeerCount; +// uint32 totalOutboundPeerCount; +// +// // SCP stats +// uint32 p75SCPFirstToSelfLatencyMs; +// uint32 p75SCPSelfToOtherLatencyMs; +// +// // How many times the node lost sync in the time slice +// uint32 lostSyncCount; +// +// // Config data +// bool isValidator; +// uint32 maxInboundPeerCount; +// uint32 maxOutboundPeerCount; +// }; +// +// =========================================================================== +xdr.struct("TimeSlicedNodeData", [ + ["addedAuthenticatedPeers", xdr.lookup("Uint32")], + ["droppedAuthenticatedPeers", xdr.lookup("Uint32")], + ["totalInboundPeerCount", xdr.lookup("Uint32")], + ["totalOutboundPeerCount", xdr.lookup("Uint32")], + ["p75ScpFirstToSelfLatencyMs", xdr.lookup("Uint32")], + ["p75ScpSelfToOtherLatencyMs", xdr.lookup("Uint32")], + ["lostSyncCount", xdr.lookup("Uint32")], + ["isValidator", xdr.bool()], + ["maxInboundPeerCount", xdr.lookup("Uint32")], + ["maxOutboundPeerCount", xdr.lookup("Uint32")], +]); + +// === 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 @@ -3783,6 +4185,22 @@ xdr.struct("TopologyResponseBodyV1", [ ["maxOutboundPeerCount", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// struct TopologyResponseBodyV2 +// { +// TimeSlicedPeerDataList inboundPeers; +// TimeSlicedPeerDataList outboundPeers; +// TimeSlicedNodeData nodeData; +// }; +// +// =========================================================================== +xdr.struct("TopologyResponseBodyV2", [ + ["inboundPeers", xdr.lookup("TimeSlicedPeerDataList")], + ["outboundPeers", xdr.lookup("TimeSlicedPeerDataList")], + ["nodeData", xdr.lookup("TimeSlicedNodeData")], +]); + // === xdr source ============================================================ // // union SurveyResponseBody switch (SurveyMessageResponseType type) @@ -3791,6 +4209,8 @@ xdr.struct("TopologyResponseBodyV1", [ // TopologyResponseBodyV0 topologyResponseBodyV0; // case SURVEY_TOPOLOGY_RESPONSE_V1: // TopologyResponseBodyV1 topologyResponseBodyV1; +// case SURVEY_TOPOLOGY_RESPONSE_V2: +// TopologyResponseBodyV2 topologyResponseBodyV2; // }; // // =========================================================================== @@ -3800,10 +4220,12 @@ xdr.union("SurveyResponseBody", { switches: [ ["surveyTopologyResponseV0", "topologyResponseBodyV0"], ["surveyTopologyResponseV1", "topologyResponseBodyV1"], + ["surveyTopologyResponseV2", "topologyResponseBodyV2"], ], arms: { topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), + topologyResponseBodyV2: xdr.lookup("TopologyResponseBodyV2"), }, }); @@ -3892,6 +4314,20 @@ xdr.struct("FloodDemand", [ // case SURVEY_RESPONSE: // SignedSurveyResponseMessage signedSurveyResponseMessage; // +// case TIME_SLICED_SURVEY_REQUEST: +// SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; +// +// case TIME_SLICED_SURVEY_RESPONSE: +// SignedTimeSlicedSurveyResponseMessage signedTimeSlicedSurveyResponseMessage; +// +// case TIME_SLICED_SURVEY_START_COLLECTING: +// SignedTimeSlicedSurveyStartCollectingMessage +// signedTimeSlicedSurveyStartCollectingMessage; +// +// case TIME_SLICED_SURVEY_STOP_COLLECTING: +// SignedTimeSlicedSurveyStopCollectingMessage +// signedTimeSlicedSurveyStopCollectingMessage; +// // // SCP // case GET_SCP_QUORUMSET: // uint256 qSetHash; @@ -3929,6 +4365,10 @@ xdr.union("StellarMessage", { ["transaction", "transaction"], ["surveyRequest", "signedSurveyRequestMessage"], ["surveyResponse", "signedSurveyResponseMessage"], + ["timeSlicedSurveyRequest", "signedTimeSlicedSurveyRequestMessage"], + ["timeSlicedSurveyResponse", "signedTimeSlicedSurveyResponseMessage"], + ["timeSlicedSurveyStartCollecting", "signedTimeSlicedSurveyStartCollectingMessage"], + ["timeSlicedSurveyStopCollecting", "signedTimeSlicedSurveyStopCollectingMessage"], ["getScpQuorumset", "qSetHash"], ["scpQuorumset", "qSet"], ["scpMessage", "envelope"], @@ -3950,6 +4390,10 @@ xdr.union("StellarMessage", { transaction: xdr.lookup("TransactionEnvelope"), signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), + signedTimeSlicedSurveyRequestMessage: xdr.lookup("SignedTimeSlicedSurveyRequestMessage"), + signedTimeSlicedSurveyResponseMessage: xdr.lookup("SignedTimeSlicedSurveyResponseMessage"), + signedTimeSlicedSurveyStartCollectingMessage: xdr.lookup("SignedTimeSlicedSurveyStartCollectingMessage"), + signedTimeSlicedSurveyStopCollectingMessage: xdr.lookup("SignedTimeSlicedSurveyStopCollectingMessage"), qSetHash: xdr.lookup("Uint256"), qSet: xdr.lookup("ScpQuorumSet"), envelope: xdr.lookup("ScpEnvelope"), @@ -4619,7 +5063,8 @@ xdr.struct("LiquidityPoolWithdrawOp", [ // { // HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, // HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, -// HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 +// HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2, +// HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3 // }; // // =========================================================================== @@ -4627,6 +5072,7 @@ xdr.enum("HostFunctionType", { hostFunctionTypeInvokeContract: 0, hostFunctionTypeCreateContract: 1, hostFunctionTypeUploadContractWasm: 2, + hostFunctionTypeCreateContractV2: 3, }); // === xdr source ============================================================ @@ -4699,6 +5145,23 @@ xdr.struct("CreateContractArgs", [ ["executable", xdr.lookup("ContractExecutable")], ]); +// === xdr source ============================================================ +// +// struct CreateContractArgsV2 +// { +// ContractIDPreimage contractIDPreimage; +// ContractExecutable executable; +// // Arguments of the contract's constructor. +// SCVal constructorArgs<>; +// }; +// +// =========================================================================== +xdr.struct("CreateContractArgsV2", [ + ["contractIdPreimage", xdr.lookup("ContractIdPreimage")], + ["executable", xdr.lookup("ContractExecutable")], + ["constructorArgs", xdr.varArray(xdr.lookup("ScVal"), 2147483647)], +]); + // === xdr source ============================================================ // // struct InvokeContractArgs { @@ -4724,6 +5187,8 @@ xdr.struct("InvokeContractArgs", [ // CreateContractArgs createContract; // case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: // opaque wasm<>; +// case HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2: +// CreateContractArgsV2 createContractV2; // }; // // =========================================================================== @@ -4734,11 +5199,13 @@ xdr.union("HostFunction", { ["hostFunctionTypeInvokeContract", "invokeContract"], ["hostFunctionTypeCreateContract", "createContract"], ["hostFunctionTypeUploadContractWasm", "wasm"], + ["hostFunctionTypeCreateContractV2", "createContractV2"], ], arms: { invokeContract: xdr.lookup("InvokeContractArgs"), createContract: xdr.lookup("CreateContractArgs"), wasm: xdr.varOpaque(), + createContractV2: xdr.lookup("CreateContractArgsV2"), }, }); @@ -4747,13 +5214,15 @@ xdr.union("HostFunction", { // enum SorobanAuthorizedFunctionType // { // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, -// SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 +// SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1, +// SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2 // }; // // =========================================================================== xdr.enum("SorobanAuthorizedFunctionType", { sorobanAuthorizedFunctionTypeContractFn: 0, sorobanAuthorizedFunctionTypeCreateContractHostFn: 1, + sorobanAuthorizedFunctionTypeCreateContractV2HostFn: 2, }); // === xdr source ============================================================ @@ -4762,8 +5231,18 @@ xdr.enum("SorobanAuthorizedFunctionType", { // { // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: // InvokeContractArgs contractFn; +// // This variant of auth payload for creating new contract instances +// // doesn't allow specifying the constructor arguments, creating contracts +// // with constructors that take arguments is only possible by authorizing +// // `SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN` +// // (protocol 22+). // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: // CreateContractArgs createContractHostFn; +// // This variant of auth payload for creating new contract instances +// // is only accepted in and after protocol 22. It allows authorizing the +// // contract constructor arguments. +// case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN: +// CreateContractArgsV2 createContractV2HostFn; // }; // // =========================================================================== @@ -4773,10 +5252,12 @@ xdr.union("SorobanAuthorizedFunction", { switches: [ ["sorobanAuthorizedFunctionTypeContractFn", "contractFn"], ["sorobanAuthorizedFunctionTypeCreateContractHostFn", "createContractHostFn"], + ["sorobanAuthorizedFunctionTypeCreateContractV2HostFn", "createContractV2HostFn"], ], arms: { contractFn: xdr.lookup("InvokeContractArgs"), createContractHostFn: xdr.lookup("CreateContractArgs"), + createContractV2HostFn: xdr.lookup("CreateContractArgsV2"), }, }); @@ -5409,6 +5890,127 @@ 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 @@ -5432,11 +6034,40 @@ xdr.struct("SorobanResources", [ ["writeBytes", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// ArchivalProof proofs<>; +// } +// +// =========================================================================== +xdr.union("SorobanTransactionDataExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "proofs"], + ], + arms: { + proofs: xdr.varArray(xdr.lookup("ArchivalProof"), 2147483647), + }, +}); + // === xdr source ============================================================ // // struct SorobanTransactionData // { -// ExtensionPoint ext; +// union switch (int v) +// { +// case 0: +// void; +// case 1: +// ArchivalProof proofs<>; +// } ext; // SorobanResources resources; // // Amount of the transaction `fee` allocated to the Soroban resource fees. // // The fraction of `resourceFee` corresponding to `resources` specified @@ -5452,7 +6083,7 @@ xdr.struct("SorobanResources", [ // // =========================================================================== xdr.struct("SorobanTransactionData", [ - ["ext", xdr.lookup("ExtensionPoint")], + ["ext", xdr.lookup("SorobanTransactionDataExt")], ["resources", xdr.lookup("SorobanResources")], ["resourceFee", xdr.lookup("Int64")], ]); @@ -8420,6 +9051,68 @@ xdr.struct("HmacSha256Mac", [ ["mac", xdr.opaque(32)], ]); +// === xdr source ============================================================ +// +// struct ShortHashSeed +// { +// opaque seed[16]; +// }; +// +// =========================================================================== +xdr.struct("ShortHashSeed", [ + ["seed", xdr.opaque(16)], +]); + +// === xdr source ============================================================ +// +// enum BinaryFuseFilterType +// { +// BINARY_FUSE_FILTER_8_BIT = 0, +// BINARY_FUSE_FILTER_16_BIT = 1, +// BINARY_FUSE_FILTER_32_BIT = 2 +// }; +// +// =========================================================================== +xdr.enum("BinaryFuseFilterType", { + binaryFuseFilter8Bit: 0, + binaryFuseFilter16Bit: 1, + binaryFuseFilter32Bit: 2, +}); + +// === xdr source ============================================================ +// +// struct SerializedBinaryFuseFilter +// { +// BinaryFuseFilterType type; +// +// // Seed used to hash input to filter +// ShortHashSeed inputHashSeed; +// +// // Seed used for internal filter hash operations +// ShortHashSeed filterSeed; +// uint32 segmentLength; +// uint32 segementLengthMask; +// uint32 segmentCount; +// uint32 segmentCountLength; +// uint32 fingerprintLength; // Length in terms of element count, not bytes +// +// // Array of uint8_t, uint16_t, or uint32_t depending on filter type +// opaque fingerprints<>; +// }; +// +// =========================================================================== +xdr.struct("SerializedBinaryFuseFilter", [ + ["type", xdr.lookup("BinaryFuseFilterType")], + ["inputHashSeed", xdr.lookup("ShortHashSeed")], + ["filterSeed", xdr.lookup("ShortHashSeed")], + ["segmentLength", xdr.lookup("Uint32")], + ["segementLengthMask", xdr.lookup("Uint32")], + ["segmentCount", xdr.lookup("Uint32")], + ["segmentCountLength", xdr.lookup("Uint32")], + ["fingerprintLength", xdr.lookup("Uint32")], + ["fingerprints", xdr.varOpaque()], +]); + // === xdr source ============================================================ // // enum SCValType @@ -8946,12 +9639,28 @@ xdr.enum("ScEnvMetaKind", { scEnvMetaKindInterfaceVersion: 0, }); +// === xdr source ============================================================ +// +// struct { +// uint32 protocol; +// uint32 preRelease; +// } +// +// =========================================================================== +xdr.struct("ScEnvMetaEntryInterfaceVersion", [ + ["protocol", xdr.lookup("Uint32")], + ["preRelease", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // union SCEnvMetaEntry switch (SCEnvMetaKind kind) // { // case SC_ENV_META_KIND_INTERFACE_VERSION: -// uint64 interfaceVersion; +// struct { +// uint32 protocol; +// uint32 preRelease; +// } interfaceVersion; // }; // // =========================================================================== @@ -8962,7 +9671,7 @@ xdr.union("ScEnvMetaEntry", { ["scEnvMetaKindInterfaceVersion", "interfaceVersion"], ], arms: { - interfaceVersion: xdr.lookup("Uint64"), + interfaceVersion: xdr.lookup("ScEnvMetaEntryInterfaceVersion"), }, }); @@ -9569,6 +10278,24 @@ xdr.struct("ConfigSettingContractComputeV0", [ ["txMemoryLimit", xdr.lookup("Uint32")], ]); +// === xdr source ============================================================ +// +// 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; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingContractParallelComputeV0", [ + ["ledgerMaxParallelThreads", xdr.lookup("Uint32")], +]); + // === xdr source ============================================================ // // struct ConfigSettingContractLedgerCostV0 @@ -9775,7 +10502,58 @@ xdr.struct("ConfigSettingContractBandwidthV0", [ // // point on a 256-bit elliptic curve // Sec1DecodePointUncompressed = 43, // // Cost of verifying an ECDSA Secp256r1 signature -// VerifyEcdsaSecp256r1Sig = 44 +// VerifyEcdsaSecp256r1Sig = 44, +// +// // Cost of encoding a BLS12-381 Fp (base field element) +// Bls12381EncodeFp = 45, +// // Cost of decoding a BLS12-381 Fp (base field element) +// Bls12381DecodeFp = 46, +// // Cost of checking a G1 point lies on the curve +// Bls12381G1CheckPointOnCurve = 47, +// // Cost of checking a G1 point belongs to the correct subgroup +// Bls12381G1CheckPointInSubgroup = 48, +// // Cost of checking a G2 point lies on the curve +// Bls12381G2CheckPointOnCurve = 49, +// // Cost of checking a G2 point belongs to the correct subgroup +// Bls12381G2CheckPointInSubgroup = 50, +// // Cost of converting a BLS12-381 G1 point from projective to affine coordinates +// Bls12381G1ProjectiveToAffine = 51, +// // Cost of converting a BLS12-381 G2 point from projective to affine coordinates +// Bls12381G2ProjectiveToAffine = 52, +// // Cost of performing BLS12-381 G1 point addition +// Bls12381G1Add = 53, +// // Cost of performing BLS12-381 G1 scalar multiplication +// Bls12381G1Mul = 54, +// // Cost of performing BLS12-381 G1 multi-scalar multiplication (MSM) +// Bls12381G1Msm = 55, +// // Cost of mapping a BLS12-381 Fp field element to a G1 point +// Bls12381MapFpToG1 = 56, +// // Cost of hashing to a BLS12-381 G1 point +// Bls12381HashToG1 = 57, +// // Cost of performing BLS12-381 G2 point addition +// Bls12381G2Add = 58, +// // Cost of performing BLS12-381 G2 scalar multiplication +// Bls12381G2Mul = 59, +// // Cost of performing BLS12-381 G2 multi-scalar multiplication (MSM) +// Bls12381G2Msm = 60, +// // Cost of mapping a BLS12-381 Fp2 field element to a G2 point +// Bls12381MapFp2ToG2 = 61, +// // Cost of hashing to a BLS12-381 G2 point +// Bls12381HashToG2 = 62, +// // Cost of performing BLS12-381 pairing operation +// Bls12381Pairing = 63, +// // Cost of converting a BLS12-381 scalar element from U256 +// Bls12381FrFromU256 = 64, +// // Cost of converting a BLS12-381 scalar element to U256 +// Bls12381FrToU256 = 65, +// // Cost of performing BLS12-381 scalar element addition/subtraction +// Bls12381FrAddSub = 66, +// // Cost of performing BLS12-381 scalar element multiplication +// Bls12381FrMul = 67, +// // Cost of performing BLS12-381 scalar element exponentiation +// Bls12381FrPow = 68, +// // Cost of performing BLS12-381 scalar element inversion +// Bls12381FrInv = 69 // }; // // =========================================================================== @@ -9825,6 +10603,31 @@ xdr.enum("ContractCostType", { instantiateWasmDataSegmentBytes: 42, sec1DecodePointUncompressed: 43, verifyEcdsaSecp256r1Sig: 44, + bls12381EncodeFp: 45, + bls12381DecodeFp: 46, + bls12381G1CheckPointOnCurve: 47, + bls12381G1CheckPointInSubgroup: 48, + bls12381G2CheckPointOnCurve: 49, + bls12381G2CheckPointInSubgroup: 50, + bls12381G1ProjectiveToAffine: 51, + bls12381G2ProjectiveToAffine: 52, + bls12381G1Add: 53, + bls12381G1Mul: 54, + bls12381G1Msm: 55, + bls12381MapFpToG1: 56, + bls12381HashToG1: 57, + bls12381G2Add: 58, + bls12381G2Mul: 59, + bls12381G2Msm: 60, + bls12381MapFp2ToG2: 61, + bls12381HashToG2: 62, + bls12381Pairing: 63, + bls12381FrFromU256: 64, + bls12381FrToU256: 65, + bls12381FrAddSub: 66, + bls12381FrMul: 67, + bls12381FrPow: 68, + bls12381FrInv: 69, }); // === xdr source ============================================================ @@ -9931,7 +10734,8 @@ xdr.typedef("ContractCostParams", xdr.varArray(xdr.lookup("ContractCostParamEntr // CONFIG_SETTING_STATE_ARCHIVAL = 10, // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, // CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, -// CONFIG_SETTING_EVICTION_ITERATOR = 13 +// CONFIG_SETTING_EVICTION_ITERATOR = 13, +// CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14 // }; // // =========================================================================== @@ -9950,6 +10754,7 @@ xdr.enum("ConfigSettingId", { configSettingContractExecutionLanes: 11, configSettingBucketlistSizeWindow: 12, configSettingEvictionIterator: 13, + configSettingContractParallelComputeV0: 14, }); // === xdr source ============================================================ @@ -9984,6 +10789,8 @@ xdr.enum("ConfigSettingId", { // uint64 bucketListSizeWindow<>; // case CONFIG_SETTING_EVICTION_ITERATOR: // EvictionIterator evictionIterator; +// case CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0: +// ConfigSettingContractParallelComputeV0 contractParallelCompute; // }; // // =========================================================================== @@ -10005,6 +10812,7 @@ xdr.union("ConfigSettingEntry", { ["configSettingContractExecutionLanes", "contractExecutionLanes"], ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], ["configSettingEvictionIterator", "evictionIterator"], + ["configSettingContractParallelComputeV0", "contractParallelCompute"], ], arms: { contractMaxSizeBytes: xdr.lookup("Uint32"), @@ -10021,6 +10829,7 @@ xdr.union("ConfigSettingEntry", { contractExecutionLanes: xdr.lookup("ConfigSettingContractExecutionLanesV0"), bucketListSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), evictionIterator: xdr.lookup("EvictionIterator"), + contractParallelCompute: xdr.lookup("ConfigSettingContractParallelComputeV0"), }, }); diff --git a/src/operation.js b/src/operation.js index 3a02141e..bb595007 100644 --- a/src/operation.js +++ b/src/operation.js @@ -91,7 +91,12 @@ export const AuthClawbackEnabledFlag = 1 << 3; * * `{@link Operation.setTrustLineFlags}` * * `{@link Operation.liquidityPoolDeposit}` * * `{@link Operation.liquidityPoolWithdraw}` - * * `{@link Operation.invokeHostFunction}` + * * `{@link Operation.invokeHostFunction}`, which has the following additional + * "pseudo-operations" that make building host functions easier: + * - `{@link Operation.createStellarAssetContract}` + * - `{@link Operation.invokeContractFunction}` + * - `{@link Operation.createCustomContract}` + * - `{@link Operation.uploadContractWasm}` * * `{@link Operation.extendFootprintTtlOp}` * * `{@link Operation.restoreFootprint}` * diff --git a/src/operations/invoke_host_function.js b/src/operations/invoke_host_function.js index 8fb264a7..94e61a5a 100644 --- a/src/operations/invoke_host_function.js +++ b/src/operations/invoke_host_function.js @@ -90,7 +90,8 @@ export function invokeContractFunction(opts) { } /** - * Returns an operation that creates a custom WASM contract. + * Returns an operation that creates a custom WASM contract and atomically + * invokes its constructor. * * @function * @alias Operation.createCustomContract @@ -100,6 +101,9 @@ export function invokeContractFunction(opts) { * @param {Uint8Array|Buffer} opts.wasmHash - the SHA-256 hash of the contract * WASM you're uploading (see {@link hash} and * {@link Operation.uploadContractWasm}) + * @param {xdr.ScVal[]} [opts.constructorArgs] - the optional parameters to pass + * to the constructor of this contract (see {@link nativeToScVal} for ways to + * easily create these parameters from native JS values) * @param {Uint8Array|Buffer} [opts.salt] - an optional, 32-byte salt to * distinguish deployment instances of the same wasm from the same user (if * omitted, one will be generated for you) @@ -130,8 +134,8 @@ export function createCustomContract(opts) { return this.invokeHostFunction({ source: opts.source, auth: opts.auth, - func: xdr.HostFunction.hostFunctionTypeCreateContract( - new xdr.CreateContractArgs({ + func: xdr.HostFunction.hostFunctionTypeCreateContractV2( + new xdr.CreateContractArgsV2({ executable: xdr.ContractExecutable.contractExecutableWasm( Buffer.from(opts.wasmHash) ), @@ -141,7 +145,8 @@ export function createCustomContract(opts) { address: opts.address.toScAddress(), salt }) - ) + ), + constructorArgs: opts.constructorArgs ?? [] }) ) }); diff --git a/test/unit/operations/invoke_host_function_test.js b/test/unit/operations/invoke_host_function_test.js index 492db309..5c846d3b 100644 --- a/test/unit/operations/invoke_host_function_test.js +++ b/test/unit/operations/invoke_host_function_test.js @@ -1,4 +1,4 @@ -const { Asset, Contract, Operation, hash } = StellarBase; +const { Asset, Contract, Operation, hash, nativeToScVal } = StellarBase; describe('Operation', function () { describe('.invokeHostFunction()', function () { @@ -15,7 +15,7 @@ describe('Operation', function () { new StellarBase.xdr.InvokeContractArgs({ contractAddress: this.c.address().toScAddress(), functionName: 'hello', - args: [StellarBase.nativeToScVal('world')] + args: [nativeToScVal('world')] }) ) }); @@ -32,7 +32,7 @@ describe('Operation', function () { Operation.invokeContractFunction({ contract: this.contractId, function: 'hello', - args: [StellarBase.nativeToScVal('world')] + args: [nativeToScVal('world')] }).toXDR('hex') ).to.eql(xdr); }); @@ -63,12 +63,12 @@ describe('Operation', function () { expect(decodedOp.type).to.equal('invokeHostFunction'); expect(decodedOp.func.switch().name).to.equal( - 'hostFunctionTypeCreateContract' + 'hostFunctionTypeCreateContractV2' ); expect( // check deep inner field to ensure RT decodedOp.func - .createContract() + .createContractV2() .contractIdPreimage() .fromAddress() .salt() @@ -128,6 +128,53 @@ describe('Operation', function () { expect(decodedOp.func.wasm()).to.eql(wasm); expect(decodedOp.auth).to.be.empty; }); + + it('lets you create contracts with a constructor', function () { + const h = hash(Buffer.from('random stuff')); + const constructorArgs = [ + nativeToScVal('admin name'), + nativeToScVal(1234, { type: 'i128' }) + ]; + + const op = Operation.createCustomContract({ + address: this.c.address(), + constructorArgs, + wasmHash: h, + salt: h + }); + expect(op.body().switch().name).to.equal('invokeHostFunction'); + + // round trip back + + const xdr = op.toXDR('hex'); + const xdrOp = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); + const decodedOp = Operation.fromXDRObject(xdrOp, 'hex'); + + expect(decodedOp.type).to.equal('invokeHostFunction'); + expect(decodedOp.func.switch().name).to.equal( + 'hostFunctionTypeCreateContractV2' + ); + + // check deep inner field to ensure RT + expect( + decodedOp.func + .createContractV2() + .contractIdPreimage() + .fromAddress() + .salt() + ).to.eql(h, "hashes don't match"); + + // check deep inner field to ensure ctor args match + const ctorArgs = decodedOp.func.createContractV2().constructorArgs(); + + expect(ctorArgs).to.have.lengthOf(2); + expect(ctorArgs[1]).to.eql(constructorArgs[1]); + expect(decodedOp.auth).to.be.empty; + // note: we used a string initially but once the operation is + // encoded/decoded it will be a Buffer internally, so we need to + // compare that way instead. + expect(ctorArgs[0].str().toString()).to.eql(constructorArgs[0].str()); + }); }); }); }); diff --git a/types/curr.d.ts b/types/curr.d.ts index 7f2dcdfd..beafaa43 100644 --- a/types/curr.d.ts +++ b/types/curr.d.ts @@ -1,4 +1,5 @@ -// Automatically generated on 2023-10-16T10:48:00-08:00 +// Automatically generated by xdrgen on 2024-09-12T11:09:00-08:00 +// DO NOT EDIT or your changes may be overwritten import { Operation } from './index'; export {}; @@ -487,6 +488,71 @@ export namespace xdr { static envelopeTypeSorobanAuthorization(): EnvelopeType; } + class BucketListType { + readonly name: 'live' | 'hotArchive' | 'coldArchive'; + + readonly value: 0 | 1 | 2; + + static live(): BucketListType; + + static hotArchive(): BucketListType; + + static coldArchive(): BucketListType; + } + + class BucketEntryType { + readonly name: 'metaentry' | 'liveentry' | 'deadentry' | 'initentry'; + + readonly value: -1 | 0 | 1 | 2; + + static metaentry(): BucketEntryType; + + static liveentry(): BucketEntryType; + + static deadentry(): BucketEntryType; + + static initentry(): BucketEntryType; + } + + class HotArchiveBucketEntryType { + readonly name: + | 'hotArchiveMetaentry' + | 'hotArchiveArchived' + | 'hotArchiveLive' + | 'hotArchiveDeleted'; + + readonly value: -1 | 0 | 1 | 2; + + 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 { readonly name: 'stellarValueBasic' | 'stellarValueSigned'; @@ -539,20 +605,6 @@ export namespace xdr { static ledgerUpgradeMaxSorobanTxSetSize(): LedgerUpgradeType; } - class BucketEntryType { - readonly name: 'metaentry' | 'liveentry' | 'deadentry' | 'initentry'; - - readonly value: -1 | 0 | 1 | 2; - - static metaentry(): BucketEntryType; - - static liveentry(): BucketEntryType; - - static deadentry(): BucketEntryType; - - static initentry(): BucketEntryType; - } - class TxSetComponentType { readonly name: 'txsetCompTxsMaybeDiscountedFee'; @@ -638,7 +690,11 @@ export namespace xdr { | 'sendMore' | 'sendMoreExtended' | 'floodAdvert' - | 'floodDemand'; + | 'floodDemand' + | 'timeSlicedSurveyRequest' + | 'timeSlicedSurveyResponse' + | 'timeSlicedSurveyStartCollecting' + | 'timeSlicedSurveyStopCollecting'; readonly value: | 0 @@ -660,7 +716,11 @@ export namespace xdr { | 16 | 20 | 18 - | 19; + | 19 + | 21 + | 22 + | 23 + | 24; static errorMsg(): MessageType; @@ -701,24 +761,39 @@ export namespace xdr { static floodAdvert(): MessageType; static floodDemand(): MessageType; + + static timeSlicedSurveyRequest(): MessageType; + + static timeSlicedSurveyResponse(): MessageType; + + static timeSlicedSurveyStartCollecting(): MessageType; + + static timeSlicedSurveyStopCollecting(): MessageType; } class SurveyMessageCommandType { - readonly name: 'surveyTopology'; + readonly name: 'surveyTopology' | 'timeSlicedSurveyTopology'; - readonly value: 0; + readonly value: 0 | 1; static surveyTopology(): SurveyMessageCommandType; + + static timeSlicedSurveyTopology(): SurveyMessageCommandType; } class SurveyMessageResponseType { - readonly name: 'surveyTopologyResponseV0' | 'surveyTopologyResponseV1'; + readonly name: + | 'surveyTopologyResponseV0' + | 'surveyTopologyResponseV1' + | 'surveyTopologyResponseV2'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2; static surveyTopologyResponseV0(): SurveyMessageResponseType; static surveyTopologyResponseV1(): SurveyMessageResponseType; + + static surveyTopologyResponseV2(): SurveyMessageResponseType; } class OperationType { @@ -849,15 +924,18 @@ export namespace xdr { readonly name: | 'hostFunctionTypeInvokeContract' | 'hostFunctionTypeCreateContract' - | 'hostFunctionTypeUploadContractWasm'; + | 'hostFunctionTypeUploadContractWasm' + | 'hostFunctionTypeCreateContractV2'; - readonly value: 0 | 1 | 2; + readonly value: 0 | 1 | 2 | 3; static hostFunctionTypeInvokeContract(): HostFunctionType; static hostFunctionTypeCreateContract(): HostFunctionType; static hostFunctionTypeUploadContractWasm(): HostFunctionType; + + static hostFunctionTypeCreateContractV2(): HostFunctionType; } class ContractIdPreimageType { @@ -875,13 +953,16 @@ export namespace xdr { class SorobanAuthorizedFunctionType { readonly name: | 'sorobanAuthorizedFunctionTypeContractFn' - | 'sorobanAuthorizedFunctionTypeCreateContractHostFn'; + | 'sorobanAuthorizedFunctionTypeCreateContractHostFn' + | 'sorobanAuthorizedFunctionTypeCreateContractV2HostFn'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2; static sorobanAuthorizedFunctionTypeContractFn(): SorobanAuthorizedFunctionType; static sorobanAuthorizedFunctionTypeCreateContractHostFn(): SorobanAuthorizedFunctionType; + + static sorobanAuthorizedFunctionTypeCreateContractV2HostFn(): SorobanAuthorizedFunctionType; } class SorobanCredentialsType { @@ -929,6 +1010,16 @@ 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' @@ -1853,6 +1944,21 @@ export namespace xdr { static signerKeyTypeEd25519SignedPayload(): SignerKeyType; } + class BinaryFuseFilterType { + readonly name: + | 'binaryFuseFilter8Bit' + | 'binaryFuseFilter16Bit' + | 'binaryFuseFilter32Bit'; + + readonly value: 0 | 1 | 2; + + static binaryFuseFilter8Bit(): BinaryFuseFilterType; + + static binaryFuseFilter16Bit(): BinaryFuseFilterType; + + static binaryFuseFilter32Bit(): BinaryFuseFilterType; + } + class ScValType { readonly name: | 'scvBool' @@ -2238,7 +2344,32 @@ export namespace xdr { | 'instantiateWasmExports' | 'instantiateWasmDataSegmentBytes' | 'sec1DecodePointUncompressed' - | 'verifyEcdsaSecp256r1Sig'; + | 'verifyEcdsaSecp256r1Sig' + | 'bls12381EncodeFp' + | 'bls12381DecodeFp' + | 'bls12381G1CheckPointOnCurve' + | 'bls12381G1CheckPointInSubgroup' + | 'bls12381G2CheckPointOnCurve' + | 'bls12381G2CheckPointInSubgroup' + | 'bls12381G1ProjectiveToAffine' + | 'bls12381G2ProjectiveToAffine' + | 'bls12381G1Add' + | 'bls12381G1Mul' + | 'bls12381G1Msm' + | 'bls12381MapFpToG1' + | 'bls12381HashToG1' + | 'bls12381G2Add' + | 'bls12381G2Mul' + | 'bls12381G2Msm' + | 'bls12381MapFp2ToG2' + | 'bls12381HashToG2' + | 'bls12381Pairing' + | 'bls12381FrFromU256' + | 'bls12381FrToU256' + | 'bls12381FrAddSub' + | 'bls12381FrMul' + | 'bls12381FrPow' + | 'bls12381FrInv'; readonly value: | 0 @@ -2285,7 +2416,32 @@ export namespace xdr { | 41 | 42 | 43 - | 44; + | 44 + | 45 + | 46 + | 47 + | 48 + | 49 + | 50 + | 51 + | 52 + | 53 + | 54 + | 55 + | 56 + | 57 + | 58 + | 59 + | 60 + | 61 + | 62 + | 63 + | 64 + | 65 + | 66 + | 67 + | 68 + | 69; static wasmInsnExec(): ContractCostType; @@ -2376,6 +2532,56 @@ export namespace xdr { static sec1DecodePointUncompressed(): ContractCostType; static verifyEcdsaSecp256r1Sig(): ContractCostType; + + static bls12381EncodeFp(): ContractCostType; + + static bls12381DecodeFp(): ContractCostType; + + static bls12381G1CheckPointOnCurve(): ContractCostType; + + static bls12381G1CheckPointInSubgroup(): ContractCostType; + + static bls12381G2CheckPointOnCurve(): ContractCostType; + + static bls12381G2CheckPointInSubgroup(): ContractCostType; + + static bls12381G1ProjectiveToAffine(): ContractCostType; + + static bls12381G2ProjectiveToAffine(): ContractCostType; + + static bls12381G1Add(): ContractCostType; + + static bls12381G1Mul(): ContractCostType; + + static bls12381G1Msm(): ContractCostType; + + static bls12381MapFpToG1(): ContractCostType; + + static bls12381HashToG1(): ContractCostType; + + static bls12381G2Add(): ContractCostType; + + static bls12381G2Mul(): ContractCostType; + + static bls12381G2Msm(): ContractCostType; + + static bls12381MapFp2ToG2(): ContractCostType; + + static bls12381HashToG2(): ContractCostType; + + static bls12381Pairing(): ContractCostType; + + static bls12381FrFromU256(): ContractCostType; + + static bls12381FrToU256(): ContractCostType; + + static bls12381FrAddSub(): ContractCostType; + + static bls12381FrMul(): ContractCostType; + + static bls12381FrPow(): ContractCostType; + + static bls12381FrInv(): ContractCostType; } class ConfigSettingId { @@ -2450,14 +2656,20 @@ export namespace xdr { const LedgerEntryChanges: XDRArray; + const DiagnosticEvents: XDRArray; + const EncryptedBody: VarOpaque; const PeerStatList: XDRArray; + const TimeSlicedPeerDataList: XDRArray; + const TxAdvertVector: XDRArray; const TxDemandVector: XDRArray; + const ProofLevel: XDRArray; + const Hash: Opaque; const Uint256: Opaque; @@ -4068,6 +4280,160 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class BucketMetadata { + constructor(attributes: { ledgerVersion: number; ext: BucketMetadataExt }); + + ledgerVersion(value?: number): number; + + ext(value?: BucketMetadataExt): BucketMetadataExt; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BucketMetadata; + + static write(value: BucketMetadata, io: Buffer): void; + + static isValid(value: BucketMetadata): boolean; + + static toXDR(value: BucketMetadata): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadata; + + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadata; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + 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 }); @@ -4294,60 +4660,32 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BucketMetadata { - constructor(attributes: { ledgerVersion: number; ext: BucketMetadataExt }); + class TxSetComponentTxsMaybeDiscountedFee { + constructor(attributes: { + baseFee: null | Int64; + txes: TransactionEnvelope[]; + }); - ledgerVersion(value?: number): number; + baseFee(value?: null | Int64): null | Int64; - ext(value?: BucketMetadataExt): BucketMetadataExt; + txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BucketMetadata; - - static write(value: BucketMetadata, io: Buffer): void; + static read(io: Buffer): TxSetComponentTxsMaybeDiscountedFee; - static isValid(value: BucketMetadata): boolean; + static write(value: TxSetComponentTxsMaybeDiscountedFee, io: Buffer): void; - static toXDR(value: BucketMetadata): Buffer; + static isValid(value: TxSetComponentTxsMaybeDiscountedFee): boolean; - static fromXDR(input: Buffer, format?: 'raw'): BucketMetadata; + static toXDR(value: TxSetComponentTxsMaybeDiscountedFee): Buffer; - static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadata; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class TxSetComponentTxsMaybeDiscountedFee { - constructor(attributes: { - baseFee: null | Int64; - txes: TransactionEnvelope[]; - }); - - baseFee(value?: null | Int64): null | Int64; - - txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): TxSetComponentTxsMaybeDiscountedFee; - - static write(value: TxSetComponentTxsMaybeDiscountedFee, io: Buffer): void; - - static isValid(value: TxSetComponentTxsMaybeDiscountedFee): boolean; - - static toXDR(value: TxSetComponentTxsMaybeDiscountedFee): Buffer; - - static fromXDR( - input: Buffer, - format?: 'raw', - ): TxSetComponentTxsMaybeDiscountedFee; + static fromXDR( + input: Buffer, + format?: 'raw', + ): TxSetComponentTxsMaybeDiscountedFee; static fromXDR( input: string, @@ -5449,6 +5787,178 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedSurveyStartCollectingMessage { + constructor(attributes: { + surveyorId: NodeId; + nonce: number; + ledgerNum: number; + }); + + surveyorId(value?: NodeId): NodeId; + + nonce(value?: number): number; + + ledgerNum(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyStartCollectingMessage; + + static write( + value: TimeSlicedSurveyStartCollectingMessage, + io: Buffer, + ): void; + + static isValid(value: TimeSlicedSurveyStartCollectingMessage): boolean; + + static toXDR(value: TimeSlicedSurveyStartCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyStartCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyStartCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SignedTimeSlicedSurveyStartCollectingMessage { + constructor(attributes: { + signature: Buffer; + startCollecting: TimeSlicedSurveyStartCollectingMessage; + }); + + signature(value?: Buffer): Buffer; + + startCollecting( + value?: TimeSlicedSurveyStartCollectingMessage, + ): TimeSlicedSurveyStartCollectingMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyStartCollectingMessage; + + static write( + value: SignedTimeSlicedSurveyStartCollectingMessage, + io: Buffer, + ): void; + + static isValid( + value: SignedTimeSlicedSurveyStartCollectingMessage, + ): boolean; + + static toXDR(value: SignedTimeSlicedSurveyStartCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyStartCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyStartCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TimeSlicedSurveyStopCollectingMessage { + constructor(attributes: { + surveyorId: NodeId; + nonce: number; + ledgerNum: number; + }); + + surveyorId(value?: NodeId): NodeId; + + nonce(value?: number): number; + + ledgerNum(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyStopCollectingMessage; + + static write( + value: TimeSlicedSurveyStopCollectingMessage, + io: Buffer, + ): void; + + static isValid(value: TimeSlicedSurveyStopCollectingMessage): boolean; + + static toXDR(value: TimeSlicedSurveyStopCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyStopCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyStopCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SignedTimeSlicedSurveyStopCollectingMessage { + constructor(attributes: { + signature: Buffer; + stopCollecting: TimeSlicedSurveyStopCollectingMessage; + }); + + signature(value?: Buffer): Buffer; + + stopCollecting( + value?: TimeSlicedSurveyStopCollectingMessage, + ): TimeSlicedSurveyStopCollectingMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyStopCollectingMessage; + + static write( + value: SignedTimeSlicedSurveyStopCollectingMessage, + io: Buffer, + ): void; + + static isValid(value: SignedTimeSlicedSurveyStopCollectingMessage): boolean; + + static toXDR(value: SignedTimeSlicedSurveyStopCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyStopCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyStopCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SurveyRequestMessage { constructor(attributes: { surveyorPeerId: NodeId; @@ -5492,6 +6002,49 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedSurveyRequestMessage { + constructor(attributes: { + request: SurveyRequestMessage; + nonce: number; + inboundPeersIndex: number; + outboundPeersIndex: number; + }); + + request(value?: SurveyRequestMessage): SurveyRequestMessage; + + nonce(value?: number): number; + + inboundPeersIndex(value?: number): number; + + outboundPeersIndex(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyRequestMessage; + + static write(value: TimeSlicedSurveyRequestMessage, io: Buffer): void; + + static isValid(value: TimeSlicedSurveyRequestMessage): boolean; + + static toXDR(value: TimeSlicedSurveyRequestMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyRequestMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyRequestMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SignedSurveyRequestMessage { constructor(attributes: { requestSignature: Buffer; @@ -5526,6 +6079,45 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class SignedTimeSlicedSurveyRequestMessage { + constructor(attributes: { + requestSignature: Buffer; + request: TimeSlicedSurveyRequestMessage; + }); + + requestSignature(value?: Buffer): Buffer; + + request( + value?: TimeSlicedSurveyRequestMessage, + ): TimeSlicedSurveyRequestMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyRequestMessage; + + static write(value: SignedTimeSlicedSurveyRequestMessage, io: Buffer): void; + + static isValid(value: SignedTimeSlicedSurveyRequestMessage): boolean; + + static toXDR(value: SignedTimeSlicedSurveyRequestMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyRequestMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyRequestMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SurveyResponseMessage { constructor(attributes: { surveyorPeerId: NodeId; @@ -5569,6 +6161,40 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedSurveyResponseMessage { + constructor(attributes: { response: SurveyResponseMessage; nonce: number }); + + response(value?: SurveyResponseMessage): SurveyResponseMessage; + + nonce(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyResponseMessage; + + static write(value: TimeSlicedSurveyResponseMessage, io: Buffer): void; + + static isValid(value: TimeSlicedSurveyResponseMessage): boolean; + + static toXDR(value: TimeSlicedSurveyResponseMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyResponseMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyResponseMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SignedSurveyResponseMessage { constructor(attributes: { responseSignature: Buffer; @@ -5600,73 +6226,198 @@ export namespace xdr { static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SignedTimeSlicedSurveyResponseMessage { + constructor(attributes: { + responseSignature: Buffer; + response: TimeSlicedSurveyResponseMessage; + }); + + responseSignature(value?: Buffer): Buffer; + + response( + value?: TimeSlicedSurveyResponseMessage, + ): TimeSlicedSurveyResponseMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyResponseMessage; + + static write( + value: SignedTimeSlicedSurveyResponseMessage, + io: Buffer, + ): void; + + static isValid(value: SignedTimeSlicedSurveyResponseMessage): boolean; + + static toXDR(value: SignedTimeSlicedSurveyResponseMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyResponseMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyResponseMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class PeerStats { + constructor(attributes: { + id: NodeId; + versionStr: string | Buffer; + messagesRead: Uint64; + messagesWritten: Uint64; + bytesRead: Uint64; + bytesWritten: Uint64; + secondsConnected: Uint64; + uniqueFloodBytesRecv: Uint64; + duplicateFloodBytesRecv: Uint64; + uniqueFetchBytesRecv: Uint64; + duplicateFetchBytesRecv: Uint64; + uniqueFloodMessageRecv: Uint64; + duplicateFloodMessageRecv: Uint64; + uniqueFetchMessageRecv: Uint64; + duplicateFetchMessageRecv: Uint64; + }); + + id(value?: NodeId): NodeId; + + versionStr(value?: string | Buffer): string | Buffer; + + messagesRead(value?: Uint64): Uint64; + + messagesWritten(value?: Uint64): Uint64; + + bytesRead(value?: Uint64): Uint64; + + bytesWritten(value?: Uint64): Uint64; + + secondsConnected(value?: Uint64): Uint64; + + uniqueFloodBytesRecv(value?: Uint64): Uint64; + + duplicateFloodBytesRecv(value?: Uint64): Uint64; + + uniqueFetchBytesRecv(value?: Uint64): Uint64; + + duplicateFetchBytesRecv(value?: Uint64): Uint64; + + uniqueFloodMessageRecv(value?: Uint64): Uint64; + + duplicateFloodMessageRecv(value?: Uint64): Uint64; + + uniqueFetchMessageRecv(value?: Uint64): Uint64; + + duplicateFetchMessageRecv(value?: Uint64): Uint64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): PeerStats; + + static write(value: PeerStats, io: Buffer): void; + + static isValid(value: PeerStats): boolean; + + static toXDR(value: PeerStats): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): PeerStats; + + static fromXDR(input: string, format: 'hex' | 'base64'): PeerStats; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TimeSlicedNodeData { + constructor(attributes: { + addedAuthenticatedPeers: number; + droppedAuthenticatedPeers: number; + totalInboundPeerCount: number; + totalOutboundPeerCount: number; + p75ScpFirstToSelfLatencyMs: number; + p75ScpSelfToOtherLatencyMs: number; + lostSyncCount: number; + isValidator: boolean; + maxInboundPeerCount: number; + maxOutboundPeerCount: number; + }); + + addedAuthenticatedPeers(value?: number): number; + + droppedAuthenticatedPeers(value?: number): number; + + totalInboundPeerCount(value?: number): number; + + totalOutboundPeerCount(value?: number): number; + + p75ScpFirstToSelfLatencyMs(value?: number): number; + + p75ScpSelfToOtherLatencyMs(value?: number): number; + + lostSyncCount(value?: number): number; - class PeerStats { - constructor(attributes: { - id: NodeId; - versionStr: string | Buffer; - messagesRead: Uint64; - messagesWritten: Uint64; - bytesRead: Uint64; - bytesWritten: Uint64; - secondsConnected: Uint64; - uniqueFloodBytesRecv: Uint64; - duplicateFloodBytesRecv: Uint64; - uniqueFetchBytesRecv: Uint64; - duplicateFetchBytesRecv: Uint64; - uniqueFloodMessageRecv: Uint64; - duplicateFloodMessageRecv: Uint64; - uniqueFetchMessageRecv: Uint64; - duplicateFetchMessageRecv: Uint64; - }); + isValidator(value?: boolean): boolean; - id(value?: NodeId): NodeId; + maxInboundPeerCount(value?: number): number; - versionStr(value?: string | Buffer): string | Buffer; + maxOutboundPeerCount(value?: number): number; - messagesRead(value?: Uint64): Uint64; + toXDR(format?: 'raw'): Buffer; - messagesWritten(value?: Uint64): Uint64; + toXDR(format: 'hex' | 'base64'): string; - bytesRead(value?: Uint64): Uint64; + static read(io: Buffer): TimeSlicedNodeData; - bytesWritten(value?: Uint64): Uint64; + static write(value: TimeSlicedNodeData, io: Buffer): void; - secondsConnected(value?: Uint64): Uint64; + static isValid(value: TimeSlicedNodeData): boolean; - uniqueFloodBytesRecv(value?: Uint64): Uint64; + static toXDR(value: TimeSlicedNodeData): Buffer; - duplicateFloodBytesRecv(value?: Uint64): Uint64; + static fromXDR(input: Buffer, format?: 'raw'): TimeSlicedNodeData; - uniqueFetchBytesRecv(value?: Uint64): Uint64; + static fromXDR(input: string, format: 'hex' | 'base64'): TimeSlicedNodeData; - duplicateFetchBytesRecv(value?: Uint64): Uint64; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - uniqueFloodMessageRecv(value?: Uint64): Uint64; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - duplicateFloodMessageRecv(value?: Uint64): Uint64; + class TimeSlicedPeerData { + constructor(attributes: { peerStats: PeerStats; averageLatencyMs: number }); - uniqueFetchMessageRecv(value?: Uint64): Uint64; + peerStats(value?: PeerStats): PeerStats; - duplicateFetchMessageRecv(value?: Uint64): Uint64; + averageLatencyMs(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): PeerStats; + static read(io: Buffer): TimeSlicedPeerData; - static write(value: PeerStats, io: Buffer): void; + static write(value: TimeSlicedPeerData, io: Buffer): void; - static isValid(value: PeerStats): boolean; + static isValid(value: TimeSlicedPeerData): boolean; - static toXDR(value: PeerStats): Buffer; + static toXDR(value: TimeSlicedPeerData): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): PeerStats; + static fromXDR(input: Buffer, format?: 'raw'): TimeSlicedPeerData; - static fromXDR(input: string, format: 'hex' | 'base64'): PeerStats; + static fromXDR(input: string, format: 'hex' | 'base64'): TimeSlicedPeerData; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -5759,6 +6510,43 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TopologyResponseBodyV2 { + constructor(attributes: { + inboundPeers: TimeSlicedPeerData[]; + outboundPeers: TimeSlicedPeerData[]; + nodeData: TimeSlicedNodeData; + }); + + inboundPeers(value?: TimeSlicedPeerData[]): TimeSlicedPeerData[]; + + outboundPeers(value?: TimeSlicedPeerData[]): TimeSlicedPeerData[]; + + nodeData(value?: TimeSlicedNodeData): TimeSlicedNodeData; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TopologyResponseBodyV2; + + static write(value: TopologyResponseBodyV2, io: Buffer): void; + + static isValid(value: TopologyResponseBodyV2): boolean; + + static toXDR(value: TopologyResponseBodyV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV2; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TopologyResponseBodyV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class FloodAdvert { constructor(attributes: { txHashes: Hash[] }); @@ -6732,6 +7520,43 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class CreateContractArgsV2 { + constructor(attributes: { + contractIdPreimage: ContractIdPreimage; + executable: ContractExecutable; + constructorArgs: ScVal[]; + }); + + contractIdPreimage(value?: ContractIdPreimage): ContractIdPreimage; + + executable(value?: ContractExecutable): ContractExecutable; + + constructorArgs(value?: ScVal[]): ScVal[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): CreateContractArgsV2; + + static write(value: CreateContractArgsV2, io: Buffer): void; + + static isValid(value: CreateContractArgsV2): boolean; + + static toXDR(value: CreateContractArgsV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): CreateContractArgsV2; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): CreateContractArgsV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class InvokeContractArgs { constructor(attributes: { contractAddress: ScAddress; @@ -7255,6 +8080,135 @@ 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 { + constructor(attributes: { + keysToProve: LedgerKey[]; + lowBoundEntries: ColdArchiveBucketEntry[]; + highBoundEntries: ColdArchiveBucketEntry[]; + proofLevels: ArchivalProofNode[][]; + }); + + 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; + } + + class ArchivalProof { + constructor(attributes: { epoch: number; body: ArchivalProofBody }); + + epoch(value?: number): number; + + body(value?: ArchivalProofBody): ArchivalProofBody; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ArchivalProof; + + static write(value: ArchivalProof, io: Buffer): void; + + static isValid(value: ArchivalProof): boolean; + + static toXDR(value: ArchivalProof): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ArchivalProof; + + static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProof; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SorobanResources { constructor(attributes: { footprint: LedgerFootprint; @@ -8135,6 +9089,87 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ShortHashSeed { + constructor(attributes: { seed: Buffer }); + + seed(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ShortHashSeed; + + static write(value: ShortHashSeed, io: Buffer): void; + + static isValid(value: ShortHashSeed): boolean; + + static toXDR(value: ShortHashSeed): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ShortHashSeed; + + static fromXDR(input: string, format: 'hex' | 'base64'): ShortHashSeed; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SerializedBinaryFuseFilter { + constructor(attributes: { + type: BinaryFuseFilterType; + inputHashSeed: ShortHashSeed; + filterSeed: ShortHashSeed; + segmentLength: number; + segementLengthMask: number; + segmentCount: number; + segmentCountLength: number; + fingerprintLength: number; + fingerprints: Buffer; + }); + + type(value?: BinaryFuseFilterType): BinaryFuseFilterType; + + inputHashSeed(value?: ShortHashSeed): ShortHashSeed; + + filterSeed(value?: ShortHashSeed): ShortHashSeed; + + segmentLength(value?: number): number; + + segementLengthMask(value?: number): number; + + segmentCount(value?: number): number; + + segmentCountLength(value?: number): number; + + fingerprintLength(value?: number): number; + + fingerprints(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SerializedBinaryFuseFilter; + + static write(value: SerializedBinaryFuseFilter, io: Buffer): void; + + static isValid(value: SerializedBinaryFuseFilter): boolean; + + static toXDR(value: SerializedBinaryFuseFilter): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SerializedBinaryFuseFilter; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SerializedBinaryFuseFilter; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class UInt128Parts { constructor(attributes: { hi: Uint64; lo: Uint64 }); @@ -8322,28 +9357,62 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScMapEntry { - constructor(attributes: { key: ScVal; val: ScVal }); + class ScMapEntry { + constructor(attributes: { key: ScVal; val: ScVal }); + + key(value?: ScVal): ScVal; + + val(value?: ScVal): ScVal; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScMapEntry; + + static write(value: ScMapEntry, io: Buffer): void; + + static isValid(value: ScMapEntry): boolean; + + static toXDR(value: ScMapEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScMapEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScMapEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScEnvMetaEntryInterfaceVersion { + constructor(attributes: { protocol: number; preRelease: number }); - key(value?: ScVal): ScVal; + protocol(value?: number): number; - val(value?: ScVal): ScVal; + preRelease(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScMapEntry; + static read(io: Buffer): ScEnvMetaEntryInterfaceVersion; - static write(value: ScMapEntry, io: Buffer): void; + static write(value: ScEnvMetaEntryInterfaceVersion, io: Buffer): void; - static isValid(value: ScMapEntry): boolean; + static isValid(value: ScEnvMetaEntryInterfaceVersion): boolean; - static toXDR(value: ScMapEntry): Buffer; + static toXDR(value: ScEnvMetaEntryInterfaceVersion): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ScMapEntry; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ScEnvMetaEntryInterfaceVersion; - static fromXDR(input: string, format: 'hex' | 'base64'): ScMapEntry; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScEnvMetaEntryInterfaceVersion; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -10261,6 +11330,181 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class BucketMetadataExt { + switch(): number; + + bucketListType(value?: BucketListType): BucketListType; + + static 0(): BucketMetadataExt; + + static 1(value: BucketListType): BucketMetadataExt; + + value(): BucketListType | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BucketMetadataExt; + + static write(value: BucketMetadataExt, io: Buffer): void; + + static isValid(value: BucketMetadataExt): boolean; + + static toXDR(value: BucketMetadataExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadataExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadataExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class BucketEntry { + switch(): BucketEntryType; + + liveEntry(value?: LedgerEntry): LedgerEntry; + + deadEntry(value?: LedgerKey): LedgerKey; + + metaEntry(value?: BucketMetadata): BucketMetadata; + + static liveentry(value: LedgerEntry): BucketEntry; + + static initentry(value: LedgerEntry): BucketEntry; + + static deadentry(value: LedgerKey): BucketEntry; + + static metaentry(value: BucketMetadata): BucketEntry; + + value(): LedgerEntry | LedgerKey | BucketMetadata; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BucketEntry; + + static write(value: BucketEntry, io: Buffer): void; + + static isValid(value: BucketEntry): boolean; + + static toXDR(value: BucketEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): BucketEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): BucketEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class HotArchiveBucketEntry { + switch(): HotArchiveBucketEntryType; + + archivedEntry(value?: LedgerEntry): LedgerEntry; + + key(value?: LedgerKey): LedgerKey; + + metaEntry(value?: BucketMetadata): BucketMetadata; + + static hotArchiveArchived(value: LedgerEntry): HotArchiveBucketEntry; + + static hotArchiveLive(value: LedgerKey): HotArchiveBucketEntry; + + static hotArchiveDeleted(value: LedgerKey): HotArchiveBucketEntry; + + static hotArchiveMetaentry(value: BucketMetadata): HotArchiveBucketEntry; + + value(): LedgerEntry | LedgerKey | BucketMetadata; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): HotArchiveBucketEntry; + + static write(value: HotArchiveBucketEntry, io: Buffer): void; + + static isValid(value: HotArchiveBucketEntry): boolean; + + static toXDR(value: HotArchiveBucketEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): HotArchiveBucketEntry; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): HotArchiveBucketEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + 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; @@ -10421,74 +11665,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BucketMetadataExt { - switch(): number; - - static 0(): BucketMetadataExt; - - value(): void; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): BucketMetadataExt; - - static write(value: BucketMetadataExt, io: Buffer): void; - - static isValid(value: BucketMetadataExt): boolean; - - static toXDR(value: BucketMetadataExt): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): BucketMetadataExt; - - static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadataExt; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class BucketEntry { - switch(): BucketEntryType; - - liveEntry(value?: LedgerEntry): LedgerEntry; - - deadEntry(value?: LedgerKey): LedgerKey; - - metaEntry(value?: BucketMetadata): BucketMetadata; - - static liveentry(value: LedgerEntry): BucketEntry; - - static initentry(value: LedgerEntry): BucketEntry; - - static deadentry(value: LedgerKey): BucketEntry; - - static metaentry(value: BucketMetadata): BucketEntry; - - value(): LedgerEntry | LedgerKey | BucketMetadata; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): BucketEntry; - - static write(value: BucketEntry, io: Buffer): void; - - static isValid(value: BucketEntry): boolean; - - static toXDR(value: BucketEntry): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): BucketEntry; - - static fromXDR(input: string, format: 'hex' | 'base64'): BucketEntry; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class TxSetComponent { switch(): TxSetComponentType; @@ -10982,6 +12158,10 @@ export namespace xdr { value?: TopologyResponseBodyV1, ): TopologyResponseBodyV1; + topologyResponseBodyV2( + value?: TopologyResponseBodyV2, + ): TopologyResponseBodyV2; + static surveyTopologyResponseV0( value: TopologyResponseBodyV0, ): SurveyResponseBody; @@ -10990,7 +12170,14 @@ export namespace xdr { value: TopologyResponseBodyV1, ): SurveyResponseBody; - value(): TopologyResponseBodyV0 | TopologyResponseBodyV1; + static surveyTopologyResponseV2( + value: TopologyResponseBodyV2, + ): SurveyResponseBody; + + value(): + | TopologyResponseBodyV0 + | TopologyResponseBodyV1 + | TopologyResponseBodyV2; toXDR(format?: 'raw'): Buffer; @@ -11044,6 +12231,22 @@ export namespace xdr { value?: SignedSurveyResponseMessage, ): SignedSurveyResponseMessage; + signedTimeSlicedSurveyRequestMessage( + value?: SignedTimeSlicedSurveyRequestMessage, + ): SignedTimeSlicedSurveyRequestMessage; + + signedTimeSlicedSurveyResponseMessage( + value?: SignedTimeSlicedSurveyResponseMessage, + ): SignedTimeSlicedSurveyResponseMessage; + + signedTimeSlicedSurveyStartCollectingMessage( + value?: SignedTimeSlicedSurveyStartCollectingMessage, + ): SignedTimeSlicedSurveyStartCollectingMessage; + + signedTimeSlicedSurveyStopCollectingMessage( + value?: SignedTimeSlicedSurveyStopCollectingMessage, + ): SignedTimeSlicedSurveyStopCollectingMessage; + qSetHash(value?: Buffer): Buffer; qSet(value?: ScpQuorumSet): ScpQuorumSet; @@ -11084,6 +12287,22 @@ export namespace xdr { static surveyResponse(value: SignedSurveyResponseMessage): StellarMessage; + static timeSlicedSurveyRequest( + value: SignedTimeSlicedSurveyRequestMessage, + ): StellarMessage; + + static timeSlicedSurveyResponse( + value: SignedTimeSlicedSurveyResponseMessage, + ): StellarMessage; + + static timeSlicedSurveyStartCollecting( + value: SignedTimeSlicedSurveyStartCollectingMessage, + ): StellarMessage; + + static timeSlicedSurveyStopCollecting( + value: SignedTimeSlicedSurveyStopCollectingMessage, + ): StellarMessage; + static getScpQuorumset(value: Buffer): StellarMessage; static scpQuorumset(value: ScpQuorumSet): StellarMessage; @@ -11112,6 +12331,10 @@ export namespace xdr { | TransactionEnvelope | SignedSurveyRequestMessage | SignedSurveyResponseMessage + | SignedTimeSlicedSurveyRequestMessage + | SignedTimeSlicedSurveyResponseMessage + | SignedTimeSlicedSurveyStartCollectingMessage + | SignedTimeSlicedSurveyStopCollectingMessage | Buffer | ScpQuorumSet | ScpEnvelope @@ -11373,6 +12596,8 @@ export namespace xdr { wasm(value?: Buffer): Buffer; + createContractV2(value?: CreateContractArgsV2): CreateContractArgsV2; + static hostFunctionTypeInvokeContract( value: InvokeContractArgs, ): HostFunction; @@ -11383,7 +12608,15 @@ export namespace xdr { static hostFunctionTypeUploadContractWasm(value: Buffer): HostFunction; - value(): InvokeContractArgs | CreateContractArgs | Buffer; + static hostFunctionTypeCreateContractV2( + value: CreateContractArgsV2, + ): HostFunction; + + value(): + | InvokeContractArgs + | CreateContractArgs + | Buffer + | CreateContractArgsV2; toXDR(format?: 'raw'): Buffer; @@ -11413,6 +12646,8 @@ export namespace xdr { createContractHostFn(value?: CreateContractArgs): CreateContractArgs; + createContractV2HostFn(value?: CreateContractArgsV2): CreateContractArgsV2; + static sorobanAuthorizedFunctionTypeContractFn( value: InvokeContractArgs, ): SorobanAuthorizedFunction; @@ -11421,7 +12656,11 @@ export namespace xdr { value: CreateContractArgs, ): SorobanAuthorizedFunction; - value(): InvokeContractArgs | CreateContractArgs; + static sorobanAuthorizedFunctionTypeCreateContractV2HostFn( + value: CreateContractArgsV2, + ): SorobanAuthorizedFunction; + + value(): InvokeContractArgs | CreateContractArgs | CreateContractArgsV2; toXDR(format?: 'raw'): Buffer; @@ -11799,6 +13038,40 @@ 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 TransactionV0Ext { switch(): number; @@ -14050,11 +15323,15 @@ export namespace xdr { class ScEnvMetaEntry { switch(): ScEnvMetaKind; - interfaceVersion(value?: Uint64): Uint64; + interfaceVersion( + value?: ScEnvMetaEntryInterfaceVersion, + ): ScEnvMetaEntryInterfaceVersion; - static scEnvMetaKindInterfaceVersion(value: Uint64): ScEnvMetaEntry; + static scEnvMetaKindInterfaceVersion( + value: ScEnvMetaEntryInterfaceVersion, + ): ScEnvMetaEntry; - value(): Uint64; + value(): ScEnvMetaEntryInterfaceVersion; toXDR(format?: 'raw'): Buffer; diff --git a/types/index.d.ts b/types/index.d.ts index 2b188831..99ca9f5e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -561,6 +561,7 @@ export namespace OperationOptions { interface CreateCustomContract extends BaseInvocationOptions { address: Address; wasmHash: Buffer | Uint8Array; + constructorArgs?: xdr.ScVal[]; salt?: Buffer | Uint8Array; } interface CreateStellarAssetContract extends BaseOptions { diff --git a/types/next.d.ts b/types/next.d.ts index 7f2dcdfd..ced3636f 100644 --- a/types/next.d.ts +++ b/types/next.d.ts @@ -1,4 +1,5 @@ -// Automatically generated on 2023-10-16T10:48:00-08:00 +// Automatically generated by xdrgen on 2024-09-12T11:09:00-08:00 +// DO NOT EDIT or your changes may be overwritten import { Operation } from './index'; export {}; @@ -88,7 +89,7 @@ export namespace xdr { unsigned: boolean; constructor( - values: string | bigint | number | Array, + values: string | bigint | number | (string | bigint | number)[], ); toXDR(format?: 'raw'): Buffer; @@ -132,7 +133,7 @@ export namespace xdr { unsigned: boolean; constructor( - values: string | bigint | number | Array, + values: string | bigint | number | (string | bigint | number)[], ); toXDR(format?: 'raw'): Buffer; @@ -487,6 +488,71 @@ export namespace xdr { static envelopeTypeSorobanAuthorization(): EnvelopeType; } + class BucketListType { + readonly name: 'live' | 'hotArchive' | 'coldArchive'; + + readonly value: 0 | 1 | 2; + + static live(): BucketListType; + + static hotArchive(): BucketListType; + + static coldArchive(): BucketListType; + } + + class BucketEntryType { + readonly name: 'metaentry' | 'liveentry' | 'deadentry' | 'initentry'; + + readonly value: -1 | 0 | 1 | 2; + + static metaentry(): BucketEntryType; + + static liveentry(): BucketEntryType; + + static deadentry(): BucketEntryType; + + static initentry(): BucketEntryType; + } + + class HotArchiveBucketEntryType { + readonly name: + | 'hotArchiveMetaentry' + | 'hotArchiveArchived' + | 'hotArchiveLive' + | 'hotArchiveDeleted'; + + readonly value: -1 | 0 | 1 | 2; + + 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 { readonly name: 'stellarValueBasic' | 'stellarValueSigned'; @@ -539,20 +605,6 @@ export namespace xdr { static ledgerUpgradeMaxSorobanTxSetSize(): LedgerUpgradeType; } - class BucketEntryType { - readonly name: 'metaentry' | 'liveentry' | 'deadentry' | 'initentry'; - - readonly value: -1 | 0 | 1 | 2; - - static metaentry(): BucketEntryType; - - static liveentry(): BucketEntryType; - - static deadentry(): BucketEntryType; - - static initentry(): BucketEntryType; - } - class TxSetComponentType { readonly name: 'txsetCompTxsMaybeDiscountedFee'; @@ -638,7 +690,11 @@ export namespace xdr { | 'sendMore' | 'sendMoreExtended' | 'floodAdvert' - | 'floodDemand'; + | 'floodDemand' + | 'timeSlicedSurveyRequest' + | 'timeSlicedSurveyResponse' + | 'timeSlicedSurveyStartCollecting' + | 'timeSlicedSurveyStopCollecting'; readonly value: | 0 @@ -660,7 +716,11 @@ export namespace xdr { | 16 | 20 | 18 - | 19; + | 19 + | 21 + | 22 + | 23 + | 24; static errorMsg(): MessageType; @@ -701,24 +761,39 @@ export namespace xdr { static floodAdvert(): MessageType; static floodDemand(): MessageType; + + static timeSlicedSurveyRequest(): MessageType; + + static timeSlicedSurveyResponse(): MessageType; + + static timeSlicedSurveyStartCollecting(): MessageType; + + static timeSlicedSurveyStopCollecting(): MessageType; } class SurveyMessageCommandType { - readonly name: 'surveyTopology'; + readonly name: 'surveyTopology' | 'timeSlicedSurveyTopology'; - readonly value: 0; + readonly value: 0 | 1; static surveyTopology(): SurveyMessageCommandType; + + static timeSlicedSurveyTopology(): SurveyMessageCommandType; } class SurveyMessageResponseType { - readonly name: 'surveyTopologyResponseV0' | 'surveyTopologyResponseV1'; + readonly name: + | 'surveyTopologyResponseV0' + | 'surveyTopologyResponseV1' + | 'surveyTopologyResponseV2'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2; static surveyTopologyResponseV0(): SurveyMessageResponseType; static surveyTopologyResponseV1(): SurveyMessageResponseType; + + static surveyTopologyResponseV2(): SurveyMessageResponseType; } class OperationType { @@ -849,15 +924,18 @@ export namespace xdr { readonly name: | 'hostFunctionTypeInvokeContract' | 'hostFunctionTypeCreateContract' - | 'hostFunctionTypeUploadContractWasm'; + | 'hostFunctionTypeUploadContractWasm' + | 'hostFunctionTypeCreateContractV2'; - readonly value: 0 | 1 | 2; + readonly value: 0 | 1 | 2 | 3; static hostFunctionTypeInvokeContract(): HostFunctionType; static hostFunctionTypeCreateContract(): HostFunctionType; static hostFunctionTypeUploadContractWasm(): HostFunctionType; + + static hostFunctionTypeCreateContractV2(): HostFunctionType; } class ContractIdPreimageType { @@ -875,13 +953,16 @@ export namespace xdr { class SorobanAuthorizedFunctionType { readonly name: | 'sorobanAuthorizedFunctionTypeContractFn' - | 'sorobanAuthorizedFunctionTypeCreateContractHostFn'; + | 'sorobanAuthorizedFunctionTypeCreateContractHostFn' + | 'sorobanAuthorizedFunctionTypeCreateContractV2HostFn'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2; static sorobanAuthorizedFunctionTypeContractFn(): SorobanAuthorizedFunctionType; static sorobanAuthorizedFunctionTypeCreateContractHostFn(): SorobanAuthorizedFunctionType; + + static sorobanAuthorizedFunctionTypeCreateContractV2HostFn(): SorobanAuthorizedFunctionType; } class SorobanCredentialsType { @@ -929,6 +1010,16 @@ 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' @@ -1853,6 +1944,21 @@ export namespace xdr { static signerKeyTypeEd25519SignedPayload(): SignerKeyType; } + class BinaryFuseFilterType { + readonly name: + | 'binaryFuseFilter8Bit' + | 'binaryFuseFilter16Bit' + | 'binaryFuseFilter32Bit'; + + readonly value: 0 | 1 | 2; + + static binaryFuseFilter8Bit(): BinaryFuseFilterType; + + static binaryFuseFilter16Bit(): BinaryFuseFilterType; + + static binaryFuseFilter32Bit(): BinaryFuseFilterType; + } + class ScValType { readonly name: | 'scvBool' @@ -2238,7 +2344,32 @@ export namespace xdr { | 'instantiateWasmExports' | 'instantiateWasmDataSegmentBytes' | 'sec1DecodePointUncompressed' - | 'verifyEcdsaSecp256r1Sig'; + | 'verifyEcdsaSecp256r1Sig' + | 'bls12381EncodeFp' + | 'bls12381DecodeFp' + | 'bls12381G1CheckPointOnCurve' + | 'bls12381G1CheckPointInSubgroup' + | 'bls12381G2CheckPointOnCurve' + | 'bls12381G2CheckPointInSubgroup' + | 'bls12381G1ProjectiveToAffine' + | 'bls12381G2ProjectiveToAffine' + | 'bls12381G1Add' + | 'bls12381G1Mul' + | 'bls12381G1Msm' + | 'bls12381MapFpToG1' + | 'bls12381HashToG1' + | 'bls12381G2Add' + | 'bls12381G2Mul' + | 'bls12381G2Msm' + | 'bls12381MapFp2ToG2' + | 'bls12381HashToG2' + | 'bls12381Pairing' + | 'bls12381FrFromU256' + | 'bls12381FrToU256' + | 'bls12381FrAddSub' + | 'bls12381FrMul' + | 'bls12381FrPow' + | 'bls12381FrInv'; readonly value: | 0 @@ -2285,7 +2416,32 @@ export namespace xdr { | 41 | 42 | 43 - | 44; + | 44 + | 45 + | 46 + | 47 + | 48 + | 49 + | 50 + | 51 + | 52 + | 53 + | 54 + | 55 + | 56 + | 57 + | 58 + | 59 + | 60 + | 61 + | 62 + | 63 + | 64 + | 65 + | 66 + | 67 + | 68 + | 69; static wasmInsnExec(): ContractCostType; @@ -2376,6 +2532,56 @@ export namespace xdr { static sec1DecodePointUncompressed(): ContractCostType; static verifyEcdsaSecp256r1Sig(): ContractCostType; + + static bls12381EncodeFp(): ContractCostType; + + static bls12381DecodeFp(): ContractCostType; + + static bls12381G1CheckPointOnCurve(): ContractCostType; + + static bls12381G1CheckPointInSubgroup(): ContractCostType; + + static bls12381G2CheckPointOnCurve(): ContractCostType; + + static bls12381G2CheckPointInSubgroup(): ContractCostType; + + static bls12381G1ProjectiveToAffine(): ContractCostType; + + static bls12381G2ProjectiveToAffine(): ContractCostType; + + static bls12381G1Add(): ContractCostType; + + static bls12381G1Mul(): ContractCostType; + + static bls12381G1Msm(): ContractCostType; + + static bls12381MapFpToG1(): ContractCostType; + + static bls12381HashToG1(): ContractCostType; + + static bls12381G2Add(): ContractCostType; + + static bls12381G2Mul(): ContractCostType; + + static bls12381G2Msm(): ContractCostType; + + static bls12381MapFp2ToG2(): ContractCostType; + + static bls12381HashToG2(): ContractCostType; + + static bls12381Pairing(): ContractCostType; + + static bls12381FrFromU256(): ContractCostType; + + static bls12381FrToU256(): ContractCostType; + + static bls12381FrAddSub(): ContractCostType; + + static bls12381FrMul(): ContractCostType; + + static bls12381FrPow(): ContractCostType; + + static bls12381FrInv(): ContractCostType; } class ConfigSettingId { @@ -2393,9 +2599,25 @@ export namespace xdr { | 'configSettingStateArchival' | 'configSettingContractExecutionLanes' | 'configSettingBucketlistSizeWindow' - | 'configSettingEvictionIterator'; + | 'configSettingEvictionIterator' + | 'configSettingContractParallelComputeV0'; - 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; static configSettingContractMaxSizeBytes(): ConfigSettingId; @@ -2424,6 +2646,8 @@ export namespace xdr { static configSettingBucketlistSizeWindow(): ConfigSettingId; static configSettingEvictionIterator(): ConfigSettingId; + + static configSettingContractParallelComputeV0(): ConfigSettingId; } const Value: VarOpaque; @@ -2448,16 +2672,24 @@ export namespace xdr { const UpgradeType: VarOpaque; + const TxExecutionThread: XDRArray; + + const ParallelTxExecutionStage: XDRArray; + const LedgerEntryChanges: XDRArray; const EncryptedBody: VarOpaque; const PeerStatList: XDRArray; + const TimeSlicedPeerDataList: XDRArray; + const TxAdvertVector: XDRArray; const TxDemandVector: XDRArray; + const ProofLevel: XDRArray; + const Hash: Opaque; const Uint256: Opaque; @@ -4068,6 +4300,160 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class BucketMetadata { + constructor(attributes: { ledgerVersion: number; ext: BucketMetadataExt }); + + ledgerVersion(value?: number): number; + + ext(value?: BucketMetadataExt): BucketMetadataExt; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BucketMetadata; + + static write(value: BucketMetadata, io: Buffer): void; + + static isValid(value: BucketMetadata): boolean; + + static toXDR(value: BucketMetadata): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadata; + + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadata; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + 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 }); @@ -4294,28 +4680,36 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BucketMetadata { - constructor(attributes: { ledgerVersion: number; ext: BucketMetadataExt }); + class ParallelTxsComponent { + constructor(attributes: { + baseFee: null | Int64; + executionStages: TransactionEnvelope[][][]; + }); - ledgerVersion(value?: number): number; + baseFee(value?: null | Int64): null | Int64; - ext(value?: BucketMetadataExt): BucketMetadataExt; + executionStages( + value?: TransactionEnvelope[][][], + ): TransactionEnvelope[][][]; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BucketMetadata; + static read(io: Buffer): ParallelTxsComponent; - static write(value: BucketMetadata, io: Buffer): void; + static write(value: ParallelTxsComponent, io: Buffer): void; - static isValid(value: BucketMetadata): boolean; + static isValid(value: ParallelTxsComponent): boolean; - static toXDR(value: BucketMetadata): Buffer; + static toXDR(value: ParallelTxsComponent): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): BucketMetadata; + static fromXDR(input: Buffer, format?: 'raw'): ParallelTxsComponent; - static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadata; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ParallelTxsComponent; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -5449,6 +5843,178 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedSurveyStartCollectingMessage { + constructor(attributes: { + surveyorId: NodeId; + nonce: number; + ledgerNum: number; + }); + + surveyorId(value?: NodeId): NodeId; + + nonce(value?: number): number; + + ledgerNum(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyStartCollectingMessage; + + static write( + value: TimeSlicedSurveyStartCollectingMessage, + io: Buffer, + ): void; + + static isValid(value: TimeSlicedSurveyStartCollectingMessage): boolean; + + static toXDR(value: TimeSlicedSurveyStartCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyStartCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyStartCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SignedTimeSlicedSurveyStartCollectingMessage { + constructor(attributes: { + signature: Buffer; + startCollecting: TimeSlicedSurveyStartCollectingMessage; + }); + + signature(value?: Buffer): Buffer; + + startCollecting( + value?: TimeSlicedSurveyStartCollectingMessage, + ): TimeSlicedSurveyStartCollectingMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyStartCollectingMessage; + + static write( + value: SignedTimeSlicedSurveyStartCollectingMessage, + io: Buffer, + ): void; + + static isValid( + value: SignedTimeSlicedSurveyStartCollectingMessage, + ): boolean; + + static toXDR(value: SignedTimeSlicedSurveyStartCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyStartCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyStartCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TimeSlicedSurveyStopCollectingMessage { + constructor(attributes: { + surveyorId: NodeId; + nonce: number; + ledgerNum: number; + }); + + surveyorId(value?: NodeId): NodeId; + + nonce(value?: number): number; + + ledgerNum(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyStopCollectingMessage; + + static write( + value: TimeSlicedSurveyStopCollectingMessage, + io: Buffer, + ): void; + + static isValid(value: TimeSlicedSurveyStopCollectingMessage): boolean; + + static toXDR(value: TimeSlicedSurveyStopCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyStopCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyStopCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SignedTimeSlicedSurveyStopCollectingMessage { + constructor(attributes: { + signature: Buffer; + stopCollecting: TimeSlicedSurveyStopCollectingMessage; + }); + + signature(value?: Buffer): Buffer; + + stopCollecting( + value?: TimeSlicedSurveyStopCollectingMessage, + ): TimeSlicedSurveyStopCollectingMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyStopCollectingMessage; + + static write( + value: SignedTimeSlicedSurveyStopCollectingMessage, + io: Buffer, + ): void; + + static isValid(value: SignedTimeSlicedSurveyStopCollectingMessage): boolean; + + static toXDR(value: SignedTimeSlicedSurveyStopCollectingMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyStopCollectingMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyStopCollectingMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SurveyRequestMessage { constructor(attributes: { surveyorPeerId: NodeId; @@ -5492,6 +6058,49 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedSurveyRequestMessage { + constructor(attributes: { + request: SurveyRequestMessage; + nonce: number; + inboundPeersIndex: number; + outboundPeersIndex: number; + }); + + request(value?: SurveyRequestMessage): SurveyRequestMessage; + + nonce(value?: number): number; + + inboundPeersIndex(value?: number): number; + + outboundPeersIndex(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyRequestMessage; + + static write(value: TimeSlicedSurveyRequestMessage, io: Buffer): void; + + static isValid(value: TimeSlicedSurveyRequestMessage): boolean; + + static toXDR(value: TimeSlicedSurveyRequestMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyRequestMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyRequestMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SignedSurveyRequestMessage { constructor(attributes: { requestSignature: Buffer; @@ -5526,6 +6135,45 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class SignedTimeSlicedSurveyRequestMessage { + constructor(attributes: { + requestSignature: Buffer; + request: TimeSlicedSurveyRequestMessage; + }); + + requestSignature(value?: Buffer): Buffer; + + request( + value?: TimeSlicedSurveyRequestMessage, + ): TimeSlicedSurveyRequestMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyRequestMessage; + + static write(value: SignedTimeSlicedSurveyRequestMessage, io: Buffer): void; + + static isValid(value: SignedTimeSlicedSurveyRequestMessage): boolean; + + static toXDR(value: SignedTimeSlicedSurveyRequestMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyRequestMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyRequestMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SurveyResponseMessage { constructor(attributes: { surveyorPeerId: NodeId; @@ -5569,6 +6217,40 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedSurveyResponseMessage { + constructor(attributes: { response: SurveyResponseMessage; nonce: number }); + + response(value?: SurveyResponseMessage): SurveyResponseMessage; + + nonce(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TimeSlicedSurveyResponseMessage; + + static write(value: TimeSlicedSurveyResponseMessage, io: Buffer): void; + + static isValid(value: TimeSlicedSurveyResponseMessage): boolean; + + static toXDR(value: TimeSlicedSurveyResponseMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TimeSlicedSurveyResponseMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TimeSlicedSurveyResponseMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class SignedSurveyResponseMessage { constructor(attributes: { responseSignature: Buffer; @@ -5603,6 +6285,48 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class SignedTimeSlicedSurveyResponseMessage { + constructor(attributes: { + responseSignature: Buffer; + response: TimeSlicedSurveyResponseMessage; + }); + + responseSignature(value?: Buffer): Buffer; + + response( + value?: TimeSlicedSurveyResponseMessage, + ): TimeSlicedSurveyResponseMessage; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SignedTimeSlicedSurveyResponseMessage; + + static write( + value: SignedTimeSlicedSurveyResponseMessage, + io: Buffer, + ): void; + + static isValid(value: SignedTimeSlicedSurveyResponseMessage): boolean; + + static toXDR(value: SignedTimeSlicedSurveyResponseMessage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignedTimeSlicedSurveyResponseMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignedTimeSlicedSurveyResponseMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class PeerStats { constructor(attributes: { id: NodeId; @@ -5673,6 +6397,89 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TimeSlicedNodeData { + constructor(attributes: { + addedAuthenticatedPeers: number; + droppedAuthenticatedPeers: number; + totalInboundPeerCount: number; + totalOutboundPeerCount: number; + p75ScpFirstToSelfLatencyMs: number; + p75ScpSelfToOtherLatencyMs: number; + lostSyncCount: number; + isValidator: boolean; + maxInboundPeerCount: number; + maxOutboundPeerCount: number; + }); + + addedAuthenticatedPeers(value?: number): number; + + droppedAuthenticatedPeers(value?: number): number; + + totalInboundPeerCount(value?: number): number; + + 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; + } + class TopologyResponseBodyV0 { constructor(attributes: { inboundPeers: PeerStats[]; @@ -5759,6 +6566,43 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class TopologyResponseBodyV2 { + constructor(attributes: { + inboundPeers: TimeSlicedPeerData[]; + outboundPeers: TimeSlicedPeerData[]; + nodeData: TimeSlicedNodeData; + }); + + inboundPeers(value?: TimeSlicedPeerData[]): TimeSlicedPeerData[]; + + outboundPeers(value?: TimeSlicedPeerData[]): TimeSlicedPeerData[]; + + nodeData(value?: TimeSlicedNodeData): TimeSlicedNodeData; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TopologyResponseBodyV2; + + static write(value: TopologyResponseBodyV2, io: Buffer): void; + + static isValid(value: TopologyResponseBodyV2): boolean; + + static toXDR(value: TopologyResponseBodyV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV2; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TopologyResponseBodyV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class FloodAdvert { constructor(attributes: { txHashes: Hash[] }); @@ -6732,6 +7576,43 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class CreateContractArgsV2 { + constructor(attributes: { + contractIdPreimage: ContractIdPreimage; + executable: ContractExecutable; + constructorArgs: ScVal[]; + }); + + contractIdPreimage(value?: ContractIdPreimage): ContractIdPreimage; + + executable(value?: ContractExecutable): ContractExecutable; + + constructorArgs(value?: ScVal[]): ScVal[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): CreateContractArgsV2; + + static write(value: CreateContractArgsV2, io: Buffer): void; + + static isValid(value: CreateContractArgsV2): boolean; + + static toXDR(value: CreateContractArgsV2): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): CreateContractArgsV2; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): CreateContractArgsV2; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class InvokeContractArgs { constructor(attributes: { contractAddress: ScAddress; @@ -6969,6 +7850,37 @@ 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; @@ -7232,23 +8144,152 @@ export namespace xdr { readOnly(value?: LedgerKey[]): LedgerKey[]; - readWrite(value?: LedgerKey[]): LedgerKey[]; + readWrite(value?: LedgerKey[]): LedgerKey[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerFootprint; + + static write(value: LedgerFootprint, io: Buffer): void; + + static isValid(value: LedgerFootprint): boolean; + + static toXDR(value: LedgerFootprint): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerFootprint; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerFootprint; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + 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 { + constructor(attributes: { + keysToProve: LedgerKey[]; + lowBoundEntries: ColdArchiveBucketEntry[]; + highBoundEntries: ColdArchiveBucketEntry[]; + proofLevels: ArchivalProofNode[][]; + }); + + 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; + } + + class ArchivalProof { + constructor(attributes: { epoch: number; body: ArchivalProofBody }); + + epoch(value?: number): number; + + body(value?: ArchivalProofBody): ArchivalProofBody; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerFootprint; + static read(io: Buffer): ArchivalProof; - static write(value: LedgerFootprint, io: Buffer): void; + static write(value: ArchivalProof, io: Buffer): void; - static isValid(value: LedgerFootprint): boolean; + static isValid(value: ArchivalProof): boolean; - static toXDR(value: LedgerFootprint): Buffer; + static toXDR(value: ArchivalProof): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerFootprint; + static fromXDR(input: Buffer, format?: 'raw'): ArchivalProof; - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerFootprint; + static fromXDR(input: string, format: 'hex' | 'base64'): ArchivalProof; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -7294,12 +8335,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; @@ -8135,6 +9176,87 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ShortHashSeed { + constructor(attributes: { seed: Buffer }); + + seed(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ShortHashSeed; + + static write(value: ShortHashSeed, io: Buffer): void; + + static isValid(value: ShortHashSeed): boolean; + + static toXDR(value: ShortHashSeed): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ShortHashSeed; + + static fromXDR(input: string, format: 'hex' | 'base64'): ShortHashSeed; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SerializedBinaryFuseFilter { + constructor(attributes: { + type: BinaryFuseFilterType; + inputHashSeed: ShortHashSeed; + filterSeed: ShortHashSeed; + segmentLength: number; + segementLengthMask: number; + segmentCount: number; + segmentCountLength: number; + fingerprintLength: number; + fingerprints: Buffer; + }); + + type(value?: BinaryFuseFilterType): BinaryFuseFilterType; + + inputHashSeed(value?: ShortHashSeed): ShortHashSeed; + + filterSeed(value?: ShortHashSeed): ShortHashSeed; + + segmentLength(value?: number): number; + + segementLengthMask(value?: number): number; + + segmentCount(value?: number): number; + + segmentCountLength(value?: number): number; + + fingerprintLength(value?: number): number; + + fingerprints(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SerializedBinaryFuseFilter; + + static write(value: SerializedBinaryFuseFilter, io: Buffer): void; + + static isValid(value: SerializedBinaryFuseFilter): boolean; + + static toXDR(value: SerializedBinaryFuseFilter): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SerializedBinaryFuseFilter; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SerializedBinaryFuseFilter; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class UInt128Parts { constructor(attributes: { hi: Uint64; lo: Uint64 }); @@ -8350,6 +9472,40 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ScEnvMetaEntryInterfaceVersion { + constructor(attributes: { protocol: number; preRelease: number }); + + protocol(value?: number): number; + + preRelease(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScEnvMetaEntryInterfaceVersion; + + static write(value: ScEnvMetaEntryInterfaceVersion, io: Buffer): void; + + static isValid(value: ScEnvMetaEntryInterfaceVersion): boolean; + + static toXDR(value: ScEnvMetaEntryInterfaceVersion): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ScEnvMetaEntryInterfaceVersion; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScEnvMetaEntryInterfaceVersion; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class ScMetaV0 { constructor(attributes: { key: string | Buffer; val: string | Buffer }); @@ -9052,6 +10208,41 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } + class ConfigSettingContractParallelComputeV0 { + constructor(attributes: { ledgerMaxParallelThreads: number }); + + ledgerMaxParallelThreads(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; @@ -10118,143 +11309,318 @@ export namespace xdr { static ttl(value: TtlEntry): LedgerEntryData; - value(): - | AccountEntry - | TrustLineEntry - | OfferEntry - | DataEntry - | ClaimableBalanceEntry - | LiquidityPoolEntry - | ContractDataEntry - | ContractCodeEntry - | ConfigSettingEntry - | TtlEntry; + value(): + | AccountEntry + | TrustLineEntry + | OfferEntry + | DataEntry + | ClaimableBalanceEntry + | LiquidityPoolEntry + | ContractDataEntry + | ContractCodeEntry + | ConfigSettingEntry + | TtlEntry; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerEntryData; + + static write(value: LedgerEntryData, io: Buffer): void; + + static isValid(value: LedgerEntryData): boolean; + + static toXDR(value: LedgerEntryData): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryData; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryData; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerEntryExt { + switch(): number; + + v1(value?: LedgerEntryExtensionV1): LedgerEntryExtensionV1; + + static 0(): LedgerEntryExt; + + static 1(value: LedgerEntryExtensionV1): LedgerEntryExt; + + value(): LedgerEntryExtensionV1 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerEntryExt; + + static write(value: LedgerEntryExt, io: Buffer): void; + + static isValid(value: LedgerEntryExt): boolean; + + static toXDR(value: LedgerEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerKey { + switch(): LedgerEntryType; + + account(value?: LedgerKeyAccount): LedgerKeyAccount; + + trustLine(value?: LedgerKeyTrustLine): LedgerKeyTrustLine; + + offer(value?: LedgerKeyOffer): LedgerKeyOffer; + + data(value?: LedgerKeyData): LedgerKeyData; + + claimableBalance( + value?: LedgerKeyClaimableBalance, + ): LedgerKeyClaimableBalance; + + liquidityPool(value?: LedgerKeyLiquidityPool): LedgerKeyLiquidityPool; + + contractData(value?: LedgerKeyContractData): LedgerKeyContractData; + + contractCode(value?: LedgerKeyContractCode): LedgerKeyContractCode; + + configSetting(value?: LedgerKeyConfigSetting): LedgerKeyConfigSetting; + + ttl(value?: LedgerKeyTtl): LedgerKeyTtl; + + static account(value: LedgerKeyAccount): LedgerKey; + + static trustline(value: LedgerKeyTrustLine): LedgerKey; + + static offer(value: LedgerKeyOffer): LedgerKey; + + static data(value: LedgerKeyData): LedgerKey; + + static claimableBalance(value: LedgerKeyClaimableBalance): LedgerKey; + + static liquidityPool(value: LedgerKeyLiquidityPool): LedgerKey; + + static contractData(value: LedgerKeyContractData): LedgerKey; + + static contractCode(value: LedgerKeyContractCode): LedgerKey; + + static configSetting(value: LedgerKeyConfigSetting): LedgerKey; + + static ttl(value: LedgerKeyTtl): LedgerKey; + + value(): + | LedgerKeyAccount + | LedgerKeyTrustLine + | LedgerKeyOffer + | LedgerKeyData + | LedgerKeyClaimableBalance + | LedgerKeyLiquidityPool + | LedgerKeyContractData + | LedgerKeyContractCode + | LedgerKeyConfigSetting + | LedgerKeyTtl; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerKey; + + static write(value: LedgerKey, io: Buffer): void; + + static isValid(value: LedgerKey): boolean; + + static toXDR(value: LedgerKey): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerKey; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKey; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class BucketMetadataExt { + switch(): number; + + bucketListType(value?: BucketListType): BucketListType; + + static 0(): BucketMetadataExt; + + static 1(value: BucketListType): BucketMetadataExt; + + value(): BucketListType | void; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerEntryData; + static read(io: Buffer): BucketMetadataExt; - static write(value: LedgerEntryData, io: Buffer): void; + static write(value: BucketMetadataExt, io: Buffer): void; - static isValid(value: LedgerEntryData): boolean; + static isValid(value: BucketMetadataExt): boolean; - static toXDR(value: LedgerEntryData): Buffer; + static toXDR(value: BucketMetadataExt): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryData; + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadataExt; - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryData; + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadataExt; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerEntryExt { - switch(): number; + class BucketEntry { + switch(): BucketEntryType; - v1(value?: LedgerEntryExtensionV1): LedgerEntryExtensionV1; + liveEntry(value?: LedgerEntry): LedgerEntry; - static 0(): LedgerEntryExt; + deadEntry(value?: LedgerKey): LedgerKey; - static 1(value: LedgerEntryExtensionV1): LedgerEntryExt; + metaEntry(value?: BucketMetadata): BucketMetadata; - value(): LedgerEntryExtensionV1 | void; + static liveentry(value: LedgerEntry): BucketEntry; + + static initentry(value: LedgerEntry): BucketEntry; + + static deadentry(value: LedgerKey): BucketEntry; + + static metaentry(value: BucketMetadata): BucketEntry; + + value(): LedgerEntry | LedgerKey | BucketMetadata; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerEntryExt; + static read(io: Buffer): BucketEntry; - static write(value: LedgerEntryExt, io: Buffer): void; + static write(value: BucketEntry, io: Buffer): void; - static isValid(value: LedgerEntryExt): boolean; + static isValid(value: BucketEntry): boolean; - static toXDR(value: LedgerEntryExt): Buffer; + static toXDR(value: BucketEntry): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): BucketEntry; - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): BucketEntry; static validateXDR(input: Buffer, format?: 'raw'): boolean; static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerKey { - switch(): LedgerEntryType; + class HotArchiveBucketEntry { + switch(): HotArchiveBucketEntryType; - account(value?: LedgerKeyAccount): LedgerKeyAccount; + archivedEntry(value?: LedgerEntry): LedgerEntry; - trustLine(value?: LedgerKeyTrustLine): LedgerKeyTrustLine; + key(value?: LedgerKey): LedgerKey; - offer(value?: LedgerKeyOffer): LedgerKeyOffer; + metaEntry(value?: BucketMetadata): BucketMetadata; - data(value?: LedgerKeyData): LedgerKeyData; + static hotArchiveArchived(value: LedgerEntry): HotArchiveBucketEntry; - claimableBalance( - value?: LedgerKeyClaimableBalance, - ): LedgerKeyClaimableBalance; + static hotArchiveLive(value: LedgerKey): HotArchiveBucketEntry; - liquidityPool(value?: LedgerKeyLiquidityPool): LedgerKeyLiquidityPool; + static hotArchiveDeleted(value: LedgerKey): HotArchiveBucketEntry; - contractData(value?: LedgerKeyContractData): LedgerKeyContractData; + static hotArchiveMetaentry(value: BucketMetadata): HotArchiveBucketEntry; - contractCode(value?: LedgerKeyContractCode): LedgerKeyContractCode; + value(): LedgerEntry | LedgerKey | BucketMetadata; - configSetting(value?: LedgerKeyConfigSetting): LedgerKeyConfigSetting; + toXDR(format?: 'raw'): Buffer; - ttl(value?: LedgerKeyTtl): LedgerKeyTtl; + toXDR(format: 'hex' | 'base64'): string; - static account(value: LedgerKeyAccount): LedgerKey; + static read(io: Buffer): HotArchiveBucketEntry; - static trustline(value: LedgerKeyTrustLine): LedgerKey; + static write(value: HotArchiveBucketEntry, io: Buffer): void; - static offer(value: LedgerKeyOffer): LedgerKey; + static isValid(value: HotArchiveBucketEntry): boolean; - static data(value: LedgerKeyData): LedgerKey; + static toXDR(value: HotArchiveBucketEntry): Buffer; - static claimableBalance(value: LedgerKeyClaimableBalance): LedgerKey; + static fromXDR(input: Buffer, format?: 'raw'): HotArchiveBucketEntry; - static liquidityPool(value: LedgerKeyLiquidityPool): LedgerKey; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): HotArchiveBucketEntry; - static contractData(value: LedgerKeyContractData): LedgerKey; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static contractCode(value: LedgerKeyContractCode): LedgerKey; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static configSetting(value: LedgerKeyConfigSetting): LedgerKey; + class ColdArchiveBucketEntry { + switch(): ColdArchiveBucketEntryType; - static ttl(value: LedgerKeyTtl): LedgerKey; + 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(): - | LedgerKeyAccount - | LedgerKeyTrustLine - | LedgerKeyOffer - | LedgerKeyData - | LedgerKeyClaimableBalance - | LedgerKeyLiquidityPool - | LedgerKeyContractData - | LedgerKeyContractCode - | LedgerKeyConfigSetting - | LedgerKeyTtl; + | BucketMetadata + | ColdArchiveArchivedLeaf + | ColdArchiveDeletedLeaf + | ColdArchiveBoundaryLeaf + | ColdArchiveHashEntry; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerKey; + static read(io: Buffer): ColdArchiveBucketEntry; - static write(value: LedgerKey, io: Buffer): void; + static write(value: ColdArchiveBucketEntry, io: Buffer): void; - static isValid(value: LedgerKey): boolean; + static isValid(value: ColdArchiveBucketEntry): boolean; - static toXDR(value: LedgerKey): Buffer; + static toXDR(value: ColdArchiveBucketEntry): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerKey; + static fromXDR(input: Buffer, format?: 'raw'): ColdArchiveBucketEntry; - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKey; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ColdArchiveBucketEntry; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -10421,74 +11787,6 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BucketMetadataExt { - switch(): number; - - static 0(): BucketMetadataExt; - - value(): void; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): BucketMetadataExt; - - static write(value: BucketMetadataExt, io: Buffer): void; - - static isValid(value: BucketMetadataExt): boolean; - - static toXDR(value: BucketMetadataExt): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): BucketMetadataExt; - - static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadataExt; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class BucketEntry { - switch(): BucketEntryType; - - liveEntry(value?: LedgerEntry): LedgerEntry; - - deadEntry(value?: LedgerKey): LedgerKey; - - metaEntry(value?: BucketMetadata): BucketMetadata; - - static liveentry(value: LedgerEntry): BucketEntry; - - static initentry(value: LedgerEntry): BucketEntry; - - static deadentry(value: LedgerKey): BucketEntry; - - static metaentry(value: BucketMetadata): BucketEntry; - - value(): LedgerEntry | LedgerKey | BucketMetadata; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): BucketEntry; - - static write(value: BucketEntry, io: Buffer): void; - - static isValid(value: BucketEntry): boolean; - - static toXDR(value: BucketEntry): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): BucketEntry; - - static fromXDR(input: string, format: 'hex' | 'base64'): BucketEntry; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - class TxSetComponent { switch(): TxSetComponentType; @@ -10528,9 +11826,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; @@ -10982,6 +12284,10 @@ export namespace xdr { value?: TopologyResponseBodyV1, ): TopologyResponseBodyV1; + topologyResponseBodyV2( + value?: TopologyResponseBodyV2, + ): TopologyResponseBodyV2; + static surveyTopologyResponseV0( value: TopologyResponseBodyV0, ): SurveyResponseBody; @@ -10990,7 +12296,14 @@ export namespace xdr { value: TopologyResponseBodyV1, ): SurveyResponseBody; - value(): TopologyResponseBodyV0 | TopologyResponseBodyV1; + static surveyTopologyResponseV2( + value: TopologyResponseBodyV2, + ): SurveyResponseBody; + + value(): + | TopologyResponseBodyV0 + | TopologyResponseBodyV1 + | TopologyResponseBodyV2; toXDR(format?: 'raw'): Buffer; @@ -11044,6 +12357,22 @@ export namespace xdr { value?: SignedSurveyResponseMessage, ): SignedSurveyResponseMessage; + signedTimeSlicedSurveyRequestMessage( + value?: SignedTimeSlicedSurveyRequestMessage, + ): SignedTimeSlicedSurveyRequestMessage; + + signedTimeSlicedSurveyResponseMessage( + value?: SignedTimeSlicedSurveyResponseMessage, + ): SignedTimeSlicedSurveyResponseMessage; + + signedTimeSlicedSurveyStartCollectingMessage( + value?: SignedTimeSlicedSurveyStartCollectingMessage, + ): SignedTimeSlicedSurveyStartCollectingMessage; + + signedTimeSlicedSurveyStopCollectingMessage( + value?: SignedTimeSlicedSurveyStopCollectingMessage, + ): SignedTimeSlicedSurveyStopCollectingMessage; + qSetHash(value?: Buffer): Buffer; qSet(value?: ScpQuorumSet): ScpQuorumSet; @@ -11084,6 +12413,22 @@ export namespace xdr { static surveyResponse(value: SignedSurveyResponseMessage): StellarMessage; + static timeSlicedSurveyRequest( + value: SignedTimeSlicedSurveyRequestMessage, + ): StellarMessage; + + static timeSlicedSurveyResponse( + value: SignedTimeSlicedSurveyResponseMessage, + ): StellarMessage; + + static timeSlicedSurveyStartCollecting( + value: SignedTimeSlicedSurveyStartCollectingMessage, + ): StellarMessage; + + static timeSlicedSurveyStopCollecting( + value: SignedTimeSlicedSurveyStopCollectingMessage, + ): StellarMessage; + static getScpQuorumset(value: Buffer): StellarMessage; static scpQuorumset(value: ScpQuorumSet): StellarMessage; @@ -11112,6 +12457,10 @@ export namespace xdr { | TransactionEnvelope | SignedSurveyRequestMessage | SignedSurveyResponseMessage + | SignedTimeSlicedSurveyRequestMessage + | SignedTimeSlicedSurveyResponseMessage + | SignedTimeSlicedSurveyStartCollectingMessage + | SignedTimeSlicedSurveyStopCollectingMessage | Buffer | ScpQuorumSet | ScpEnvelope @@ -11373,6 +12722,8 @@ export namespace xdr { wasm(value?: Buffer): Buffer; + createContractV2(value?: CreateContractArgsV2): CreateContractArgsV2; + static hostFunctionTypeInvokeContract( value: InvokeContractArgs, ): HostFunction; @@ -11383,7 +12734,15 @@ export namespace xdr { static hostFunctionTypeUploadContractWasm(value: Buffer): HostFunction; - value(): InvokeContractArgs | CreateContractArgs | Buffer; + static hostFunctionTypeCreateContractV2( + value: CreateContractArgsV2, + ): HostFunction; + + value(): + | InvokeContractArgs + | CreateContractArgs + | Buffer + | CreateContractArgsV2; toXDR(format?: 'raw'): Buffer; @@ -11413,6 +12772,8 @@ export namespace xdr { createContractHostFn(value?: CreateContractArgs): CreateContractArgs; + createContractV2HostFn(value?: CreateContractArgsV2): CreateContractArgsV2; + static sorobanAuthorizedFunctionTypeContractFn( value: InvokeContractArgs, ): SorobanAuthorizedFunction; @@ -11421,7 +12782,11 @@ export namespace xdr { value: CreateContractArgs, ): SorobanAuthorizedFunction; - value(): InvokeContractArgs | CreateContractArgs; + static sorobanAuthorizedFunctionTypeCreateContractV2HostFn( + value: CreateContractArgsV2, + ): SorobanAuthorizedFunction; + + value(): InvokeContractArgs | CreateContractArgs | CreateContractArgsV2; toXDR(format?: 'raw'): Buffer; @@ -11799,6 +13164,75 @@ 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[]; + + static 0(): SorobanTransactionDataExt; + + static 1(value: ArchivalProof[]): SorobanTransactionDataExt; + + value(): ArchivalProof[] | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanTransactionDataExt; + + static write(value: SorobanTransactionDataExt, io: Buffer): void; + + static isValid(value: SorobanTransactionDataExt): boolean; + + static toXDR(value: SorobanTransactionDataExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionDataExt; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionDataExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + class TransactionV0Ext { switch(): number; @@ -14050,11 +15484,15 @@ export namespace xdr { class ScEnvMetaEntry { switch(): ScEnvMetaKind; - interfaceVersion(value?: Uint64): Uint64; + interfaceVersion( + value?: ScEnvMetaEntryInterfaceVersion, + ): ScEnvMetaEntryInterfaceVersion; - static scEnvMetaKindInterfaceVersion(value: Uint64): ScEnvMetaEntry; + static scEnvMetaKindInterfaceVersion( + value: ScEnvMetaEntryInterfaceVersion, + ): ScEnvMetaEntry; - value(): Uint64; + value(): ScEnvMetaEntryInterfaceVersion; toXDR(format?: 'raw'): Buffer; @@ -14344,6 +15782,10 @@ export namespace xdr { evictionIterator(value?: EvictionIterator): EvictionIterator; + contractParallelCompute( + value?: ConfigSettingContractParallelComputeV0, + ): ConfigSettingContractParallelComputeV0; + static configSettingContractMaxSizeBytes(value: number): ConfigSettingEntry; static configSettingContractComputeV0( @@ -14398,6 +15840,10 @@ export namespace xdr { value: EvictionIterator, ): ConfigSettingEntry; + static configSettingContractParallelComputeV0( + value: ConfigSettingContractParallelComputeV0, + ): ConfigSettingEntry; + value(): | number | ConfigSettingContractComputeV0 @@ -14412,7 +15858,8 @@ export namespace xdr { | StateArchivalSettings | ConfigSettingContractExecutionLanesV0 | Uint64[] - | EvictionIterator; + | EvictionIterator + | ConfigSettingContractParallelComputeV0; toXDR(format?: 'raw'): Buffer; diff --git a/xdr/curr/Stellar-contract-config-setting.x b/xdr/curr/Stellar-contract-config-setting.x index 52cc0224..9f09c7b0 100644 --- a/xdr/curr/Stellar-contract-config-setting.x +++ b/xdr/curr/Stellar-contract-config-setting.x @@ -188,7 +188,58 @@ enum ContractCostType { // point on a 256-bit elliptic curve Sec1DecodePointUncompressed = 43, // Cost of verifying an ECDSA Secp256r1 signature - VerifyEcdsaSecp256r1Sig = 44 + VerifyEcdsaSecp256r1Sig = 44, + + // Cost of encoding a BLS12-381 Fp (base field element) + Bls12381EncodeFp = 45, + // Cost of decoding a BLS12-381 Fp (base field element) + Bls12381DecodeFp = 46, + // Cost of checking a G1 point lies on the curve + Bls12381G1CheckPointOnCurve = 47, + // Cost of checking a G1 point belongs to the correct subgroup + Bls12381G1CheckPointInSubgroup = 48, + // Cost of checking a G2 point lies on the curve + Bls12381G2CheckPointOnCurve = 49, + // Cost of checking a G2 point belongs to the correct subgroup + Bls12381G2CheckPointInSubgroup = 50, + // Cost of converting a BLS12-381 G1 point from projective to affine coordinates + Bls12381G1ProjectiveToAffine = 51, + // Cost of converting a BLS12-381 G2 point from projective to affine coordinates + Bls12381G2ProjectiveToAffine = 52, + // Cost of performing BLS12-381 G1 point addition + Bls12381G1Add = 53, + // Cost of performing BLS12-381 G1 scalar multiplication + Bls12381G1Mul = 54, + // Cost of performing BLS12-381 G1 multi-scalar multiplication (MSM) + Bls12381G1Msm = 55, + // Cost of mapping a BLS12-381 Fp field element to a G1 point + Bls12381MapFpToG1 = 56, + // Cost of hashing to a BLS12-381 G1 point + Bls12381HashToG1 = 57, + // Cost of performing BLS12-381 G2 point addition + Bls12381G2Add = 58, + // Cost of performing BLS12-381 G2 scalar multiplication + Bls12381G2Mul = 59, + // Cost of performing BLS12-381 G2 multi-scalar multiplication (MSM) + Bls12381G2Msm = 60, + // Cost of mapping a BLS12-381 Fp2 field element to a G2 point + Bls12381MapFp2ToG2 = 61, + // Cost of hashing to a BLS12-381 G2 point + Bls12381HashToG2 = 62, + // Cost of performing BLS12-381 pairing operation + Bls12381Pairing = 63, + // Cost of converting a BLS12-381 scalar element from U256 + Bls12381FrFromU256 = 64, + // Cost of converting a BLS12-381 scalar element to U256 + Bls12381FrToU256 = 65, + // Cost of performing BLS12-381 scalar element addition/subtraction + Bls12381FrAddSub = 66, + // Cost of performing BLS12-381 scalar element multiplication + Bls12381FrMul = 67, + // Cost of performing BLS12-381 scalar element exponentiation + Bls12381FrPow = 68, + // Cost of performing BLS12-381 scalar element inversion + Bls12381FrInv = 69 }; struct ContractCostParamEntry { diff --git a/xdr/curr/Stellar-contract-env-meta.x b/xdr/curr/Stellar-contract-env-meta.x index 330726de..ed6b0b67 100644 --- a/xdr/curr/Stellar-contract-env-meta.x +++ b/xdr/curr/Stellar-contract-env-meta.x @@ -17,7 +17,10 @@ enum SCEnvMetaKind union SCEnvMetaEntry switch (SCEnvMetaKind kind) { case SC_ENV_META_KIND_INTERFACE_VERSION: - uint64 interfaceVersion; + struct { + uint32 protocol; + uint32 preRelease; + } interfaceVersion; }; } diff --git a/xdr/curr/Stellar-ledger-entries.x b/xdr/curr/Stellar-ledger-entries.x index 3a137ae6..5bf4f9d3 100644 --- a/xdr/curr/Stellar-ledger-entries.x +++ b/xdr/curr/Stellar-ledger-entries.x @@ -678,4 +678,120 @@ enum EnvelopeType ENVELOPE_TYPE_CONTRACT_ID = 8, ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 }; -} + +enum BucketListType +{ + LIVE = 0, + HOT_ARCHIVE = 1, + COLD_ARCHIVE = 2 +}; + +/* Entries used to define the bucket list */ +enum BucketEntryType +{ + METAENTRY = + -1, // At-and-after protocol 11: bucket metadata, should come first. + LIVEENTRY = 0, // Before protocol 11: created-or-updated; + // At-and-after protocol 11: only updated. + DEADENTRY = 1, + INITENTRY = 2 // At-and-after protocol 11: only created. +}; + +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 + // 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 +{ + // Indicates the protocol version used to create / merge this bucket. + uint32 ledgerVersion; + + // reserved for future use + union switch (int v) + { + case 0: + void; + case 1: + BucketListType bucketListType; + } + ext; +}; + +union BucketEntry switch (BucketEntryType type) +{ +case LIVEENTRY: +case INITENTRY: + LedgerEntry liveEntry; + +case DEADENTRY: + LedgerKey deadEntry; +case METAENTRY: + BucketMetadata metaEntry; +}; + +union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) +{ +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 dd58ae8d..0fc03e2a 100644 --- a/xdr/curr/Stellar-ledger.x +++ b/xdr/curr/Stellar-ledger.x @@ -157,43 +157,6 @@ struct ConfigUpgradeSet { ConfigSettingEntry updatedEntry<>; }; -/* Entries used to define the bucket list */ -enum BucketEntryType -{ - METAENTRY = - -1, // At-and-after protocol 11: bucket metadata, should come first. - LIVEENTRY = 0, // Before protocol 11: created-or-updated; - // At-and-after protocol 11: only updated. - DEADENTRY = 1, - INITENTRY = 2 // At-and-after protocol 11: only created. -}; - -struct BucketMetadata -{ - // Indicates the protocol version used to create / merge this bucket. - uint32 ledgerVersion; - - // reserved for future use - union switch (int v) - { - case 0: - void; - } - ext; -}; - -union BucketEntry switch (BucketEntryType type) -{ -case LIVEENTRY: -case INITENTRY: - LedgerEntry liveEntry; - -case DEADENTRY: - LedgerKey deadEntry; -case METAENTRY: - BucketMetadata metaEntry; -}; - enum TxSetComponentType { // txs with effective fee <= bid derived from a base fee (if any). @@ -400,6 +363,8 @@ struct DiagnosticEvent ContractEvent event; }; +typedef DiagnosticEvent DiagnosticEvents<>; + struct SorobanTransactionMetaExtV1 { ExtensionPoint ext; diff --git a/xdr/curr/Stellar-overlay.x b/xdr/curr/Stellar-overlay.x index 4c964736..b398f883 100644 --- a/xdr/curr/Stellar-overlay.x +++ b/xdr/curr/Stellar-overlay.x @@ -119,7 +119,12 @@ enum MessageType SEND_MORE_EXTENDED = 20, FLOOD_ADVERT = 18, - FLOOD_DEMAND = 19 + FLOOD_DEMAND = 19, + + TIME_SLICED_SURVEY_REQUEST = 21, + TIME_SLICED_SURVEY_RESPONSE = 22, + TIME_SLICED_SURVEY_START_COLLECTING = 23, + TIME_SLICED_SURVEY_STOP_COLLECTING = 24 }; struct DontHave @@ -130,13 +135,41 @@ struct DontHave enum SurveyMessageCommandType { - SURVEY_TOPOLOGY = 0 + SURVEY_TOPOLOGY = 0, + TIME_SLICED_SURVEY_TOPOLOGY = 1 }; enum SurveyMessageResponseType { SURVEY_TOPOLOGY_RESPONSE_V0 = 0, - SURVEY_TOPOLOGY_RESPONSE_V1 = 1 + SURVEY_TOPOLOGY_RESPONSE_V1 = 1, + SURVEY_TOPOLOGY_RESPONSE_V2 = 2 +}; + +struct TimeSlicedSurveyStartCollectingMessage +{ + NodeID surveyorID; + uint32 nonce; + uint32 ledgerNum; +}; + +struct SignedTimeSlicedSurveyStartCollectingMessage +{ + Signature signature; + TimeSlicedSurveyStartCollectingMessage startCollecting; +}; + +struct TimeSlicedSurveyStopCollectingMessage +{ + NodeID surveyorID; + uint32 nonce; + uint32 ledgerNum; +}; + +struct SignedTimeSlicedSurveyStopCollectingMessage +{ + Signature signature; + TimeSlicedSurveyStopCollectingMessage stopCollecting; }; struct SurveyRequestMessage @@ -148,12 +181,26 @@ struct SurveyRequestMessage SurveyMessageCommandType commandType; }; +struct TimeSlicedSurveyRequestMessage +{ + SurveyRequestMessage request; + uint32 nonce; + uint32 inboundPeersIndex; + uint32 outboundPeersIndex; +}; + struct SignedSurveyRequestMessage { Signature requestSignature; SurveyRequestMessage request; }; +struct SignedTimeSlicedSurveyRequestMessage +{ + Signature requestSignature; + TimeSlicedSurveyRequestMessage request; +}; + typedef opaque EncryptedBody<64000>; struct SurveyResponseMessage { @@ -164,12 +211,24 @@ struct SurveyResponseMessage EncryptedBody encryptedBody; }; +struct TimeSlicedSurveyResponseMessage +{ + SurveyResponseMessage response; + uint32 nonce; +}; + struct SignedSurveyResponseMessage { Signature responseSignature; SurveyResponseMessage response; }; +struct SignedTimeSlicedSurveyResponseMessage +{ + Signature responseSignature; + TimeSlicedSurveyResponseMessage response; +}; + struct PeerStats { NodeID id; @@ -193,6 +252,34 @@ struct PeerStats typedef PeerStats PeerStatList<25>; +struct TimeSlicedNodeData +{ + uint32 addedAuthenticatedPeers; + uint32 droppedAuthenticatedPeers; + uint32 totalInboundPeerCount; + uint32 totalOutboundPeerCount; + + // SCP stats + uint32 p75SCPFirstToSelfLatencyMs; + uint32 p75SCPSelfToOtherLatencyMs; + + // How many times the node lost sync in the time slice + uint32 lostSyncCount; + + // Config data + bool isValidator; + uint32 maxInboundPeerCount; + uint32 maxOutboundPeerCount; +}; + +struct TimeSlicedPeerData +{ + PeerStats peerStats; + uint32 averageLatencyMs; +}; + +typedef TimeSlicedPeerData TimeSlicedPeerDataList<25>; + struct TopologyResponseBodyV0 { PeerStatList inboundPeers; @@ -214,12 +301,21 @@ struct TopologyResponseBodyV1 uint32 maxOutboundPeerCount; }; +struct TopologyResponseBodyV2 +{ + TimeSlicedPeerDataList inboundPeers; + TimeSlicedPeerDataList outboundPeers; + TimeSlicedNodeData nodeData; +}; + 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; }; const TX_ADVERT_VECTOR_MAX_SIZE = 1000; @@ -269,6 +365,20 @@ case SURVEY_REQUEST: case SURVEY_RESPONSE: SignedSurveyResponseMessage signedSurveyResponseMessage; +case TIME_SLICED_SURVEY_REQUEST: + SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; + +case TIME_SLICED_SURVEY_RESPONSE: + SignedTimeSlicedSurveyResponseMessage signedTimeSlicedSurveyResponseMessage; + +case TIME_SLICED_SURVEY_START_COLLECTING: + SignedTimeSlicedSurveyStartCollectingMessage + signedTimeSlicedSurveyStartCollectingMessage; + +case TIME_SLICED_SURVEY_STOP_COLLECTING: + SignedTimeSlicedSurveyStopCollectingMessage + signedTimeSlicedSurveyStopCollectingMessage; + // SCP case GET_SCP_QUORUMSET: uint256 qSetHash; diff --git a/xdr/curr/Stellar-transaction.x b/xdr/curr/Stellar-transaction.x index 87dd32d3..7d324810 100644 --- a/xdr/curr/Stellar-transaction.x +++ b/xdr/curr/Stellar-transaction.x @@ -476,7 +476,8 @@ enum HostFunctionType { HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, - HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 + HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2, + HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3 }; enum ContractIDPreimageType @@ -503,6 +504,14 @@ struct CreateContractArgs ContractExecutable executable; }; +struct CreateContractArgsV2 +{ + ContractIDPreimage contractIDPreimage; + ContractExecutable executable; + // Arguments of the contract's constructor. + SCVal constructorArgs<>; +}; + struct InvokeContractArgs { SCAddress contractAddress; SCSymbol functionName; @@ -517,20 +526,33 @@ case HOST_FUNCTION_TYPE_CREATE_CONTRACT: CreateContractArgs createContract; case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: opaque wasm<>; +case HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2: + CreateContractArgsV2 createContractV2; }; enum SorobanAuthorizedFunctionType { SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, - SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1, + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2 }; union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type) { case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: InvokeContractArgs contractFn; +// This variant of auth payload for creating new contract instances +// doesn't allow specifying the constructor arguments, creating contracts +// with constructors that take arguments is only possible by authorizing +// `SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN` +// (protocol 22+). case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: CreateContractArgs createContractHostFn; +// This variant of auth payload for creating new contract instances +// is only accepted in and after protocol 22. It allows authorizing the +// contract constructor arguments. +case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN: + CreateContractArgsV2 createContractV2HostFn; }; struct SorobanAuthorizedInvocation @@ -801,6 +823,56 @@ 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 diff --git a/xdr/curr/Stellar-types.x b/xdr/curr/Stellar-types.x index d71bf0d4..73c4e795 100644 --- a/xdr/curr/Stellar-types.x +++ b/xdr/curr/Stellar-types.x @@ -103,4 +103,35 @@ struct HmacSha256Mac { opaque mac[32]; }; -} + +struct ShortHashSeed +{ + opaque seed[16]; +}; + +enum BinaryFuseFilterType +{ + BINARY_FUSE_FILTER_8_BIT = 0, + BINARY_FUSE_FILTER_16_BIT = 1, + BINARY_FUSE_FILTER_32_BIT = 2 +}; + +struct SerializedBinaryFuseFilter +{ + BinaryFuseFilterType type; + + // Seed used to hash input to filter + ShortHashSeed inputHashSeed; + + // Seed used for internal filter hash operations + ShortHashSeed filterSeed; + uint32 segmentLength; + uint32 segementLengthMask; + uint32 segmentCount; + uint32 segmentCountLength; + uint32 fingerprintLength; // Length in terms of element count, not bytes + + // Array of uint8_t, uint16_t, or uint32_t depending on filter type + opaque fingerprints<>; +}; +} \ 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 52cc0224..bd96f9f4 100644 --- a/xdr/next/Stellar-contract-config-setting.x +++ b/xdr/next/Stellar-contract-config-setting.x @@ -23,6 +23,18 @@ struct ConfigSettingContractComputeV0 uint32 txMemoryLimit; }; +// 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; +}; + // Ledger access settings for contracts. struct ConfigSettingContractLedgerCostV0 { @@ -188,7 +200,58 @@ enum ContractCostType { // point on a 256-bit elliptic curve Sec1DecodePointUncompressed = 43, // Cost of verifying an ECDSA Secp256r1 signature - VerifyEcdsaSecp256r1Sig = 44 + VerifyEcdsaSecp256r1Sig = 44, + + // Cost of encoding a BLS12-381 Fp (base field element) + Bls12381EncodeFp = 45, + // Cost of decoding a BLS12-381 Fp (base field element) + Bls12381DecodeFp = 46, + // Cost of checking a G1 point lies on the curve + Bls12381G1CheckPointOnCurve = 47, + // Cost of checking a G1 point belongs to the correct subgroup + Bls12381G1CheckPointInSubgroup = 48, + // Cost of checking a G2 point lies on the curve + Bls12381G2CheckPointOnCurve = 49, + // Cost of checking a G2 point belongs to the correct subgroup + Bls12381G2CheckPointInSubgroup = 50, + // Cost of converting a BLS12-381 G1 point from projective to affine coordinates + Bls12381G1ProjectiveToAffine = 51, + // Cost of converting a BLS12-381 G2 point from projective to affine coordinates + Bls12381G2ProjectiveToAffine = 52, + // Cost of performing BLS12-381 G1 point addition + Bls12381G1Add = 53, + // Cost of performing BLS12-381 G1 scalar multiplication + Bls12381G1Mul = 54, + // Cost of performing BLS12-381 G1 multi-scalar multiplication (MSM) + Bls12381G1Msm = 55, + // Cost of mapping a BLS12-381 Fp field element to a G1 point + Bls12381MapFpToG1 = 56, + // Cost of hashing to a BLS12-381 G1 point + Bls12381HashToG1 = 57, + // Cost of performing BLS12-381 G2 point addition + Bls12381G2Add = 58, + // Cost of performing BLS12-381 G2 scalar multiplication + Bls12381G2Mul = 59, + // Cost of performing BLS12-381 G2 multi-scalar multiplication (MSM) + Bls12381G2Msm = 60, + // Cost of mapping a BLS12-381 Fp2 field element to a G2 point + Bls12381MapFp2ToG2 = 61, + // Cost of hashing to a BLS12-381 G2 point + Bls12381HashToG2 = 62, + // Cost of performing BLS12-381 pairing operation + Bls12381Pairing = 63, + // Cost of converting a BLS12-381 scalar element from U256 + Bls12381FrFromU256 = 64, + // Cost of converting a BLS12-381 scalar element to U256 + Bls12381FrToU256 = 65, + // Cost of performing BLS12-381 scalar element addition/subtraction + Bls12381FrAddSub = 66, + // Cost of performing BLS12-381 scalar element multiplication + Bls12381FrMul = 67, + // Cost of performing BLS12-381 scalar element exponentiation + Bls12381FrPow = 68, + // Cost of performing BLS12-381 scalar element inversion + Bls12381FrInv = 69 }; struct ContractCostParamEntry { @@ -251,7 +314,8 @@ enum ConfigSettingID CONFIG_SETTING_STATE_ARCHIVAL = 10, CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, - CONFIG_SETTING_EVICTION_ITERATOR = 13 + CONFIG_SETTING_EVICTION_ITERATOR = 13, + CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0 = 14 }; union ConfigSettingEntry switch (ConfigSettingID configSettingID) @@ -284,5 +348,7 @@ case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: uint64 bucketListSizeWindow<>; case CONFIG_SETTING_EVICTION_ITERATOR: EvictionIterator evictionIterator; +case CONFIG_SETTING_CONTRACT_PARALLEL_COMPUTE_V0: + ConfigSettingContractParallelComputeV0 contractParallelCompute; }; } diff --git a/xdr/next/Stellar-contract-env-meta.x b/xdr/next/Stellar-contract-env-meta.x index 330726de..ed6b0b67 100644 --- a/xdr/next/Stellar-contract-env-meta.x +++ b/xdr/next/Stellar-contract-env-meta.x @@ -17,7 +17,10 @@ enum SCEnvMetaKind union SCEnvMetaEntry switch (SCEnvMetaKind kind) { case SC_ENV_META_KIND_INTERFACE_VERSION: - uint64 interfaceVersion; + struct { + uint32 protocol; + uint32 preRelease; + } interfaceVersion; }; } diff --git a/xdr/next/Stellar-ledger-entries.x b/xdr/next/Stellar-ledger-entries.x index 3a137ae6..9238fcda 100644 --- a/xdr/next/Stellar-ledger-entries.x +++ b/xdr/next/Stellar-ledger-entries.x @@ -678,4 +678,120 @@ enum EnvelopeType ENVELOPE_TYPE_CONTRACT_ID = 8, ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 }; + +enum BucketListType +{ + LIVE = 0, + HOT_ARCHIVE = 1, + COLD_ARCHIVE = 2 +}; + +/* Entries used to define the bucket list */ +enum BucketEntryType +{ + METAENTRY = + -1, // At-and-after protocol 11: bucket metadata, should come first. + LIVEENTRY = 0, // Before protocol 11: created-or-updated; + // At-and-after protocol 11: only updated. + DEADENTRY = 1, + INITENTRY = 2 // At-and-after protocol 11: only created. +}; + +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 + // 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 +{ + // Indicates the protocol version used to create / merge this bucket. + uint32 ledgerVersion; + + // reserved for future use + union switch (int v) + { + case 0: + void; + case 1: + BucketListType bucketListType; + } + ext; +}; + +union BucketEntry switch (BucketEntryType type) +{ +case LIVEENTRY: +case INITENTRY: + LedgerEntry liveEntry; + +case DEADENTRY: + LedgerKey deadEntry; +case METAENTRY: + BucketMetadata metaEntry; +}; + +union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) +{ +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 dd58ae8d..9c0d0360 100644 --- a/xdr/next/Stellar-ledger.x +++ b/xdr/next/Stellar-ledger.x @@ -157,43 +157,6 @@ struct ConfigUpgradeSet { ConfigSettingEntry updatedEntry<>; }; -/* Entries used to define the bucket list */ -enum BucketEntryType -{ - METAENTRY = - -1, // At-and-after protocol 11: bucket metadata, should come first. - LIVEENTRY = 0, // Before protocol 11: created-or-updated; - // At-and-after protocol 11: only updated. - DEADENTRY = 1, - INITENTRY = 2 // At-and-after protocol 11: only created. -}; - -struct BucketMetadata -{ - // Indicates the protocol version used to create / merge this bucket. - uint32 ledgerVersion; - - // reserved for future use - union switch (int v) - { - case 0: - void; - } - ext; -}; - -union BucketEntry switch (BucketEntryType type) -{ -case LIVEENTRY: -case INITENTRY: - LedgerEntry liveEntry; - -case DEADENTRY: - LedgerKey deadEntry; -case METAENTRY: - BucketMetadata metaEntry; -}; - enum TxSetComponentType { // txs with effective fee <= bid derived from a base fee (if any). @@ -201,6 +164,15 @@ enum TxSetComponentType TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 }; +typedef TransactionEnvelope TxExecutionThread<>; +typedef TxExecutionThread ParallelTxExecutionStage<>; + +struct ParallelTxsComponent +{ + int64* baseFee; + ParallelTxExecutionStage executionStages<>; +}; + union TxSetComponent switch (TxSetComponentType type) { case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE: @@ -215,6 +187,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 diff --git a/xdr/next/Stellar-overlay.x b/xdr/next/Stellar-overlay.x index 4c964736..b398f883 100644 --- a/xdr/next/Stellar-overlay.x +++ b/xdr/next/Stellar-overlay.x @@ -119,7 +119,12 @@ enum MessageType SEND_MORE_EXTENDED = 20, FLOOD_ADVERT = 18, - FLOOD_DEMAND = 19 + FLOOD_DEMAND = 19, + + TIME_SLICED_SURVEY_REQUEST = 21, + TIME_SLICED_SURVEY_RESPONSE = 22, + TIME_SLICED_SURVEY_START_COLLECTING = 23, + TIME_SLICED_SURVEY_STOP_COLLECTING = 24 }; struct DontHave @@ -130,13 +135,41 @@ struct DontHave enum SurveyMessageCommandType { - SURVEY_TOPOLOGY = 0 + SURVEY_TOPOLOGY = 0, + TIME_SLICED_SURVEY_TOPOLOGY = 1 }; enum SurveyMessageResponseType { SURVEY_TOPOLOGY_RESPONSE_V0 = 0, - SURVEY_TOPOLOGY_RESPONSE_V1 = 1 + SURVEY_TOPOLOGY_RESPONSE_V1 = 1, + SURVEY_TOPOLOGY_RESPONSE_V2 = 2 +}; + +struct TimeSlicedSurveyStartCollectingMessage +{ + NodeID surveyorID; + uint32 nonce; + uint32 ledgerNum; +}; + +struct SignedTimeSlicedSurveyStartCollectingMessage +{ + Signature signature; + TimeSlicedSurveyStartCollectingMessage startCollecting; +}; + +struct TimeSlicedSurveyStopCollectingMessage +{ + NodeID surveyorID; + uint32 nonce; + uint32 ledgerNum; +}; + +struct SignedTimeSlicedSurveyStopCollectingMessage +{ + Signature signature; + TimeSlicedSurveyStopCollectingMessage stopCollecting; }; struct SurveyRequestMessage @@ -148,12 +181,26 @@ struct SurveyRequestMessage SurveyMessageCommandType commandType; }; +struct TimeSlicedSurveyRequestMessage +{ + SurveyRequestMessage request; + uint32 nonce; + uint32 inboundPeersIndex; + uint32 outboundPeersIndex; +}; + struct SignedSurveyRequestMessage { Signature requestSignature; SurveyRequestMessage request; }; +struct SignedTimeSlicedSurveyRequestMessage +{ + Signature requestSignature; + TimeSlicedSurveyRequestMessage request; +}; + typedef opaque EncryptedBody<64000>; struct SurveyResponseMessage { @@ -164,12 +211,24 @@ struct SurveyResponseMessage EncryptedBody encryptedBody; }; +struct TimeSlicedSurveyResponseMessage +{ + SurveyResponseMessage response; + uint32 nonce; +}; + struct SignedSurveyResponseMessage { Signature responseSignature; SurveyResponseMessage response; }; +struct SignedTimeSlicedSurveyResponseMessage +{ + Signature responseSignature; + TimeSlicedSurveyResponseMessage response; +}; + struct PeerStats { NodeID id; @@ -193,6 +252,34 @@ struct PeerStats typedef PeerStats PeerStatList<25>; +struct TimeSlicedNodeData +{ + uint32 addedAuthenticatedPeers; + uint32 droppedAuthenticatedPeers; + uint32 totalInboundPeerCount; + uint32 totalOutboundPeerCount; + + // SCP stats + uint32 p75SCPFirstToSelfLatencyMs; + uint32 p75SCPSelfToOtherLatencyMs; + + // How many times the node lost sync in the time slice + uint32 lostSyncCount; + + // Config data + bool isValidator; + uint32 maxInboundPeerCount; + uint32 maxOutboundPeerCount; +}; + +struct TimeSlicedPeerData +{ + PeerStats peerStats; + uint32 averageLatencyMs; +}; + +typedef TimeSlicedPeerData TimeSlicedPeerDataList<25>; + struct TopologyResponseBodyV0 { PeerStatList inboundPeers; @@ -214,12 +301,21 @@ struct TopologyResponseBodyV1 uint32 maxOutboundPeerCount; }; +struct TopologyResponseBodyV2 +{ + TimeSlicedPeerDataList inboundPeers; + TimeSlicedPeerDataList outboundPeers; + TimeSlicedNodeData nodeData; +}; + 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; }; const TX_ADVERT_VECTOR_MAX_SIZE = 1000; @@ -269,6 +365,20 @@ case SURVEY_REQUEST: case SURVEY_RESPONSE: SignedSurveyResponseMessage signedSurveyResponseMessage; +case TIME_SLICED_SURVEY_REQUEST: + SignedTimeSlicedSurveyRequestMessage signedTimeSlicedSurveyRequestMessage; + +case TIME_SLICED_SURVEY_RESPONSE: + SignedTimeSlicedSurveyResponseMessage signedTimeSlicedSurveyResponseMessage; + +case TIME_SLICED_SURVEY_START_COLLECTING: + SignedTimeSlicedSurveyStartCollectingMessage + signedTimeSlicedSurveyStartCollectingMessage; + +case TIME_SLICED_SURVEY_STOP_COLLECTING: + SignedTimeSlicedSurveyStopCollectingMessage + signedTimeSlicedSurveyStopCollectingMessage; + // SCP case GET_SCP_QUORUMSET: uint256 qSetHash; diff --git a/xdr/next/Stellar-transaction.x b/xdr/next/Stellar-transaction.x index 87dd32d3..f285506f 100644 --- a/xdr/next/Stellar-transaction.x +++ b/xdr/next/Stellar-transaction.x @@ -476,7 +476,8 @@ enum HostFunctionType { HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, - HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 + HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2, + HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3 }; enum ContractIDPreimageType @@ -503,6 +504,14 @@ struct CreateContractArgs ContractExecutable executable; }; +struct CreateContractArgsV2 +{ + ContractIDPreimage contractIDPreimage; + ContractExecutable executable; + // Arguments of the contract's constructor. + SCVal constructorArgs<>; +}; + struct InvokeContractArgs { SCAddress contractAddress; SCSymbol functionName; @@ -517,20 +526,33 @@ case HOST_FUNCTION_TYPE_CREATE_CONTRACT: CreateContractArgs createContract; case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: opaque wasm<>; +case HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2: + CreateContractArgsV2 createContractV2; }; enum SorobanAuthorizedFunctionType { SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, - SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1, + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2 }; union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type) { case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: InvokeContractArgs contractFn; +// This variant of auth payload for creating new contract instances +// doesn't allow specifying the constructor arguments, creating contracts +// with constructors that take arguments is only possible by authorizing +// `SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN` +// (protocol 22+). case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: CreateContractArgs createContractHostFn; +// This variant of auth payload for creating new contract instances +// is only accepted in and after protocol 22. It allows authorizing the +// contract constructor arguments. +case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN: + CreateContractArgsV2 createContractV2HostFn; }; struct SorobanAuthorizedInvocation @@ -801,6 +823,56 @@ 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 @@ -819,7 +891,13 @@ struct SorobanResources // The transaction extension for Soroban. struct SorobanTransactionData { - ExtensionPoint ext; + union switch (int v) + { + case 0: + void; + case 1: + ArchivalProof proofs<>; + } ext; SorobanResources resources; // Amount of the transaction `fee` allocated to the Soroban resource fees. // The fraction of `resourceFee` corresponding to `resources` specified diff --git a/xdr/next/Stellar-types.x b/xdr/next/Stellar-types.x index d71bf0d4..758c2954 100644 --- a/xdr/next/Stellar-types.x +++ b/xdr/next/Stellar-types.x @@ -103,4 +103,35 @@ struct HmacSha256Mac { opaque mac[32]; }; + +struct ShortHashSeed +{ + opaque seed[16]; +}; + +enum BinaryFuseFilterType +{ + BINARY_FUSE_FILTER_8_BIT = 0, + BINARY_FUSE_FILTER_16_BIT = 1, + BINARY_FUSE_FILTER_32_BIT = 2 +}; + +struct SerializedBinaryFuseFilter +{ + BinaryFuseFilterType type; + + // Seed used to hash input to filter + ShortHashSeed inputHashSeed; + + // Seed used for internal filter hash operations + ShortHashSeed filterSeed; + uint32 segmentLength; + uint32 segementLengthMask; + uint32 segmentCount; + uint32 segmentCountLength; + uint32 fingerprintLength; // Length in terms of element count, not bytes + + // Array of uint8_t, uint16_t, or uint32_t depending on filter type + opaque fingerprints<>; +}; }