From ecf7f805c90538e177470febb0a3a5b989c60620 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Wed, 1 Jul 2026 01:51:41 +0200 Subject: [PATCH 01/10] feat: Introduce lending 1.1 amendment and add `MemoData` field to `VaultDelete` transaction (#6324) --- include/xrpl/protocol/detail/features.macro | 1 + .../xrpl/protocol/detail/transactions.macro | 1 + .../transactions/VaultDelete.h | 37 ++++++++++ .../tx/transactors/vault/VaultDelete.cpp | 8 +++ src/test/app/Vault_test.cpp | 70 +++++++++++++++++++ .../transactions/VaultDeleteTests.cpp | 49 +++++++++++++ 6 files changed, 166 insertions(+) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index a9b237be32..3c808d960b 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -14,6 +14,7 @@ // Add new amendments to the top of this list. // Keep it sorted in reverse chronological order. +XRPL_FEATURE(LendingProtocolV1_1, Supported::No, VoteBehavior::DefaultNo) XRPL_FEATURE(ConfidentialTransfer, Supported::No, VoteBehavior::DefaultNo) XRPL_FIX (Cleanup3_3_0, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (Cleanup3_2_0, Supported::Yes, VoteBehavior::DefaultNo) diff --git a/include/xrpl/protocol/detail/transactions.macro b/include/xrpl/protocol/detail/transactions.macro index 8a3b0ff2ce..b46fca92b6 100644 --- a/include/xrpl/protocol/detail/transactions.macro +++ b/include/xrpl/protocol/detail/transactions.macro @@ -889,6 +889,7 @@ TRANSACTION(ttVAULT_DELETE, 67, VaultDelete, MustDeleteAcct | DestroyMptIssuance | MustModifyVault, ({ {sfVaultID, SoeRequired}, + {sfMemoData, SoeOptional}, })) /** This transaction trades assets for shares with a vault. */ diff --git a/include/xrpl/protocol_autogen/transactions/VaultDelete.h b/include/xrpl/protocol_autogen/transactions/VaultDelete.h index 2b6e248c0a..b4c08ae229 100644 --- a/include/xrpl/protocol_autogen/transactions/VaultDelete.h +++ b/include/xrpl/protocol_autogen/transactions/VaultDelete.h @@ -57,6 +57,32 @@ public: { return this->tx_->at(sfVaultID); } + + /** + * @brief Get sfMemoData (SoeOptional) + * @return The field value, or std::nullopt if not present. + */ + [[nodiscard]] + protocol_autogen::Optional + getMemoData() const + { + if (hasMemoData()) + { + return this->tx_->at(sfMemoData); + } + return std::nullopt; + } + + /** + * @brief Check if sfMemoData is present. + * @return True if the field is present, false otherwise. + */ + [[nodiscard]] + bool + hasMemoData() const + { + return this->tx_->isFieldPresent(sfMemoData); + } }; /** @@ -112,6 +138,17 @@ public: return *this; } + /** + * @brief Set sfMemoData (SoeOptional) + * @return Reference to this builder for method chaining. + */ + VaultDeleteBuilder& + setMemoData(std::decay_t const& value) + { + object_[sfMemoData] = value; + return *this; + } + /** * @brief Build and return the VaultDelete wrapper. * @param publicKey The public key for signing. diff --git a/src/libxrpl/tx/transactors/vault/VaultDelete.cpp b/src/libxrpl/tx/transactors/vault/VaultDelete.cpp index 0550f08b17..fa38ae278b 100644 --- a/src/libxrpl/tx/transactors/vault/VaultDelete.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultDelete.cpp @@ -7,8 +7,10 @@ #include #include #include +#include #include #include +#include #include #include #include // IWYU pragma: keep @@ -28,6 +30,12 @@ VaultDelete::preflight(PreflightContext const& ctx) return temMALFORMED; } + if (ctx.tx.isFieldPresent(sfMemoData) && !ctx.rules.enabled(featureLendingProtocolV1_1)) + return temDISABLED; + + if (!validDataLength(ctx.tx[~sfMemoData], kMaxDataPayloadLength)) + return temMALFORMED; + return tesSUCCESS; } diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index 9b29442197..d9afd93b23 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -7511,6 +7511,74 @@ class Vault_test : public beast::unit_test::Suite } } + void + testVaultDeleteMemoData() + { + using namespace test::jtx; + + Env env{*this}; + + Account const owner{"owner"}; + env.fund(XRP(1'000'000), owner); + env.close(); + + Vault const vault{env}; + + auto const keylet = keylet::vault(owner.id(), 1); + auto delTx = vault.del({.owner = owner, .id = keylet.key}); + + // Test VaultDelete with featureLendingProtocolV1_1 disabled + // Transaction fails if the data field is provided + { + testcase("VaultDelete memo data featureLendingProtocolV1_1 disabled"); + env.disableFeature(featureLendingProtocolV1_1); + delTx[sfMemoData] = strHex(std::string(kMaxDataPayloadLength, 'A')); + env(delTx, Ter(temDISABLED)); + env.enableFeature(featureLendingProtocolV1_1); + env.close(); + } + + // Transaction fails if the data field is too large + { + testcase("VaultDelete memo data featureLendingProtocolV1_1 enabled data too large"); + delTx[sfMemoData] = strHex(std::string(kMaxDataPayloadLength + 1, 'A')); + env(delTx, Ter(temMALFORMED)); + env.close(); + } + + // Transaction fails if the data field is set, but is empty + { + testcase("VaultDelete memo data featureLendingProtocolV1_1 enabled data empty"); + delTx[sfMemoData] = strHex(std::string(0, 'A')); + env(delTx, Ter(temMALFORMED)); + env.close(); + } + + { + testcase("VaultDelete memo data featureLendingProtocolV1_1 enabled no vault"); + auto const keylet = keylet::vault(owner.id(), env.seq(owner)); + + // Recreate the transaction as the vault keylet changed + auto delTx = vault.del({.owner = owner, .id = keylet.key}); + delTx[sfMemoData] = strHex(std::string(kMaxDataPayloadLength, 'A')); + env(delTx, Ter(tecNO_ENTRY)); + env.close(); + } + + { + testcase("VaultDelete memo data featureLendingProtocolV1_1 enabled data valid"); + PrettyAsset const xrpAsset = xrpIssue(); + auto const [tx, keylet] = vault.create({.owner = owner, .asset = xrpAsset}); + env(tx, Ter(tesSUCCESS)); + env.close(); + // Recreate the transaction as the vault keylet changed + auto delTx = vault.del({.owner = owner, .id = keylet.key}); + delTx[sfMemoData] = strHex(std::string(kMaxDataPayloadLength, 'A')); + env(delTx, Ter(tesSUCCESS)); + env.close(); + } + } + void testVaultDepositFreeze() { @@ -8082,6 +8150,7 @@ class Vault_test : public beast::unit_test::Suite runTests(); env.disableFeature(fixCleanup3_3_0); + runTests(); env.enableFeature(fixCleanup3_3_0); } @@ -8115,6 +8184,7 @@ public: testVaultClawbackAssets(); testVaultEscrowedMPT(); testAssetsMaximum(); + testVaultDeleteMemoData(); testBug6LimitBypassWithShares(); testRemoveEmptyHoldingLockedAmount(); testRemoveEmptyHoldingConfidentialBalances(); diff --git a/src/tests/libxrpl/protocol_autogen/transactions/VaultDeleteTests.cpp b/src/tests/libxrpl/protocol_autogen/transactions/VaultDeleteTests.cpp index 70747af1ed..8f0eb2e4cd 100644 --- a/src/tests/libxrpl/protocol_autogen/transactions/VaultDeleteTests.cpp +++ b/src/tests/libxrpl/protocol_autogen/transactions/VaultDeleteTests.cpp @@ -30,6 +30,7 @@ TEST(TransactionsVaultDeleteTests, BuilderSettersRoundTrip) // Transaction-specific field values auto const vaultIDValue = canonical_UINT256(); + auto const memoDataValue = canonical_VL(); VaultDeleteBuilder builder{ accountValue, @@ -39,6 +40,7 @@ TEST(TransactionsVaultDeleteTests, BuilderSettersRoundTrip) }; // Set optional fields + builder.setMemoData(memoDataValue); auto tx = builder.build(publicKey, secretKey); @@ -62,6 +64,14 @@ TEST(TransactionsVaultDeleteTests, BuilderSettersRoundTrip) } // Verify optional fields + { + auto const& expected = memoDataValue; + auto const actualOpt = tx.getMemoData(); + ASSERT_TRUE(actualOpt.has_value()) << "Optional field sfMemoData should be present"; + expectEqualField(expected, *actualOpt, "sfMemoData"); + EXPECT_TRUE(tx.hasMemoData()); + } + } // 2 & 4) Start from an STTx, construct a builder from it, build a new wrapper, @@ -79,6 +89,7 @@ TEST(TransactionsVaultDeleteTests, BuilderFromStTxRoundTrip) // Transaction-specific field values auto const vaultIDValue = canonical_UINT256(); + auto const memoDataValue = canonical_VL(); // Build an initial transaction VaultDeleteBuilder initialBuilder{ @@ -88,6 +99,7 @@ TEST(TransactionsVaultDeleteTests, BuilderFromStTxRoundTrip) feeValue }; + initialBuilder.setMemoData(memoDataValue); auto initialTx = initialBuilder.build(publicKey, secretKey); @@ -112,6 +124,13 @@ TEST(TransactionsVaultDeleteTests, BuilderFromStTxRoundTrip) } // Verify optional fields + { + auto const& expected = memoDataValue; + auto const actualOpt = rebuiltTx.getMemoData(); + ASSERT_TRUE(actualOpt.has_value()) << "Optional field sfMemoData should be present"; + expectEqualField(expected, *actualOpt, "sfMemoData"); + } + } // 3) Verify wrapper throws when constructed from wrong transaction type. @@ -142,5 +161,35 @@ TEST(TransactionsVaultDeleteTests, BuilderThrowsOnWrongTxType) EXPECT_THROW(VaultDeleteBuilder{wrongTx.getSTTx()}, std::runtime_error); } +// 5) Build with only required fields and verify optional fields return nullopt. +TEST(TransactionsVaultDeleteTests, OptionalFieldsReturnNullopt) +{ + // Generate a deterministic keypair for signing + auto const [publicKey, secretKey] = + generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultDeleteNullopt")); + + // Common transaction fields + auto const accountValue = calcAccountID(publicKey); + std::uint32_t const sequenceValue = 3; + auto const feeValue = canonical_AMOUNT(); + + // Transaction-specific required field values + auto const vaultIDValue = canonical_UINT256(); + + VaultDeleteBuilder builder{ + accountValue, + vaultIDValue, + sequenceValue, + feeValue + }; + + // Do NOT set optional fields + + auto tx = builder.build(publicKey, secretKey); + + // Verify optional fields are not present + EXPECT_FALSE(tx.hasMemoData()); + EXPECT_FALSE(tx.getMemoData().has_value()); +} } From 86d8b244d6e9b61952de736c010c789e12c6498e Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Wed, 1 Jul 2026 08:47:14 -0400 Subject: [PATCH 02/10] feat: Add Batch (XLS-56) V1_1 (#6446) Co-authored-by: Mayukha Vadari --- include/xrpl/core/HashRouter.h | 6 +- include/xrpl/ledger/OpenView.h | 2 +- include/xrpl/protocol/Batch.h | 10 +- include/xrpl/protocol/Protocol.h | 3 + include/xrpl/protocol/STObject.h | 5 + include/xrpl/protocol/STTx.h | 53 +- include/xrpl/protocol/TER.h | 2 + include/xrpl/protocol/detail/features.macro | 8 +- .../xrpl/protocol/detail/transactions.macro | 2 +- .../protocol_autogen/transactions/Batch.h | 2 +- include/xrpl/tx/ApplyContext.h | 6 +- include/xrpl/tx/Transactor.h | 49 +- include/xrpl/tx/transactors/system/Batch.h | 8 +- src/libxrpl/protocol/STObject.cpp | 14 + src/libxrpl/protocol/STTx.cpp | 133 +- src/libxrpl/protocol/TER.cpp | 2 + src/libxrpl/tx/Transactor.cpp | 105 +- src/libxrpl/tx/apply.cpp | 34 +- .../tx/transactors/lending/LoanSet.cpp | 2 +- .../tx/transactors/payment/Payment.cpp | 32 +- src/libxrpl/tx/transactors/system/Batch.cpp | 153 +- src/test/app/Batch_test.cpp | 1227 ++++++++++++++--- .../app/ConfidentialTransferExtended_test.cpp | 35 +- src/test/app/LedgerReplay_test.cpp | 45 +- src/test/app/TxQ_test.cpp | 3 +- src/test/jtx/TestHelpers.h | 4 +- src/test/jtx/batch.h | 5 +- src/test/jtx/impl/batch.cpp | 16 +- src/test/rpc/Feature_test.cpp | 2 +- src/test/rpc/Simulate_test.cpp | 16 +- src/xrpld/app/ledger/detail/BuildLedger.cpp | 9 + src/xrpld/app/misc/NetworkOPs.cpp | 7 +- src/xrpld/app/misc/detail/TxQ.cpp | 7 + src/xrpld/overlay/detail/PeerImp.cpp | 4 +- .../rpc/handlers/transaction/Simulate.cpp | 8 + 35 files changed, 1536 insertions(+), 483 deletions(-) diff --git a/include/xrpl/core/HashRouter.h b/include/xrpl/core/HashRouter.h index d36b8aee6e..c8b34d8e93 100644 --- a/include/xrpl/core/HashRouter.h +++ b/include/xrpl/core/HashRouter.h @@ -19,12 +19,14 @@ enum class HashRouterFlags : std::uint16_t { HELD = 0x08, // Held by LedgerMaster after potential processing failure TRUSTED = 0x10, // Comes from a trusted source - // Private flags (used internally in apply.cpp) - // Do not attempt to read, set, or reuse. + // Private flags. Each group is owned by one file; do not read, set, or + // reuse a flag outside the file noted. + // Used in apply.cpp PRIVATE1 = 0x0100, PRIVATE2 = 0x0200, PRIVATE3 = 0x0400, PRIVATE4 = 0x0800, + // Used in EscrowFinish.cpp PRIVATE5 = 0x1000, PRIVATE6 = 0x2000 }; diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index 4ba2a7759b..d145473516 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -28,7 +28,7 @@ inline constexpr struct OpenLedgerT /** Batch view construction tag. Views constructed with this tag are part of a stack of views - used during batch transaction applied. + used during batch transaction application. */ inline constexpr struct BatchViewT { diff --git a/include/xrpl/protocol/Batch.h b/include/xrpl/protocol/Batch.h index 2f2412b3ff..4e021442d6 100644 --- a/include/xrpl/protocol/Batch.h +++ b/include/xrpl/protocol/Batch.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -7,9 +8,16 @@ namespace xrpl { inline void -serializeBatch(Serializer& msg, std::uint32_t const& flags, std::vector const& txids) +serializeBatch( + Serializer& msg, + AccountID const& outerAccount, + std::uint32_t outerSeqValue, + std::uint32_t const& flags, + std::vector const& txids) { msg.add32(HashPrefix::Batch); + msg.addBitString(outerAccount); + msg.add32(outerSeqValue); msg.add32(flags); msg.add32(std::uint32_t(txids.size())); for (auto const& txid : txids) diff --git a/include/xrpl/protocol/Protocol.h b/include/xrpl/protocol/Protocol.h index 7eac92e83c..ba6347dfa7 100644 --- a/include/xrpl/protocol/Protocol.h +++ b/include/xrpl/protocol/Protocol.h @@ -311,6 +311,9 @@ constexpr std::size_t kPermissionMaxSize = 10; /** The maximum number of transactions that can be in a batch. */ constexpr std::size_t kMaxBatchTxCount = 8; +/** The maximum number of batch signers. */ +constexpr std::size_t kMaxBatchSigners = kMaxBatchTxCount * 3; + /** Length of a secp256k1 scalar in bytes. */ constexpr std::size_t kEcScalarLength = kMPT_SCALAR_SIZE; diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index e65cc79c78..044e48ce62 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -217,6 +217,11 @@ public: [[nodiscard]] AccountID getAccountID(SField const& field) const; + /** The account responsible for the fee and authorization: the delegate when + sfDelegate is present, otherwise the account. */ + [[nodiscard]] AccountID + getFeePayer() const; + [[nodiscard]] Blob getFieldVL(SField const& field) const; [[nodiscard]] STAmount const& diff --git a/include/xrpl/protocol/STTx.h b/include/xrpl/protocol/STTx.h index 659fede31d..e78fce27a1 100644 --- a/include/xrpl/protocol/STTx.h +++ b/include/xrpl/protocol/STTx.h @@ -12,6 +12,7 @@ #include #include +#include namespace xrpl { @@ -51,51 +52,48 @@ public: STTx(TxType type, std::function assembler); // STObject functions. - SerializedTypeID + [[nodiscard]] SerializedTypeID getSType() const override; - std::string + [[nodiscard]] std::string getFullText() const override; // Outer transaction functions / signature functions. static Blob getSignature(STObject const& sigObject); - Blob + [[nodiscard]] Blob getSignature() const { return getSignature(*this); } - uint256 + [[nodiscard]] uint256 getSigningHash() const; - TxType + [[nodiscard]] TxType getTxnType() const; - Blob + [[nodiscard]] Blob getSigningPubKey() const; - SeqProxy + [[nodiscard]] SeqProxy getSeqProxy() const; /** Returns the first non-zero value of (Sequence, TicketSequence). */ - std::uint32_t + [[nodiscard]] std::uint32_t getSeqValue() const; - AccountID - getFeePayer() const; - - boost::container::flat_set + [[nodiscard]] boost::container::flat_set getMentionedAccounts() const; - uint256 + [[nodiscard]] uint256 getTransactionID() const; - json::Value + [[nodiscard]] json::Value getJson(JsonOptions options) const override; - json::Value + [[nodiscard]] json::Value getJson(JsonOptions options, bool binary) const; void @@ -108,27 +106,27 @@ public: @param rules The current ledger rules. @return `true` if valid signature. If invalid, the error message string. */ - std::expected + [[nodiscard]] std::expected checkSign(Rules const& rules) const; - std::expected + [[nodiscard]] std::expected checkBatchSign(Rules const& rules) const; // SQL Functions with metadata. static std::string const& getMetaSQLInsertReplaceHeader(); - std::string + [[nodiscard]] std::string getMetaSQL(std::uint32_t inLedger, std::string const& escapedMetaData) const; - std::string + [[nodiscard]] std::string getMetaSQL( Serializer rawTxn, std::uint32_t inLedger, TxnSql status, std::string const& escapedMetaData) const; - std::vector const& + [[nodiscard]] std::vector const& getBatchTransactionIDs() const; private: @@ -138,28 +136,31 @@ private: Will be *this more often than not. @return `true` if valid signature. If invalid, the error message string. */ - std::expected + [[nodiscard]] std::expected checkSign(Rules const& rules, STObject const& sigObject) const; - std::expected + [[nodiscard]] std::expected checkSingleSign(STObject const& sigObject) const; - std::expected + [[nodiscard]] std::expected checkMultiSign(Rules const& rules, STObject const& sigObject) const; - std::expected + [[nodiscard]] std::expected checkBatchSingleSign(STObject const& batchSigner) const; - std::expected + [[nodiscard]] std::expected checkBatchMultiSign(STObject const& batchSigner, Rules const& rules) const; + void + buildBatchTxnIds(); + STBase* copy(std::size_t n, void* buf) const override; STBase* move(std::size_t n, void* buf) override; friend class detail::STVar; - mutable std::vector batchTxnIds_; + std::optional> batchTxnIds_; }; bool diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index 84c344ea76..4ee084e714 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -175,6 +175,8 @@ enum TEFcodes : TERUnderlyingType { tefNO_TICKET, tefNFTOKEN_IS_NOT_TRANSFERABLE, tefINVALID_LEDGER_FIX_TYPE, + tefNO_DST_PARTIAL, + tefBAD_PATH_COUNT, }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index 3c808d960b..a1911761bb 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -14,13 +14,14 @@ // Add new amendments to the top of this list. // Keep it sorted in reverse chronological order. -XRPL_FEATURE(LendingProtocolV1_1, Supported::No, VoteBehavior::DefaultNo) -XRPL_FEATURE(ConfidentialTransfer, Supported::No, VoteBehavior::DefaultNo) + +XRPL_FEATURE(BatchV1_1, Supported::No, VoteBehavior::DefaultNo) +XRPL_FEATURE(LendingProtocolV1_1, Supported::No, VoteBehavior::DefaultNo) +XRPL_FEATURE(ConfidentialTransfer, Supported::No, VoteBehavior::DefaultNo) XRPL_FIX (Cleanup3_3_0, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (Cleanup3_2_0, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FEATURE(MPTokensV2, Supported::No, VoteBehavior::DefaultNo) XRPL_FIX (Cleanup3_1_3, Supported::Yes, VoteBehavior::DefaultYes) -XRPL_FIX (BatchInnerSigs, Supported::No, VoteBehavior::DefaultNo) XRPL_FEATURE(LendingProtocol, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionDelegationV1_1, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (DirectoryLimit, Supported::Yes, VoteBehavior::DefaultNo) @@ -34,7 +35,6 @@ XRPL_FEATURE(TokenEscrow, Supported::Yes, VoteBehavior::DefaultN XRPL_FIX (EnforceNFTokenTrustlineV2, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMv1_3, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionedDEX, Supported::Yes, VoteBehavior::DefaultNo) -XRPL_FEATURE(Batch, Supported::No, VoteBehavior::DefaultNo) XRPL_FEATURE(SingleAssetVault, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (PayChanCancelAfter, Supported::Yes, VoteBehavior::DefaultNo) // Check flags in Credential transactions diff --git a/include/xrpl/protocol/detail/transactions.macro b/include/xrpl/protocol/detail/transactions.macro index b46fca92b6..b0c4f66bae 100644 --- a/include/xrpl/protocol/detail/transactions.macro +++ b/include/xrpl/protocol/detail/transactions.macro @@ -940,7 +940,7 @@ TRANSACTION(ttVAULT_CLAWBACK, 70, VaultClawback, #endif TRANSACTION(ttBATCH, 71, Batch, Delegation::NotDelegable, - featureBatch, + featureBatchV1_1, NoPriv, ({ {sfRawTransactions, SoeRequired}, diff --git a/include/xrpl/protocol_autogen/transactions/Batch.h b/include/xrpl/protocol_autogen/transactions/Batch.h index 55b99d0eef..00f553ada7 100644 --- a/include/xrpl/protocol_autogen/transactions/Batch.h +++ b/include/xrpl/protocol_autogen/transactions/Batch.h @@ -20,7 +20,7 @@ class BatchBuilder; * * Type: ttBATCH (71) * Delegable: Delegation::NotDelegable - * Amendment: featureBatch + * Amendment: featureBatchV1_1 * Privileges: NoPriv * * Immutable wrapper around STTx providing type-safe field access. diff --git a/include/xrpl/tx/ApplyContext.h b/include/xrpl/tx/ApplyContext.h index 8540037601..c98b3f82c5 100644 --- a/include/xrpl/tx/ApplyContext.h +++ b/include/xrpl/tx/ApplyContext.h @@ -24,6 +24,10 @@ public: ApplyFlags flags, beast::Journal journal = beast::Journal{beast::Journal::getNullSink()}); + // Convenience constructor used only by tests that build an ApplyContext + // directly (e.g. invariant checks). Production always uses the parentBatchId + // constructor above; this one fixes parentBatchId to std::nullopt and so is + // never valid for a batch inner (hence the TapBatch assert). explicit ApplyContext( ServiceRegistry& registry, OpenView& base, @@ -124,7 +128,7 @@ private: ApplyFlags flags_; std::optional view_; - // The ID of the batch transaction we are executing under, if seated. + // The ID of the batch transaction we are executing under, if set. std::optional parentBatchId_; }; diff --git a/include/xrpl/tx/Transactor.h b/include/xrpl/tx/Transactor.h index 02fedfe970..2b50cfa6e7 100644 --- a/include/xrpl/tx/Transactor.h +++ b/include/xrpl/tx/Transactor.h @@ -180,9 +180,6 @@ public: static NotTEC checkSign(PreclaimContext const& ctx); - static NotTEC - checkBatchSign(PreclaimContext const& ctx); - // Returns the fee in fee units, not scaled for load. static XRPAmount calculateBaseFee(ReadView const& view, STTx const& tx); @@ -373,7 +370,12 @@ protected: std::optional const& parentBatchId, AccountID const& idAccount, STObject const& sigObject, - beast::Journal const j); + beast::Journal const j, + // A batch may carry an inner from an account that an earlier inner + // creates, so the signer account need not exist yet; when it does not, + // only its own master key may authorize it. Normal transactions require + // the account to already exist. + bool permitUncreatedAccount = false); // Base class always returns true static bool @@ -413,25 +415,8 @@ protected: std::optional value, unit::ValueUnit min = unit::ValueUnit{}); -private: - static NotTEC - checkPermission( - ReadView const& view, - STTx const& tx, - std::unordered_set& heldGranularPermissions); - - std::pair - reset(XRPAmount fee); - - TER - consumeSeqProxy(SLE::pointer const& sleAccount); - - TER - payFee(); - - std::tuple - processPersistentChanges(TER result, XRPAmount fee); - + // Signature-authorization helpers. protected so the Batch transactor can + // reuse them when validating each BatchSigner in Batch::checkBatchSign. static NotTEC checkSingleSign( ReadView const& view, @@ -448,6 +433,24 @@ private: STObject const& sigObject, beast::Journal const j); +private: + static NotTEC + checkPermission( + ReadView const& view, + STTx const& tx, + std::unordered_set& heldGranularPermissions); + + std::pair + reset(XRPAmount fee); + + TER + consumeSeqProxy(SLE::pointer const& sleAccount); + TER + payFee(); + + std::tuple + processPersistentChanges(TER result, XRPAmount fee); + void trapTransaction(uint256) const; /** Performs early sanity checks on the account and fee fields. diff --git a/include/xrpl/tx/transactors/system/Batch.h b/include/xrpl/tx/transactors/system/Batch.h index 43f0103319..927a5b27cd 100644 --- a/include/xrpl/tx/transactors/system/Batch.h +++ b/include/xrpl/tx/transactors/system/Batch.h @@ -1,7 +1,5 @@ #pragma once -#include -#include #include namespace xrpl { @@ -61,6 +59,12 @@ public: ttLOAN_MANAGE, ttLOAN_PAY, }); + +private: + // Skips signature verification for inner txns, so keep it private: it must + // only be reached through Batch::checkSign. + static NotTEC + checkBatchSign(PreclaimContext const& ctx); }; } // namespace xrpl diff --git a/src/libxrpl/protocol/STObject.cpp b/src/libxrpl/protocol/STObject.cpp index e16cbc871f..445da16828 100644 --- a/src/libxrpl/protocol/STObject.cpp +++ b/src/libxrpl/protocol/STObject.cpp @@ -635,6 +635,20 @@ STObject::getAccountID(SField const& field) const return getFieldByValue(field); } +AccountID +STObject::getFeePayer() const +{ + // If sfDelegate is present, the delegate account is the payer + // note: if a delegate is specified, its authorization to act on behalf of the account is + // enforced in `Transactor::invokeCheckPermission` + // cryptographic signature validity is checked separately (e.g., in `Transactor::checkSign`) + if (isFieldPresent(sfDelegate)) + return getAccountID(sfDelegate); + + // Default payer + return getAccountID(sfAccount); +} + Blob STObject::getFieldVL(SField const& field) const { diff --git a/src/libxrpl/protocol/STTx.cpp b/src/libxrpl/protocol/STTx.cpp index be3b1a082f..cd2da12316 100644 --- a/src/libxrpl/protocol/STTx.cpp +++ b/src/libxrpl/protocol/STTx.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include #include @@ -72,6 +71,7 @@ STTx::STTx(STObject&& object) : STObject(std::move(object)) txType_ = safeCast(getFieldU16(sfTransactionType)); applyTemplate(getTxFormat(txType_)->getSOTemplate()); // may throw tid_ = getHash(HashPrefix::TransactionId); + buildBatchTxnIds(); } STTx::STTx(SerialIter& sit) : STObject(sfTransaction) @@ -88,6 +88,7 @@ STTx::STTx(SerialIter& sit) : STObject(sfTransaction) applyTemplate(getTxFormat(txType_)->getSOTemplate()); // May throw tid_ = getHash(HashPrefix::TransactionId); + buildBatchTxnIds(); } STTx::STTx(TxType type, std::function assembler) : STObject(sfTransaction) @@ -105,6 +106,7 @@ STTx::STTx(TxType type, std::function assembler) : STObject(sfT logicError("Transaction type was mutated during assembly"); tid_ = getHash(HashPrefix::TransactionId); + buildBatchTxnIds(); } STBase* @@ -212,20 +214,6 @@ STTx::getSeqValue() const return getSeqProxy().value(); } -AccountID -STTx::getFeePayer() const -{ - // If sfDelegate is present, the delegate account is the payer - // note: if a delegate is specified, its authorization to act on behalf of the account is - // enforced in `Transactor::invokeCheckPermission` - // cryptographic signature validity is checked separately (e.g., in `Transactor::checkSign`) - if (isFieldPresent(sfDelegate)) - return getAccountID(sfDelegate); - - // Default payer - return getAccountID(sfAccount); -} - void STTx::sign( PublicKey const& publicKey, @@ -279,6 +267,17 @@ STTx::checkSign(Rules const& rules) const if (auto const ret = checkSign(rules, counterSig); !ret) return std::unexpected("Counterparty: " + ret.error()); } + + // Verify the batch signer signatures here too, so they are cached with the + // rest of signature checking (checkValidity / SF_SIGGOOD) and stay out of + // the transaction engine. Gated on a batch (batchTxnIds_ seated) that + // actually carries signers; a batch whose inners are all from the outer + // account has no sfBatchSigners and needs no signer crypto. + if (batchTxnIds_ && isFieldPresent(sfBatchSigners)) + { + if (auto const ret = checkBatchSign(rules); !ret) + return ret; + } return {}; } @@ -287,12 +286,15 @@ STTx::checkBatchSign(Rules const& rules) const { try { - XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::checkBatchSign : not a batch transaction"); if (getTxnType() != ttBATCH) { - JLOG(debugLog().fatal()) << "not a batch transaction"; + // LCOV_EXCL_START + UNREACHABLE("STTx::checkBatchSign : not a batch transaction"); return std::unexpected("Not a batch transaction."); + // LCOV_EXCL_STOP } + if (!isFieldPresent(sfBatchSigners)) + return std::unexpected("Missing BatchSigners field."); // LCOV_EXCL_LINE STArray const& signers{getFieldArray(sfBatchSigners)}; for (auto const& signer : signers) { @@ -307,9 +309,10 @@ STTx::checkBatchSign(Rules const& rules) const } catch (std::exception const& e) { - JLOG(debugLog().error()) << "Batch signature check failed: " << e.what(); + // LCOV_EXCL_START + return std::unexpected(std::string("Internal batch signature check failure: ") + e.what()); + // LCOV_EXCL_STOP } - return std::unexpected("Internal batch signature check failure."); } json::Value @@ -429,8 +432,11 @@ STTx::checkSingleSign(STObject const& sigObject) const std::expected STTx::checkBatchSingleSign(STObject const& batchSigner) const { + XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::checkBatchSingleSign : batch transaction"); Serializer msg; - serializeBatch(msg, getFlags(), getBatchTransactionIDs()); + serializeBatch( + msg, getAccountID(sfAccount), getSeqValue(), getFlags(), getBatchTransactionIDs()); + finishMultiSigningData(batchSigner.getAccountID(sfAccount), msg); return singleSignHelper(batchSigner, msg.slice()); } @@ -504,7 +510,7 @@ multiSignHelper( { return std::unexpected( std::string("Invalid signature on account ") + toBase58(accountID) + - errorWhat.value_or("") + "."); + (errorWhat ? ": " + *errorWhat : "") + "."); } } // All signatures verified. @@ -514,14 +520,18 @@ multiSignHelper( std::expected STTx::checkBatchMultiSign(STObject const& batchSigner, Rules const& rules) const { + XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::checkBatchMultiSign : batch transaction"); // We can ease the computational load inside the loop a bit by // pre-constructing part of the data that we hash. Fill a Serializer // with the stuff that stays constant from signature to signature. + auto const batchSignerAccount = batchSigner.getAccountID(sfAccount); Serializer dataStart; - serializeBatch(dataStart, getFlags(), getBatchTransactionIDs()); + serializeBatch( + dataStart, getAccountID(sfAccount), getSeqValue(), getFlags(), getBatchTransactionIDs()); + dataStart.addBitString(batchSignerAccount); return multiSignHelper( batchSigner, - std::nullopt, + batchSignerAccount, [&dataStart](AccountID const& accountID) -> Serializer { Serializer s = dataStart; finishMultiSigningData(accountID, s); @@ -555,42 +565,38 @@ STTx::checkMultiSign(Rules const& rules, STObject const& sigObject) const rules); } -/** - * @brief Retrieves a batch of transaction IDs from the STTx. - * - * This function returns a vector of transaction IDs by extracting them from - * the field array `sfRawTransactions` within the STTx. If the batch - * transaction IDs have already been computed and cached in `batchTxnIds_`, - * it returns the cached vector. Otherwise, it computes the transaction IDs, - * caches them, and then returns the vector. - * - * @return A vector of `uint256` containing the batch transaction IDs. - * - * @note The function asserts that the `sfRawTransactions` field array is not - * empty and that the size of the computed batch transaction IDs matches the - * size of the `sfRawTransactions` field array. - */ +void +STTx::buildBatchTxnIds() +{ + // Precondition: the template must have been applied first, so the fields + // (including sfRawTransactions) are canonical before the inner txns are + // hashed. The constructors call this immediately after applying the + // template; isFree() being false confirms a template is set. + XRPL_ASSERT(!isFree(), "STTx::buildBatchTxnIds : template applied"); + if (getTxnType() != ttBATCH || !isFieldPresent(sfRawTransactions)) + return; + + auto const& raw = getFieldArray(sfRawTransactions); + + // Seated for any batch with raw transactions. The count is validated in + // preflight and at the relay boundary, so build every id here; this keeps + // the invariant batchTxnIds_->size() == rawTransactions.size(). + auto& ids = batchTxnIds_.emplace(); + ids.reserve(raw.size()); + for (STObject const& rb : raw) + ids.push_back(rb.getHash(HashPrefix::TransactionId)); +} + std::vector const& STTx::getBatchTransactionIDs() const { - XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::getBatchTransactionIDs : not a batch transaction"); + XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::getBatchTransactionIDs : batch transaction"); XRPL_ASSERT( - !getFieldArray(sfRawTransactions).empty(), - "STTx::getBatchTransactionIDs : empty raw transactions"); - - // The list of inner ids is built once, then reused on subsequent calls. - // After the list is built, it must always have the same size as the array - // `sfRawTransactions`. The assert below verifies that. - if (batchTxnIds_.empty()) - { - for (STObject const& rb : getFieldArray(sfRawTransactions)) - batchTxnIds_.push_back(rb.getHash(HashPrefix::TransactionId)); - } - + batchTxnIds_.has_value(), "STTx::getBatchTransactionIDs : batch transaction IDs built"); XRPL_ASSERT( - batchTxnIds_.size() == getFieldArray(sfRawTransactions).size(), + batchTxnIds_->size() == getFieldArray(sfRawTransactions).size(), "STTx::getBatchTransactionIDs : batch transaction IDs size mismatch"); - return batchTxnIds_; + return *batchTxnIds_; } //------------------------------------------------------------------------------ @@ -727,13 +733,22 @@ invalidMPTAmountInTx(STObject const& tx) } static bool -isRawTransactionOkay(STObject const& st, std::string& reason) +isBatchRawTransactionOkay(STObject const& st, std::string& reason) { if (!st.isFieldPresent(sfRawTransactions)) return true; + // sfRawTransactions only appears on a Batch. passesLocalChecks runs on + // unverified user and peer input, so reject (rather than assert) a non-batch + // transaction that carries it. + if (st.getFieldU16(sfTransactionType) != ttBATCH) + { + reason = "Only Batch transactions may contain raw transactions."; + return false; + } + if (st.isFieldPresent(sfBatchSigners) && - st.getFieldArray(sfBatchSigners).size() > kMaxBatchTxCount) + st.getFieldArray(sfBatchSigners).size() > kMaxBatchSigners) { reason = "Batch Signers array exceeds max entries."; return false; @@ -757,6 +772,12 @@ isRawTransactionOkay(STObject const& st, std::string& reason) } raw.applyTemplate(getTxFormat(tt)->getSOTemplate()); + + // passesLocalChecks recurses back into isBatchRawTransactionOkay, + // but an inner can never be a batch (rejected above), so the + // recursion terminates at depth 1. + if (!passesLocalChecks(raw, reason)) + return false; } catch (std::exception const& e) { @@ -791,7 +812,7 @@ passesLocalChecks(STObject const& st, std::string& reason) return false; } - if (!isRawTransactionOkay(st, reason)) + if (!isBatchRawTransactionOkay(st, reason)) return false; return true; diff --git a/src/libxrpl/protocol/TER.cpp b/src/libxrpl/protocol/TER.cpp index e5c1d17b1a..a6f8192a2f 100644 --- a/src/libxrpl/protocol/TER.cpp +++ b/src/libxrpl/protocol/TER.cpp @@ -130,6 +130,8 @@ transResults() MAKE_ERROR(tefNO_TICKET, "Ticket is not in ledger."), MAKE_ERROR(tefNFTOKEN_IS_NOT_TRANSFERABLE, "The specified NFToken is not transferable."), MAKE_ERROR(tefINVALID_LEDGER_FIX_TYPE, "The LedgerFixType field has an invalid value."), + MAKE_ERROR(tefNO_DST_PARTIAL, "Partial payment to create account not allowed."), + MAKE_ERROR(tefBAD_PATH_COUNT, "Malformed: Too many paths."), MAKE_ERROR(telLOCAL_ERROR, "Local failure."), MAKE_ERROR(telBAD_DOMAIN, "Domain too long."), diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index 9ab8779f03..0f6988543e 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -1,6 +1,5 @@ #include -#include #include #include #include @@ -221,13 +220,15 @@ Transactor::preflight1(PreflightContext const& ctx, std::uint32_t flagMask) if (ctx.tx.getSeqProxy().isTicket() && ctx.tx.isFieldPresent(sfAccountTxnID)) return temINVALID; - if (ctx.tx.isFlag(tfInnerBatchTxn) && !ctx.rules.enabled(featureBatch)) + if (ctx.tx.isFlag(tfInnerBatchTxn) && !ctx.rules.enabled(featureBatchV1_1)) return temINVALID_FLAG; - XRPL_ASSERT( - ctx.tx.isFlag(tfInnerBatchTxn) == ctx.parentBatchId.has_value() || - !ctx.rules.enabled(featureBatch), - "Inner batch transaction must have a parent batch ID."); + // Reject if the inner batch flag and parentBatchId are inconsistent. + // A standalone tx with tfInnerBatchTxn but no parentBatchId is an + // attack attempt. A tx with parentBatchId but without tfInnerBatchTxn + // is a programming error. + if (ctx.tx.isFlag(tfInnerBatchTxn) != ctx.parentBatchId.has_value()) + return temINVALID_INNER_BATCH; return tesSUCCESS; } @@ -243,15 +244,19 @@ Transactor::preflight2(PreflightContext const& ctx) return *ret; } - // It should be impossible for the InnerBatchTxn flag to be set without - // featureBatch being enabled - XRPL_ASSERT_PARTS( - !ctx.tx.isFlag(tfInnerBatchTxn) || ctx.rules.enabled(featureBatch), - "xrpl::Transactor::preflight2", - "InnerBatch flag only set if feature enabled"); - // Skip signature check on batch inner transactions - if (ctx.tx.isFlag(tfInnerBatchTxn) && ctx.rules.enabled(featureBatch)) + // Skip the signature check on batch inner transactions. preflight1 already + // enforces both conditions; re-checking them as defense in depth guarantees + // we never return success (and so skip signature validation) for an inner + // transaction unless the amendment is enabled and it really sits inside a + // batch. + if (ctx.tx.isFlag(tfInnerBatchTxn)) + { + if (!ctx.rules.enabled(featureBatchV1_1)) + return temINVALID_FLAG; + if (!ctx.parentBatchId.has_value()) + return temINVALID_INNER_BATCH; return tesSUCCESS; + } // Do not add any checks after this point that are relevant for // batch inner transactions. They will be skipped. @@ -708,23 +713,26 @@ Transactor::checkSign( std::optional const& parentBatchId, AccountID const& idAccount, STObject const& sigObject, - beast::Journal const j) + beast::Journal const j, + bool permitUncreatedAccount) { { auto const sle = view.read(keylet::account(idAccount)); - if (view.rules().enabled(featureLendingProtocol) && isPseudoAccount(sle)) + if ((view.rules().enabled(featureLendingProtocol) || + view.rules().enabled(featureBatchV1_1) || view.rules().enabled(fixCleanup3_3_0)) && + isPseudoAccount(sle)) { - // Pseudo-accounts can't sign transactions. This check is gated on - // the Lending Protocol amendment because that's the project it was - // added under, and it doesn't justify another amendment + // Pseudo-accounts can't sign transactions. This check is gated on a + // few different amendments so that it takes effect as soon as any of + // them is activated. return tefBAD_AUTH; } } auto const pkSigner = sigObject.getFieldVL(sfSigningPubKey); // Ignore signature check on batch inner transactions - if (parentBatchId && view.rules().enabled(featureBatch)) + if (parentBatchId && view.rules().enabled(featureBatchV1_1)) { // Defensive Check: These values are also checked in Batch::preflight if (sigObject.isFieldPresent(sfTxnSignature) || !pkSigner.empty() || @@ -762,7 +770,16 @@ Transactor::checkSign( auto const idSigner = calcAccountID(PublicKey(makeSlice(pkSigner))); auto const sleAccount = view.read(keylet::account(idAccount)); if (!sleAccount) - return terNO_ACCOUNT; + { + // An account that does not exist yet can only be authorized by its own + // master key, and only where an un-created signer is permitted (a batch + // whose earlier inner creates the account). Otherwise it cannot sign. + if (!permitUncreatedAccount) + return terNO_ACCOUNT; + if (idAccount != idSigner) + return tefBAD_AUTH; + return tesSUCCESS; + } return checkSingleSign(view, idSigner, idAccount, sleAccount, j); } @@ -775,50 +792,6 @@ Transactor::checkSign(PreclaimContext const& ctx) return checkSign(ctx.view, ctx.flags, ctx.parentBatchId, idAccount, ctx.tx, ctx.j); } -NotTEC -Transactor::checkBatchSign(PreclaimContext const& ctx) -{ - NotTEC ret = tesSUCCESS; - STArray const& signers{ctx.tx.getFieldArray(sfBatchSigners)}; - for (auto const& signer : signers) - { - auto const idAccount = signer.getAccountID(sfAccount); - - Blob const& pkSigner = signer.getFieldVL(sfSigningPubKey); - if (pkSigner.empty()) - { - if (ret = checkMultiSign(ctx.view, ctx.flags, idAccount, signer, ctx.j); - !isTesSuccess(ret)) - return ret; - } - else - { - // LCOV_EXCL_START - if (!publicKeyType(makeSlice(pkSigner))) - return tefBAD_AUTH; - // LCOV_EXCL_STOP - - auto const idSigner = calcAccountID(PublicKey(makeSlice(pkSigner))); - auto const sleAccount = ctx.view.read(keylet::account(idAccount)); - - // A batch can include transactions from an un-created account ONLY - // when the account master key is the signer - if (!sleAccount) - { - if (idAccount != idSigner) - return tefBAD_AUTH; - - return tesSUCCESS; - } - - if (ret = checkSingleSign(ctx.view, idSigner, idAccount, sleAccount, ctx.j); - !isTesSuccess(ret)) - return ret; - } - } - return ret; -} - NotTEC Transactor::checkSingleSign( ReadView const& view, @@ -1114,7 +1087,7 @@ Transactor::reset(XRPAmount fee) // balance should have already been checked in checkFee / preFlight. XRPL_ASSERT( - balance != beast::kZero && (!view().open() || balance >= fee), + (fee == beast::kZero || balance != beast::kZero) && (!view().open() || balance >= fee), "xrpl::Transactor::reset : valid balance"); // We retry/reject the transaction if the account balance is zero or diff --git a/src/libxrpl/tx/apply.cpp b/src/libxrpl/tx/apply.cpp index b70cb0d345..d85c4cfc40 100644 --- a/src/libxrpl/tx/apply.cpp +++ b/src/libxrpl/tx/apply.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -39,30 +38,14 @@ checkValidity(HashRouter& router, STTx const& tx, Rules const& rules) auto const id = tx.getTransactionID(); auto const flags = router.getFlags(id); - // Ignore signature check on batch inner transactions - if (tx.isFlag(tfInnerBatchTxn) && rules.enabled(featureBatch)) + // Batch inner transactions are never independently valid: they are applied + // within their batch, not through checkValidity. Reaching here means one was + // relayed or submitted on its own, so mark it bad regardless of the + // amendment (like PeerImp and NetworkOPs). + if (tx.isFlag(tfInnerBatchTxn)) { - // Defensive Check: These values are also checked in Batch::preflight - if (tx.isFieldPresent(sfTxnSignature) || !tx.getSigningPubKey().empty() || - tx.isFieldPresent(sfSigners)) - return {Validity::SigBad, "Malformed: Invalid inner batch transaction."}; - - // This block should probably have never been included in the - // original `Batch` implementation. An inner transaction never - // has a valid signature. - bool const neverValid = rules.enabled(fixBatchInnerSigs); - if (!neverValid) - { - std::string reason; - if (!passesLocalChecks(tx, reason)) - { - router.setFlags(id, kSfLocalbad); - return {Validity::SigGoodOnly, reason}; - } - - router.setFlags(id, kSfSiggood); - return {Validity::Valid, ""}; - } + router.setFlags(id, kSfSigbad); + return {Validity::SigBad, "Batch inner transactions are never considered validly signed."}; } if (any(flags & kSfSigbad)) @@ -183,6 +166,9 @@ applyBatchTransactions( // If the transaction should be applied push its changes to the // whole-batch view. + // NOTE: each inner tx is individually capped at kOversizeMetaDataCap; + // there is no aggregate cap here. Bounded by kMaxBatchTxCount * cap, + // which standalone txns can already produce in one ledger. if (ret.applied && (isTesSuccess(ret.ter) || isTecClaim(ret.ter))) perTxBatchView.apply(batchView); diff --git a/src/libxrpl/tx/transactors/lending/LoanSet.cpp b/src/libxrpl/tx/transactors/lending/LoanSet.cpp index 903707320b..1ac387d1b1 100644 --- a/src/libxrpl/tx/transactors/lending/LoanSet.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanSet.cpp @@ -57,7 +57,7 @@ LoanSet::preflight(PreflightContext const& ctx) auto const& tx = ctx.tx; // Special case for Batch inner transactions - if (tx.isFlag(tfInnerBatchTxn) && ctx.rules.enabled(featureBatch) && + if (tx.isFlag(tfInnerBatchTxn) && ctx.rules.enabled(featureBatchV1_1) && !tx.isFieldPresent(sfCounterparty)) { auto const parentBatchId = ctx.parentBatchId.value_or(uint256{0}); diff --git a/src/libxrpl/tx/transactors/payment/Payment.cpp b/src/libxrpl/tx/transactors/payment/Payment.cpp index 7f1e4d8079..6e3883572a 100644 --- a/src/libxrpl/tx/transactors/payment/Payment.cpp +++ b/src/libxrpl/tx/transactors/payment/Payment.cpp @@ -363,16 +363,21 @@ Payment::preclaim(PreclaimContext const& ctx) // transaction would succeed. return tecNO_DST; } - if (ctx.view.open() && partialPaymentAllowed) + // A partial payment may not fund a new account. + if (partialPaymentAllowed) { - // You cannot fund an account with a partial payment. - // Make retry work smaller, by rejecting this. - JLOG(ctx.j.trace()) << "Delay transaction: Partial payment not " - "allowed to create account."; - - // Another transaction could create the account and then this - // transaction would succeed. - return telNO_DST_PARTIAL; + // Open view: the soft tel (unchanged). + if (ctx.view.open()) + { + // Make retry work smaller, by rejecting this. + JLOG(ctx.j.trace()) << "Delay transaction: Partial payment not " + "allowed to create account."; + return telNO_DST_PARTIAL; + } + // Inner batch txns are claimed on a closed view, where a tel is + // invalid, so use the tef. + if (ctx.parentBatchId && ctx.view.rules().enabled(featureBatchV1_1)) + return tefNO_DST_PARTIAL; } if (dstAmount < STAmount(ctx.view.fees().reserve)) { @@ -400,7 +405,7 @@ Payment::preclaim(PreclaimContext const& ctx) } // Payment with at least one intermediate step and uses transitive balances. - if ((hasPaths || sendMax || !dstAmount.native()) && ctx.view.open()) + if (hasPaths || sendMax || !dstAmount.native()) { STPathSet const& paths = ctx.tx.getFieldPathSet(sfPaths); @@ -408,7 +413,12 @@ Payment::preclaim(PreclaimContext const& ctx) return path.size() > kMaxPathLength; })) { - return telBAD_PATH_COUNT; + // Open view: the soft tel (unchanged). Inner batch txns are claimed + // on a closed view, where a tel is invalid, so use the tef. + if (ctx.view.open()) + return telBAD_PATH_COUNT; + if (ctx.parentBatchId && ctx.view.rules().enabled(featureBatchV1_1)) + return tefBAD_PATH_COUNT; } } diff --git a/src/libxrpl/tx/transactors/system/Batch.cpp b/src/libxrpl/tx/transactors/system/Batch.cpp index 64a62ac273..16d27f98d9 100644 --- a/src/libxrpl/tx/transactors/system/Batch.cpp +++ b/src/libxrpl/tx/transactors/system/Batch.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include #include #include @@ -21,11 +23,13 @@ #include #include +#include #include #include #include #include #include +#include namespace xrpl { @@ -107,13 +111,13 @@ Batch::calculateBaseFee(ReadView const& view, STTx const& tx) } // Calculate the Signers/BatchSigners Fees - std::int32_t signerCount = 0; + std::uint32_t signerCount = 0; if (tx.isFieldPresent(sfBatchSigners)) { auto const& signers = tx.getFieldArray(sfBatchSigners); // LCOV_EXCL_START - if (signers.size() > kMaxBatchTxCount) + if (signers.size() > kMaxBatchSigners) { JLOG(debugLog().error()) << "BatchTrace: Batch Signers array exceeds max entries."; return XRPAmount{kInitialXrp}; @@ -128,7 +132,16 @@ Batch::calculateBaseFee(ReadView const& view, STTx const& tx) } else if (signer.isFieldPresent(sfSigners)) { - signerCount += signer.getFieldArray(sfSigners).size(); + auto const& nestedSigners = signer.getFieldArray(sfSigners); + // LCOV_EXCL_START + if (nestedSigners.size() > STTx::kMaxMultiSigners) + { + JLOG(debugLog().error()) + << "BatchTrace: Nested Signers array exceeds max entries."; + return kInitialXrp; + } + // LCOV_EXCL_STOP + signerCount += nestedSigners.size(); } } } @@ -149,7 +162,8 @@ Batch::calculateBaseFee(ReadView const& view, STTx const& tx) JLOG(debugLog().error()) << "BatchTrace: XRPAmount overflow in signerFees calculation."; return XRPAmount{kInitialXrp}; } - if (txnFees + signerFees > maxAmount - batchBase) + XRPAmount const innerFees = txnFees + signerFees; + if (innerFees > maxAmount - batchBase) { JLOG(debugLog().error()) << "BatchTrace: XRPAmount overflow in total fee calculation."; return XRPAmount{kInitialXrp}; @@ -157,7 +171,7 @@ Batch::calculateBaseFee(ReadView const& view, STTx const& tx) // LCOV_EXCL_STOP // 10 drops per batch signature + sum of inner tx fees + batchBase - return signerFees + txnFees + batchBase; + return innerFees + batchBase; } std::uint32_t @@ -227,6 +241,14 @@ Batch::preflight(PreflightContext const& ctx) return temARRAY_TOO_LARGE; } + if (ctx.tx.isFieldPresent(sfBatchSigners) && + ctx.tx.getFieldArray(sfBatchSigners).size() > kMaxBatchSigners) + { + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]:" + << "signers array exceeds " << kMaxBatchSigners << " entries."; + return temARRAY_TOO_LARGE; + } + // Validation Inner Batch Txns std::unordered_set uniqueHashes; std::unordered_map> accountSeqTicket; @@ -384,46 +406,48 @@ Batch::preflight(PreflightContext const& ctx) NotTEC Batch::preflightSigValidated(PreflightContext const& ctx) { + XRPL_ASSERT( + ctx.tx.getTxnType() == ttBATCH, "xrpl::Batch::preflightSigValidated : batch transaction"); auto const parentBatchId = ctx.tx.getTransactionID(); auto const outerAccount = ctx.tx.getAccountID(sfAccount); auto const& rawTxns = ctx.tx.getFieldArray(sfRawTransactions); - // Build the signers list - std::unordered_set requiredSigners; + // Accounts that must sign the batch: each inner authorizer and counterparty + // (excluding the outer account), sorted and de-duplicated to match against + // the ascending, unique batch signers. + std::vector requiredSigners; + requiredSigners.reserve(kMaxBatchSigners); for (STObject const& rb : rawTxns) { - auto const innerAccount = rb.getAccountID(sfAccount); + // A delegated inner is signed by the delegate, not the account holder, + // so the delegate is the required signer when present. + AccountID const authorizer = rb.getFeePayer(); - // If the inner account is the same as the outer account, do not add the - // inner account to the required signers set. - if (innerAccount != outerAccount) - requiredSigners.insert(innerAccount); + // The outer account signs the batch itself, so it is never added to the + // required signers. + if (authorizer != outerAccount) + requiredSigners.push_back(authorizer); // Some transactions have a Counterparty, who must also sign the // transaction if they are not the outer account - if (auto const counterparty = rb.at(~sfCounterparty); + if (auto const counterparty = rb[~sfCounterparty]; counterparty && counterparty != outerAccount) - requiredSigners.insert(*counterparty); + requiredSigners.push_back(*counterparty); } + std::ranges::sort(requiredSigners); + auto const dupes = std::ranges::unique(requiredSigners); + requiredSigners.erase(dupes.begin(), dupes.end()); + + std::size_t numReqSignersMatched = 0; // Validation Batch Signers - std::unordered_set batchSigners; if (ctx.tx.isFieldPresent(sfBatchSigners)) { STArray const& signers = ctx.tx.getFieldArray(sfBatchSigners); - // Check that the batch signers array is not too large. - if (signers.size() > kMaxBatchTxCount) - { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " - << "signers array exceeds 8 entries."; - return temARRAY_TOO_LARGE; - } - - // Add batch signers to the set to ensure all signer accounts are - // unique. Meanwhile, remove signer accounts from the set of inner - // transaction accounts (`requiredSigners`). By the end of the loop, - // `requiredSigners` should be empty, indicating that all inner - // accounts are matched with signers. + // Batch signers must be strictly ascending and match the required + // signers exactly; since both are sorted, each must be the next + // required signer. + AccountID lastBatchSigner{beast::kZero}; for (auto const& signer : signers) { AccountID const signerAccount = signer.getAccountID(sfAccount); @@ -434,40 +458,66 @@ Batch::preflightSigValidated(PreflightContext const& ctx) return temBAD_SIGNER; } - if (!batchSigners.insert(signerAccount).second) + if (lastBatchSigner == signerAccount) { JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " << "duplicate signer found: " << signerAccount; - return temREDUNDANT; - } - - // Check that the batch signer is in the required signers set. - // Remove it if it does, as it can be crossed off the list. - if (requiredSigners.erase(signerAccount) == 0) - { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " - << "no account signature for inner txn."; return temBAD_SIGNER; } - } - // Check the batch signers signatures. - auto const sigResult = ctx.tx.checkBatchSign(ctx.rules); + if (lastBatchSigner > signerAccount) + { + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "unsorted signers array: " << signerAccount; + return temBAD_SIGNER; + } + lastBatchSigner = signerAccount; - if (!sigResult) - { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " - << "invalid batch txn signature: " << sigResult.error(); - return temBAD_SIGNATURE; + if (numReqSignersMatched >= requiredSigners.size() || + requiredSigners[numReqSignersMatched] != signerAccount) + { + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "missing signer or extra signer provided: " << signerAccount; + return temBAD_SIGNER; + } + ++numReqSignersMatched; } } - if (!requiredSigners.empty()) + // Every required signer must be matched. Also covers sfBatchSigners being + // absent while inner txns require signers (numReqSignersMatched stays 0). + if (numReqSignersMatched != requiredSigners.size()) { JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " << "invalid batch signers."; return temBAD_SIGNER; } + + return tesSUCCESS; +} + +NotTEC +Batch::checkBatchSign(PreclaimContext const& ctx) +{ + STArray const& signers{ctx.tx.getFieldArray(sfBatchSigners)}; + for (auto const& signer : signers) + { + // Reuse the standard signer-authorization rules so the batch and + // non-batch paths cannot drift. permitUncreatedAccount allows an inner + // from an account that an earlier inner creates, which must be + // authorized by its own master key. + auto const idAccount = signer.getAccountID(sfAccount); + if (auto const ret = Transactor::checkSign( + ctx.view, + ctx.flags, + ctx.parentBatchId, + idAccount, + signer, + ctx.j, + /*permitUncreatedAccount=*/true); + !isTesSuccess(ret)) + return ret; + } return tesSUCCESS; } @@ -479,7 +529,7 @@ Batch::preflightSigValidated(PreflightContext const& ctx) * corresponding error code. * * Next, it verifies the batch-specific signature requirements by calling - * Transactor::checkBatchSign. If this check fails, it also returns the + * Batch::checkBatchSign. If this check fails, it also returns the * corresponding error code. * * If both checks succeed, the function returns tesSUCCESS. @@ -494,8 +544,11 @@ Batch::checkSign(PreclaimContext const& ctx) if (auto ret = Transactor::checkSign(ctx); !isTesSuccess(ret)) return ret; - if (auto ret = Transactor::checkBatchSign(ctx); !isTesSuccess(ret)) - return ret; + if (ctx.tx.isFieldPresent(sfBatchSigners)) + { + if (auto ret = checkBatchSign(ctx); !isTesSuccess(ret)) + return ret; + } return tesSUCCESS; } diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index 6aaae62155..f9c156fe06 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -47,12 +48,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -61,15 +64,17 @@ #include #include #include +#include #include +#include #include #include +#include #include #include #include #include -#include #include #include #include @@ -200,16 +205,13 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - bool const withInnerSigFix = features[fixBatchInnerSigs]; - for (bool const withBatch : {true, false}) { - testcase << "enabled: Batch " << (withBatch ? "enabled" : "disabled") - << ", Inner Sig Fix: " << (withInnerSigFix ? "enabled" : "disabled"); + testcase << "enabled: Batch " << (withBatch ? "enabled" : "disabled"); - auto const amend = withBatch ? features : features - featureBatch; + auto const amend = withBatch ? features : features - featureBatchV1_1; - test::jtx::Env env{*this, amend}; + Env env{*this, amend}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -230,12 +232,10 @@ class Batch_test : public beast::unit_test::Suite } // tfInnerBatchTxn - // If the feature is disabled, the transaction fails with - // temINVALID_FLAG. If the feature is enabled, the transaction fails - // early in checkValidity() + // A standalone transaction carrying this flag is never valid, so it + // is rejected early in checkValidity() regardless of the amendment. { - auto const txResult = withBatch ? Ter(telENV_RPC_FAILED) : Ter(temINVALID_FLAG); - env(pay(alice, bob, XRP(1)), Txflags(tfInnerBatchTxn), txResult); + env(pay(alice, bob, XRP(1)), Txflags(tfInnerBatchTxn), Ter(telENV_RPC_FAILED)); env.close(); } @@ -254,7 +254,7 @@ class Batch_test : public beast::unit_test::Suite //---------------------------------------------------------------------- // preflight - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -431,6 +431,41 @@ class Batch_test : public beast::unit_test::Suite env.close(); } + // temINVALID_INNER_BATCH: tfInnerBatchTxn set but no parentBatchId. + { + auto jtx = env.jt(pay(alice, bob, XRP(1)), Txflags(tfInnerBatchTxn)); + PreflightContext const pfCtx( + env.app(), *jtx.stx, env.current()->rules(), TapNone, env.journal); + auto const pf = Transactor::invokePreflight(pfCtx); + BEAST_EXPECT(pf == temINVALID_INNER_BATCH); + } + + // temINVALID_FLAG: tfInnerBatchTxn set but featureBatchV1_1 disabled. + { + Env disabledEnv{*this, features - featureBatchV1_1}; + disabledEnv.fund(XRP(10000), alice, bob); + disabledEnv.close(); + auto jtx = disabledEnv.jt(pay(alice, bob, XRP(1)), Txflags(tfInnerBatchTxn)); + PreflightContext const pfCtx( + disabledEnv.app(), + *jtx.stx, + disabledEnv.current()->rules(), + TapNone, + disabledEnv.journal); + auto const pf = Transactor::invokePreflight(pfCtx); + BEAST_EXPECT(pf == temINVALID_FLAG); + } + + // temINVALID_INNER_BATCH: parentBatchId set but tfInnerBatchTxn not + // set. + { + auto jtx = env.jt(pay(alice, bob, XRP(1))); + PreflightContext const pfCtx( + env.app(), *jtx.stx, uint256{1}, env.current()->rules(), TapBatch, env.journal); + auto const pf = Transactor::invokePreflight(pfCtx); + BEAST_EXPECT(pf == temINVALID_INNER_BATCH); + } + // temBAD_FEE: Batch: inner txn must have a fee of 0. { auto const seq = env.seq(alice); @@ -537,16 +572,16 @@ class Batch_test : public beast::unit_test::Suite env.close(); } - // DEFENSIVE: temARRAY_TOO_LARGE: Batch: signers array exceeds 8 - // entries. + // DEFENSIVE: temARRAY_TOO_LARGE: Batch: signers array exceeds + // kMaxBatchSigners entries. // ACTUAL: telENV_RPC_FAILED: isRawTransactionOkay() { auto const seq = env.seq(alice); - auto const batchFee = batch::calcBatchFee(env, 9, 2); + auto const batchFee = batch::calcBatchFee(env, kMaxBatchSigners + 1, 2); env(batch::outer(alice, seq, batchFee, tfAllOrNothing), batch::Inner(pay(alice, bob, XRP(10)), seq + 1), batch::Inner(pay(alice, bob, XRP(5)), seq + 2), - batch::Sig(bob, carol, alice, bob, carol, alice, bob, carol, alice, alice), + batch::Sig(std::vector(kMaxBatchSigners + 1, bob)), Ter(telENV_RPC_FAILED)); env.close(); } @@ -563,7 +598,7 @@ class Batch_test : public beast::unit_test::Suite env.close(); } - // temREDUNDANT: Batch: duplicate signer found + // temBAD_SIGNER: Batch: duplicate signer (caught by ascending order check) { auto const seq = env.seq(alice); auto const batchFee = batch::calcBatchFee(env, 2, 2); @@ -571,7 +606,7 @@ class Batch_test : public beast::unit_test::Suite batch::Inner(pay(alice, bob, XRP(10)), seq + 1), batch::Inner(pay(bob, alice, XRP(5)), env.seq(bob)), batch::Sig(bob, bob), - Ter(temREDUNDANT)); + Ter(temBAD_SIGNER)); env.close(); } @@ -611,7 +646,13 @@ class Batch_test : public beast::unit_test::Suite batch::Inner(pay(bob, alice, XRP(5)), bobSeq)); Serializer msg; - serializeBatch(msg, tfAllOrNothing, jt.stx->getBatchTransactionIDs()); + serializeBatch( + msg, + jt.stx->getAccountID(sfAccount), + jt.stx->getSeqValue(), + tfAllOrNothing, + jt.stx->getBatchTransactionIDs()); + finishMultiSigningData(bob.id(), msg); auto const sig = xrpl::sign(bob.pk(), bob.sk(), msg.slice()); jt.jv[sfBatchSigners.jsonName][0u][sfBatchSigner.jsonName][sfAccount.jsonName] = bob.human(); @@ -620,7 +661,7 @@ class Batch_test : public beast::unit_test::Suite jt.jv[sfBatchSigners.jsonName][0u][sfBatchSigner.jsonName][sfTxnSignature.jsonName] = strHex(Slice{sig.data(), sig.size()}); - env(jt.jv, Ter(temBAD_SIGNATURE)); + env(jt.jv, Ter(telENV_RPC_FAILED)); env.close(); } @@ -649,7 +690,7 @@ class Batch_test : public beast::unit_test::Suite //---------------------------------------------------------------------- // preclaim - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -890,7 +931,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -971,6 +1012,46 @@ class Batch_test : public beast::unit_test::Suite env(jt.jv, batch::Sig(bob), Ter(telENV_RPC_FAILED)); env.close(); } + + // Inner OfferCreate with MPT TakerPays. Valid under featureMPTokensV2. + { + MPTIssue const issue(makeMptID(1, alice)); + STAmount const mptAmt{issue, UINT64_C(100)}; + + auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const seq = env.seq(alice); + + json::Value tx1; + tx1[jss::TransactionType] = jss::OfferCreate; + tx1[jss::Account] = alice.human(); + tx1[jss::TakerPays] = mptAmt.getJson(JsonOptions::Values::None); + tx1[jss::TakerGets] = XRP(10).value().getJson(JsonOptions::Values::None); + + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(tx1, seq + 1), + batch::Inner(pay(alice, bob, XRP(1)), seq + 2), + Ter(tesSUCCESS)); + env.close(); + } + + // Invalid: inner txn with invalid memo (non-URL-safe MemoType) + { + auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const seq = env.seq(alice); + + auto tx1 = pay(alice, bob, XRP(10)); + auto& ma = tx1["Memos"]; + auto& mi = ma[ma.size()]; + auto& m = mi["Memo"]; + m["MemoType"] = strHex(std::string("\x01\x02\x03", 3)); + m["MemoData"] = strHex(std::string("test")); + + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(tx1, seq + 1), + batch::Inner(pay(alice, bob, XRP(1)), seq + 2), + Ter(telENV_RPC_FAILED)); + env.close(); + } } void @@ -981,7 +1062,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1239,7 +1320,7 @@ class Batch_test : public beast::unit_test::Suite // Bad Fee Without Signer { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1261,7 +1342,7 @@ class Batch_test : public beast::unit_test::Suite // Bad Fee With MultiSign { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1288,7 +1369,7 @@ class Batch_test : public beast::unit_test::Suite // Bad Fee With MultiSign + BatchSigners { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1317,7 +1398,7 @@ class Batch_test : public beast::unit_test::Suite // Bad Fee With MultiSign + BatchSigners.Signers { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1349,7 +1430,7 @@ class Batch_test : public beast::unit_test::Suite // Bad Fee With BatchSigners { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1373,7 +1454,7 @@ class Batch_test : public beast::unit_test::Suite // Bad Fee Dynamic Fee Calculation { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1412,7 +1493,7 @@ class Batch_test : public beast::unit_test::Suite // telENV_RPC_FAILED: Batch: txns array exceeds 8 entries. { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1437,7 +1518,7 @@ class Batch_test : public beast::unit_test::Suite // temARRAY_TOO_LARGE: Batch: txns array exceeds 8 entries. { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1465,41 +1546,52 @@ class Batch_test : public beast::unit_test::Suite }); } - // telENV_RPC_FAILED: Batch: signers array exceeds 8 entries. + // Regression: the relay-boundary local check (isBatchRawTransactionOkay) + // caps the signers array at kMaxBatchSigners, matching Batch::preflight - + // not kMaxBatchTxCount. A batch with more than kMaxBatchTxCount but at + // most kMaxBatchSigners signers must get past local checks and reach + // signer validation. Before the cap was aligned it was wrongly rejected + // at the boundary (telENV_RPC_FAILED) before preflight ran; now it + // reaches preflightSigValidated and fails there as extra signers + // (temBAD_SIGNER) rather than being dropped pre-engine. { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); env.fund(XRP(10000), alice, bob); env.close(); + // Over kMaxBatchTxCount (8) but within kMaxBatchSigners (24). + std::size_t const signerCount = kMaxBatchTxCount + 1; + auto const aliceSeq = env.seq(alice); - auto const batchFee = batch::calcBatchFee(env, 9, 2); + auto const batchFee = batch::calcBatchFee(env, signerCount, 2); env(batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 1), batch::Inner(pay(alice, bob, XRP(5)), aliceSeq + 2), - batch::Sig(bob, bob, bob, bob, bob, bob, bob, bob, bob, bob), - Ter(telENV_RPC_FAILED)); + batch::Sig(std::vector(signerCount, bob)), + Ter(temBAD_SIGNER)); env.close(); } - // temARRAY_TOO_LARGE: Batch: signers array exceeds 8 entries. + // temARRAY_TOO_LARGE: Batch preflight: signers array exceeds + // kMaxBatchSigners entries. { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); env.fund(XRP(10000), alice, bob); env.close(); - auto const batchFee = batch::calcBatchFee(env, 0, 9); + auto const batchFee = batch::calcBatchFee(env, kMaxBatchSigners + 1, 2); auto const aliceSeq = env.seq(alice); auto jt = env.jtnofill( batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 1), batch::Inner(pay(alice, bob, XRP(5)), aliceSeq + 2), - batch::Sig(bob, bob, bob, bob, bob, bob, bob, bob, bob, bob)); + batch::Sig(std::vector(kMaxBatchSigners + 1, bob))); env.app().getOpenLedger().modify([&](OpenView& view, beast::Journal j) { auto const result = xrpl::apply(env.app(), view, *jt.stx, TapNone, j); @@ -1517,7 +1609,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1677,7 +1769,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -1966,7 +2058,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -2267,7 +2359,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -2538,22 +2630,16 @@ class Batch_test : public beast::unit_test::Suite void doTestInnerSubmitRPC(FeatureBitset features, bool withBatch) { - bool const withInnerSigFix = features[fixBatchInnerSigs]; + std::string const testName = + std::string("inner submit rpc: batch ") + (withBatch ? "enabled" : "disabled") + ": "; - std::string const testName = [&]() { - std::stringstream ss; - ss << "inner submit rpc: batch " << (withBatch ? "enabled" : "disabled") - << ", inner sig fix: " << (withInnerSigFix ? "enabled" : "disabled") << ": "; - return ss.str(); - }(); - - auto const amend = withBatch ? features : features - featureBatch; + auto const amend = withBatch ? features : features - featureBatchV1_1; using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, amend}; - if (!BEAST_EXPECT(amend[featureBatch] == withBatch)) + Env env{*this, amend}; + if (!BEAST_EXPECT(amend[featureBatchV1_1] == withBatch)) return; auto const alice = Account("alice"); @@ -2562,37 +2648,20 @@ class Batch_test : public beast::unit_test::Suite env.fund(XRP(10000), alice, bob); env.close(); - auto submitAndValidate = [&](std::string caseName, - Slice const& slice, - int line, - std::optional expectedEnabled = std::nullopt, - std::optional expectedDisabled = std::nullopt, - bool expectInvalidFlag = false) { - testcase << testName << caseName - << (expectInvalidFlag ? " - Expected to reach tx engine!" : ""); + // Any transaction carrying tfInnerBatchTxn is rejected in checkValidity() + // before it reaches the tx engine, regardless of its signing fields or + // whether the amendment is enabled. + auto submitAndValidate = [&](std::string caseName, Slice const& slice, int line) { + testcase << testName << caseName; auto const jrr = env.rpc("submit", strHex(slice))[jss::result]; - auto const expected = withBatch - ? expectedEnabled.value_or( - "fails local checks: Malformed: Invalid inner batch " - "transaction.") - : expectedDisabled.value_or("fails local checks: Empty SigningPubKey."); - if (expectInvalidFlag) - { - expect( - jrr[jss::status] == "success" && jrr[jss::engine_result] == "temINVALID_FLAG", - pretty(jrr), - __FILE__, - line); - } - else - { - expect( - jrr[jss::status] == "error" && jrr[jss::error] == "invalidTransaction" && - jrr[jss::error_exception] == expected, - pretty(jrr), - __FILE__, - line); - } + expect( + jrr[jss::status] == "error" && jrr[jss::error] == "invalidTransaction" && + jrr[jss::error_exception] == + "fails local checks: Batch inner transactions are never " + "considered validly signed.", + pretty(jrr), + __FILE__, + line); env.close(); }; @@ -2621,12 +2690,7 @@ class Batch_test : public beast::unit_test::Suite STParsedJSONObject parsed("test", txn.getTxn()); Serializer s; parsed.object->add(s); // NOLINT(bugprone-unchecked-optional-access) - submitAndValidate( - "SigningPubKey set", - s.slice(), - __LINE__, - std::nullopt, - "fails local checks: Invalid signature."); + submitAndValidate("SigningPubKey set", s.slice(), __LINE__); } // Invalid RPC Submission: Signers @@ -2640,12 +2704,7 @@ class Batch_test : public beast::unit_test::Suite STParsedJSONObject parsed("test", txn.getTxn()); Serializer s; parsed.object->add(s); // NOLINT(bugprone-unchecked-optional-access) - submitAndValidate( - "Signers set", - s.slice(), - __LINE__, - std::nullopt, - "fails local checks: Invalid Signers array size."); + submitAndValidate("Signers set", s.slice(), __LINE__); } { @@ -2656,8 +2715,7 @@ class Batch_test : public beast::unit_test::Suite STParsedJSONObject parsed("test", jt.jv); Serializer s; parsed.object->add(s); // NOLINT(bugprone-unchecked-optional-access) - submitAndValidate( - "Fully signed", s.slice(), __LINE__, std::nullopt, std::nullopt, !withBatch); + submitAndValidate("Fully signed", s.slice(), __LINE__); } // Invalid RPC Submission: tfInnerBatchTxn @@ -2670,13 +2728,7 @@ class Batch_test : public beast::unit_test::Suite STParsedJSONObject parsed("test", txn.getTxn()); Serializer s; parsed.object->add(s); // NOLINT(bugprone-unchecked-optional-access) - submitAndValidate( - "No signing fields set", - s.slice(), - __LINE__, - "fails local checks: Empty SigningPubKey.", - "fails local checks: Empty SigningPubKey.", - withBatch && !withInnerSigFix); + submitAndValidate("No signing fields set", s.slice(), __LINE__); } // Invalid RPC Submission: tfInnerBatchTxn pseudo-transaction @@ -2687,7 +2739,7 @@ class Batch_test : public beast::unit_test::Suite { STTx const amendTx(ttAMENDMENT, [seq = env.closed()->header().seq + 1](auto& obj) { obj.setAccountID(sfAccount, AccountID()); - obj.setFieldH256(sfAmendment, fixBatchInnerSigs); + obj.setFieldH256(sfAmendment, featureBatchV1_1); obj.setFieldU32(sfLedgerSequence, seq); obj.setFieldU32(sfFlags, tfInnerBatchTxn); }); @@ -2695,13 +2747,7 @@ class Batch_test : public beast::unit_test::Suite STParsedJSONObject parsed("test", txn.getTxn()); Serializer s; parsed.object->add(s); // NOLINT(bugprone-unchecked-optional-access) - submitAndValidate( - "Pseudo-transaction", - s.slice(), - __LINE__, - withInnerSigFix ? "fails local checks: Empty SigningPubKey." - : "fails local checks: Cannot submit pseudo transactions.", - "fails local checks: Empty SigningPubKey."); + submitAndValidate("Pseudo-transaction", s.slice(), __LINE__); } } @@ -2722,7 +2768,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -2771,6 +2817,93 @@ class Batch_test : public beast::unit_test::Suite // Alice pays XRP & Fee; Bob receives XRP BEAST_EXPECT(env.balance(alice) == preAlice - XRP(1000) - batchFee); BEAST_EXPECT(env.balance(bob) == XRP(1000)); + + // An inner partial payment must never fund a new account. With + // featureBatchV1_1 the partial-payment-to-create check runs on the + // batch's closed view and rejects it (tefNO_DST_PARTIAL). A USD->XRP path is + // set up so that, absent the check, the partial payment would deliver + // XRP and create carol; the check must block exactly that. A + // cross-currency shape (IOU SendMax, XRP Amount) also lets the inner + // pass preflight and reach the preclaim check. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const gw = Account("gw"); + auto const carol = Account("carol"); // never funded + auto const usd = gw["USD"]; + env.fund(XRP(10000), alice, gw); + env.close(); + env.memoize(carol); + + env(trust(alice, usd(100000))); + env(pay(gw, alice, usd(10000))); + env(offer(gw, usd(2000), XRP(2000))); // USD -> XRP liquidity + env.close(); + + auto const seq = env.seq(alice); + auto const batchFee = batch::calcBatchFee(env, 0, 2); + + auto pp = pay(alice, carol, XRP(1000)); + pp[jss::SendMax] = usd(2000).value().getJson(JsonOptions::Values::None); + pp[jss::Flags] = tfPartialPayment; + + env(batch::outer(alice, seq, batchFee, tfIndependent), + batch::Inner(pp, seq + 1), + batch::Inner(noop(alice), seq + 2), + Ter(tesSUCCESS)); + env.close(); + + // carol was not created despite the available path. + BEAST_EXPECT(!env.le(carol)); + } + } + + void + testCheckAllSignatures(FeatureBitset features) + { + testcase("check all signatures"); + + using namespace test::jtx; + using namespace std::literals; + + // Verifies that checkBatchSign validates all signers even when an + // unfunded account (signed with its master key) appears first in the + // sorted signer list. A funded account with an invalid signature must + // still be rejected with tefBAD_AUTH. + + Env env{*this, features}; + + auto const alice = Account("alice"); + // "aaa" sorts before other accounts alphabetically, ensuring the + // unfunded account is checked first in the sorted signer list + auto const unfunded = Account("aaa"); + auto const carol = Account("carol"); + env.fund(XRP(10000), alice, carol); + env.close(); + + // Verify sort order: unfunded.id() < carol.id() + BEAST_EXPECT(unfunded.id() < carol.id()); + + auto const seq = env.seq(alice); + auto const ledSeq = env.current()->seq(); + auto const batchFee = batch::calcBatchFee(env, 2, 3); + + // The batch includes: + // 1. alice pays unfunded (to create unfunded's account) + // 2. unfunded does a noop (signed by unfunded's master key - valid) + // 3. carol pays alice (signed by alice's key - INVALID since alice is + // not carol's regular key) + // + // checkBatchSign must validate all signers regardless of order. + // This must fail with tefBAD_AUTH. + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(pay(alice, unfunded, XRP(100)), seq + 1), + batch::Inner(noop(unfunded), ledSeq), + batch::Inner(pay(carol, alice, XRP(1000)), env.seq(carol)), + batch::Sig(unfunded, Reg{carol, alice}), + Ter(tefBAD_AUTH)); + env.close(); } void @@ -2781,7 +2914,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -2845,7 +2978,7 @@ class Batch_test : public beast::unit_test::Suite // tfIndependent: account delete success { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -2897,7 +3030,7 @@ class Batch_test : public beast::unit_test::Suite // tfIndependent: account delete fails { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -2957,7 +3090,7 @@ class Batch_test : public beast::unit_test::Suite // tfAllOrNothing: account delete fails { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3009,7 +3142,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; - test::jtx::Env env{*this, features}; + Env env{*this, features}; Account const issuer{"issuer"}; // For simplicity, lender will be the sole actor for the vault & @@ -3186,7 +3319,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3322,7 +3455,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3396,7 +3529,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3470,7 +3603,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3531,7 +3664,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3591,7 +3724,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -3666,7 +3799,7 @@ class Batch_test : public beast::unit_test::Suite // overwritten by the payment in the batch transaction. Because the // terPRE_SEQ is outside of the batch this noop transaction will ge // reapplied in the following ledger - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob, carol); env.close(); @@ -3729,7 +3862,7 @@ class Batch_test : public beast::unit_test::Suite // IMPORTANT: The batch txn is applied first, then the noop txn. // Because of this ordering, the noop txn is not applied and is // overwritten by the payment in the batch transaction. - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -3783,7 +3916,7 @@ class Batch_test : public beast::unit_test::Suite // IMPORTANT: The batch txn is applied first, then the noop txn. // Because of this ordering, the noop txn is not applied and is // overwritten by the payment in the batch transaction. - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -3831,7 +3964,7 @@ class Batch_test : public beast::unit_test::Suite // Outer Batch terPRE_SEQ { - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob, carol); env.close(); @@ -3905,7 +4038,7 @@ class Batch_test : public beast::unit_test::Suite // IMPORTANT: The batch txn is applied first, then the noop txn. // Because of this ordering, the noop txn is not applied and is // overwritten by the payment in the batch transaction. - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -3964,7 +4097,7 @@ class Batch_test : public beast::unit_test::Suite // IMPORTANT: The batch txn is applied first, then the noop txn. // Because of this ordering, the noop txn is not applied and is // overwritten by the payment in the batch transaction. - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -4037,7 +4170,7 @@ class Batch_test : public beast::unit_test::Suite // batch will run in the close ledger process. The batch will be // allied and then retry this transaction in the current ledger. - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -4100,7 +4233,7 @@ class Batch_test : public beast::unit_test::Suite // Create Object Before Batch Txn { - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -4163,7 +4296,7 @@ class Batch_test : public beast::unit_test::Suite // batch will run in the close ledger process. The batch will be // applied and then retry this transaction in the current ledger. - test::jtx::Env env{*this, features}; + Env env{*this, features}; env.fund(XRP(10000), alice, bob); env.close(); @@ -4226,7 +4359,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -4265,7 +4398,7 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - test::jtx::Env env{*this, features}; + Env env{*this, features}; XRPAmount const baseFee = env.current()->fees().base; auto const alice = Account("alice"); @@ -4359,9 +4492,12 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; using namespace std::literals; - // only outer batch transactions are counter towards the queue size + // A Batch is never queued. Under open-ledger congestion a Batch that + // pays only its base fee cannot apply directly and, unlike an ordinary + // transaction, is rejected outright rather than held in the queue. A + // Batch that pays the escalated open-ledger fee applies directly. { - test::jtx::Env env{ + Env env{ *this, makeSmallQueueConfig({{Keys::kMinimumTxnInLedgerStandalone, "2"}}), features, @@ -4378,7 +4514,7 @@ class Batch_test : public beast::unit_test::Suite env.fund(XRP(10000), noripple(carol)); env.close(env.now() + 5s, 10000ms); - // Fill the ledger + // Fill the open ledger so escalation is active. env(noop(alice)); env(noop(alice)); env(noop(alice)); @@ -4391,33 +4527,28 @@ class Batch_test : public beast::unit_test::Suite auto const bobSeq = env.seq(bob); auto const batchFee = batch::calcBatchFee(env, 1, 2); - // Queue Batch - { - env(batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), - batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 1), - batch::Inner(pay(bob, alice, XRP(5)), bobSeq), - batch::Sig(bob), - Ter(terQUEUED)); - } + // Paying only the base fee, the Batch cannot enter the congested + // open ledger and is rejected rather than queued. + env(batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), + batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 1), + batch::Inner(pay(bob, alice, XRP(5)), bobSeq), + batch::Sig(bob), + Ter(telCAN_NOT_QUEUE)); - checkMetrics(*this, env, 2, std::nullopt, 3, 2); + // The Batch was not queued; only carol's transaction is queued. + checkMetrics(*this, env, 1, std::nullopt, 3, 2); - // Replace Queued Batch - { - env(batch::outer(alice, aliceSeq, openLedgerFee(env, batchFee), tfAllOrNothing), - batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 1), - batch::Inner(pay(bob, alice, XRP(5)), bobSeq), - batch::Sig(bob), - Ter(tesSUCCESS)); - env.close(); - } - - checkMetrics(*this, env, 0, 12, 1, 6); + // Paying the escalated open-ledger fee, the Batch applies directly. + env(batch::outer(alice, aliceSeq, openLedgerFee(env, batchFee), tfAllOrNothing), + batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 1), + batch::Inner(pay(bob, alice, XRP(5)), bobSeq), + batch::Sig(bob), + Ter(tesSUCCESS)); } // inner batch transactions are counter towards the ledger tx count { - test::jtx::Env env{ + Env env{ *this, makeSmallQueueConfig({{Keys::kMinimumTxnInLedgerStandalone, "2"}}), features, @@ -4457,6 +4588,50 @@ class Batch_test : public beast::unit_test::Suite env(noop(carol), Ter(terQUEUED)); checkMetrics(*this, env, 1, std::nullopt, 3, 2); } + + // A Batch is never queued, so it also cannot sit behind the account's + // already-queued transactions: with a sequence gap it cannot apply + // directly and is rejected rather than queued. + { + Env env{ + *this, + makeSmallQueueConfig({{Keys::kMinimumTxnInLedgerStandalone, "2"}}), + features, + nullptr, + beast::Severity::Error}; + + auto alice = Account("alice"); + auto bob = Account("bob"); + + env.fund(XRP(10000), noripple(alice, bob)); + env.close(env.now() + 5s, 10000ms); + + // Fill the open ledger so subsequent transactions queue. + env(noop(alice)); + env(noop(alice)); + env(noop(alice)); + checkMetrics(*this, env, 0, std::nullopt, 3, 2); + + auto const aliceSeq = env.seq(alice); + + // Queue two normal transactions for alice. + env(noop(alice), Seq(aliceSeq + 0), Ter(terQUEUED)); + env(noop(alice), Seq(aliceSeq + 1), Ter(terQUEUED)); + checkMetrics(*this, env, 2, std::nullopt, 3, 2); + + // The Batch's sequence sits behind the queued transactions, so it + // cannot apply directly and is rejected rather than queued. + auto const bobSeq = env.seq(bob); + auto const batchFee = batch::calcBatchFee(env, 1, 2); + env(batch::outer(alice, aliceSeq + 2, batchFee, tfAllOrNothing), + batch::Inner(pay(alice, bob, XRP(10)), aliceSeq + 3), + batch::Inner(pay(bob, alice, XRP(5)), bobSeq), + batch::Sig(bob), + Ter(telCAN_NOT_QUEUE)); + + // The two queued transactions are untouched. + checkMetrics(*this, env, 2, std::nullopt, 3, 2); + } } void @@ -4508,6 +4683,376 @@ class Batch_test : public beast::unit_test::Suite } } + void + testBatchDelegateConsent(FeatureBitset features) + { + testcase("batch delegate consent"); + + using namespace test::jtx; + using namespace std::literals; + + // Delegate consent bypass. + // + // Alice delegates Payment to Bob. A Batch carries an inner Payment with + // Delegate=Bob, but Bob never signs the batch (and, because the inner + // Account == the outer Account, no BatchSigners are required at all). + // Batch waives the per-inner signature check, and preflightSigValidated + // derives required signers from sfAccount only -- it ignores sfDelegate + // -- so Bob's delegated authority is exercised without Bob's consent. + // + // SECURE EXPECTATION: the delegate (Bob) must authorize the inner txn, + // so the batch must be rejected (temBAD_SIGNER) when Bob does not sign. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const mallory = Account("mallory"); + env.fund(XRP(10000), alice, bob, mallory); + env.close(); + + env(delegate::set(alice, bob, {"Payment"})); + env.close(); + + auto const preMallory = env.balance(mallory); + + auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const seq = env.seq(alice); + + auto inner = batch::Inner(pay(alice, mallory, XRP(1000)), seq + 1); + inner[jss::Delegate] = bob.human(); + + // Bob is NOT among the batch signers; he never consents. + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + inner, + batch::Inner(pay(alice, mallory, XRP(1)), seq + 2), + Ter(temBAD_SIGNER)); + env.close(); + + // No funds should have moved to Mallory. + BEAST_EXPECT(env.balance(mallory) == preMallory); + } + + // Self-grant attribution forgery. + // + // With no pre-existing delegation, Alice places DelegateSet(authorize + // Bob) and a Delegate=Bob action in the SAME batch. The second inner + // reads the delegation created by the first from the batch's running + // view, and Bob never signs -- manufacturing on-chain attribution of + // the action to Bob without his consent. + // + // SECURE EXPECTATION: rejected (temBAD_SIGNER) -- Bob must consent, and + // a grant cannot be created and exercised within the same atomic batch. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const mallory = Account("mallory"); + env.fund(XRP(10000), alice, bob, mallory); + env.close(); + + auto const preMallory = env.balance(mallory); + + auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const seq = env.seq(alice); + + auto inner = batch::Inner(pay(alice, mallory, XRP(1000)), seq + 2); + inner[jss::Delegate] = bob.human(); + + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(delegate::set(alice, bob, {"Payment"}), seq + 1), + inner, + Ter(temBAD_SIGNER)); + env.close(); + + BEAST_EXPECT(env.balance(mallory) == preMallory); + } + + // Legitimate counterpart: the same atomic grant-and-use is allowed when + // the delegate co-signs the batch -- consent is present, so it succeeds. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const mallory = Account("mallory"); + env.fund(XRP(10000), alice, bob, mallory); + env.close(); + + auto const preMallory = env.balance(mallory); + + auto const batchFee = batch::calcBatchFee(env, 1, 2); + auto const seq = env.seq(alice); + + auto inner = batch::Inner(pay(alice, mallory, XRP(1000)), seq + 2); + inner[jss::Delegate] = bob.human(); + + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(delegate::set(alice, bob, {"Payment"}), seq + 1), + inner, + batch::Sig(bob), + Ter(tesSUCCESS)); + env.close(); + + BEAST_EXPECT(env.balance(mallory) == preMallory + XRP(1000)); + } + + // Multi-account: a delegated inner from a non-outer account also + // requires the delegate's signature (not the account holder's). + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + env.fund(XRP(10000), alice, bob, carol); + env.close(); + + env(delegate::set(bob, carol, {"Payment"})); + env.close(); + + auto const preAlice = env.balance(alice); + + auto const batchFee = batch::calcBatchFee(env, 1, 2); + auto const aliceSeq = env.seq(alice); + auto const bobSeq = env.seq(bob); + + auto inner = batch::Inner(pay(bob, alice, XRP(1)), bobSeq); + inner[jss::Delegate] = carol.human(); + + // Carol (the delegate) does not sign. + env(batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), + inner, + batch::Inner(pay(alice, bob, XRP(2)), aliceSeq + 1), + Ter(temBAD_SIGNER)); + env.close(); + + BEAST_EXPECT(env.balance(alice) == preAlice); + } + + // Wrong signer: a batch signature from someone other than the named + // delegate does not satisfy the requirement. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + auto const mallory = Account("mallory"); + env.fund(XRP(10000), alice, bob, carol, mallory); + env.close(); + + env(delegate::set(alice, bob, {"Payment"})); + env.close(); + + auto const preMallory = env.balance(mallory); + + auto const batchFee = batch::calcBatchFee(env, 1, 2); + auto const seq = env.seq(alice); + + auto inner = batch::Inner(pay(alice, mallory, XRP(1000)), seq + 1); + inner[jss::Delegate] = bob.human(); + + // Carol signs instead of the named delegate Bob. + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + inner, + batch::Inner(pay(alice, mallory, XRP(1)), seq + 2), + batch::Sig(carol), + Ter(temBAD_SIGNER)); + env.close(); + + BEAST_EXPECT(env.balance(mallory) == preMallory); + } + + // Delegate is the outer account: the outer signature already provides + // the delegate's consent, so no BatchSigners are required. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + env.fund(XRP(10000), alice, bob); + env.close(); + + // Bob delegates Payment to Alice, who is also the batch submitter. + env(delegate::set(bob, alice, {"Payment"})); + env.close(); + + auto const preBob = env.balance(bob); + + auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const aliceSeq = env.seq(alice); + auto const bobSeq = env.seq(bob); + + auto inner = batch::Inner(pay(bob, alice, XRP(1)), bobSeq); + inner[jss::Delegate] = alice.human(); + + env(batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), + inner, + batch::Inner(pay(alice, bob, XRP(2)), aliceSeq + 1), + Ter(tesSUCCESS)); + env.close(); + + // Net: Bob sends 1 to Alice, receives 2 from Alice. + BEAST_EXPECT(env.balance(bob) == preBob + XRP(1)); + } + + // Principal signs instead of the delegate. Bob delegates Payment to + // Carol and an inner pays from Bob with Delegate=Carol, so Carol -- not + // Bob -- is the required batch signer. Bob's own signature (the account + // holder) does not satisfy the delegate-consent requirement. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + env.fund(XRP(10000), alice, bob, carol); + env.close(); + + env(delegate::set(bob, carol, {"Payment"})); + env.close(); + + auto const preAlice = env.balance(alice); + + auto const batchFee = batch::calcBatchFee(env, 1, 2); + auto const aliceSeq = env.seq(alice); + auto const bobSeq = env.seq(bob); + + auto inner = batch::Inner(pay(bob, alice, XRP(1)), bobSeq); + inner[jss::Delegate] = carol.human(); + + // Bob (the principal) signs in place of Carol (the delegate). + env(batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), + inner, + batch::Inner(pay(alice, bob, XRP(2)), aliceSeq + 1), + batch::Sig(bob), + Ter(temBAD_SIGNER)); + env.close(); + + BEAST_EXPECT(env.balance(alice) == preAlice); + } + + // Control for the revocation case below: identical setup, but inner 1 + // is a benign payment instead of a revocation. With Alice's delegation + // intact, the delegated inner 2 succeeds -- proving the failure in the + // revocation case is caused by the revocation, not the setup. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const mallory = Account("mallory"); + env.fund(XRP(10000), alice, bob, mallory); + env.close(); + + env(delegate::set(bob, alice, {"Payment"})); + env.close(); + + auto const preMallory = env.balance(mallory); + + auto const batchFee = batch::calcBatchFee(env, 1, 2); + auto const seq = env.seq(bob); + + auto inner2 = batch::Inner(pay(bob, mallory, XRP(1000)), seq + 2); + inner2[jss::Delegate] = alice.human(); + + // Inner 1 is Bob's own payment (no revocation); Alice co-signs for + // the delegated inner 2. + auto const [txIDs, batchID] = submitBatch( + env, + tesSUCCESS, + batch::outer(bob, seq, batchFee, tfIndependent), + batch::Inner(pay(bob, alice, XRP(1)), seq + 1), + inner2, + batch::Sig(alice)); + env.close(); + + std::vector const testCases = { + {.index = 0, + .txType = "Batch", + .result = "tesSUCCESS", + .txHash = batchID, + .batchID = std::nullopt}, + {.index = 1, + .txType = "Payment", + .result = "tesSUCCESS", + .txHash = txIDs[0], + .batchID = batchID}, + {.index = 2, + .txType = "Payment", + .result = "tesSUCCESS", + .txHash = txIDs[1], + .batchID = batchID}, + }; + validateClosedLedger(env, testCases); + + // The delegated payment applied: Mallory received the funds. + BEAST_EXPECT(env.balance(mallory) == preMallory + XRP(1000)); + } + + // Revocation within the same batch. Bob grants Alice Payment permission + // beforehand; an earlier inner revokes it before a later delegated + // inner tries to use it. Alice must still co-sign (delegate consent is + // derived from the static tx), but the revoked permission makes the + // delegated inner fail at apply time -- a grant cannot be used after it + // is removed earlier in the same batch. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const mallory = Account("mallory"); + env.fund(XRP(10000), alice, bob, mallory); + env.close(); + + env(delegate::set(bob, alice, {"Payment"})); + env.close(); + + auto const preMallory = env.balance(mallory); + + auto const batchFee = batch::calcBatchFee(env, 1, 2); + auto const seq = env.seq(bob); + + // Inner 2: Alice acts as Bob's delegate, so Alice is the required + // batch signer. + auto inner2 = batch::Inner(pay(bob, mallory, XRP(1000)), seq + 2); + inner2[jss::Delegate] = alice.human(); + + // tfIndependent: inner 1 (the revocation) applies; inner 2 then + // fails for lack of permission without reverting inner 1. An empty + // permission list deletes the Delegate object. + auto const [txIDs, batchID] = submitBatch( + env, + tesSUCCESS, + batch::outer(bob, seq, batchFee, tfIndependent), + batch::Inner(delegate::set(bob, alice, {}), seq + 1), + inner2, + batch::Sig(alice)); + env.close(); + + std::vector const testCases = { + {.index = 0, + .txType = "Batch", + .result = "tesSUCCESS", + .txHash = batchID, + .batchID = std::nullopt}, + {.index = 1, + .txType = "DelegateSet", + .result = "tesSUCCESS", + .txHash = txIDs[0], + .batchID = batchID}, + // inner 2 fails: Alice's permission was revoked in inner 1. + }; + validateClosedLedger(env, testCases); + + // The delegated payment never applied. + BEAST_EXPECT(env.balance(mallory) == preMallory); + BEAST_EXPECT(env.rpc("tx", txIDs[1])[jss::result][jss::error] == "txnNotFound"); + } + } + void testBatchDelegate(FeatureBitset features) { @@ -4518,7 +5063,7 @@ class Batch_test : public beast::unit_test::Suite // delegated non atomic inner { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -4533,17 +5078,20 @@ class Batch_test : public beast::unit_test::Suite auto const preAlice = env.balance(alice); auto const preBob = env.balance(bob); - auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const batchFee = batch::calcBatchFee(env, 1, 2); auto const seq = env.seq(alice); auto tx = batch::Inner(pay(alice, bob, XRP(1)), seq + 1); tx[jss::Delegate] = bob.human(); + // The delegate (Bob) authorizes the delegated inner, so Bob must + // provide the batch signature. auto const [txIDs, batchID] = submitBatch( env, tesSUCCESS, batch::outer(alice, seq, batchFee, tfAllOrNothing), tx, - batch::Inner(pay(alice, bob, XRP(2)), seq + 2)); + batch::Inner(pay(alice, bob, XRP(2)), seq + 2), + batch::Sig(bob)); env.close(); std::vector const testCases = { @@ -4575,7 +5123,7 @@ class Batch_test : public beast::unit_test::Suite // delegated atomic inner { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -4598,13 +5146,15 @@ class Batch_test : public beast::unit_test::Suite auto tx = batch::Inner(pay(bob, alice, XRP(1)), bobSeq); tx[jss::Delegate] = carol.human(); + // Carol is the delegate authorizing the inner txn on Bob's behalf, + // so Carol -- not Bob -- must provide the batch signature. auto const [txIDs, batchID] = submitBatch( env, tesSUCCESS, batch::outer(alice, aliceSeq, batchFee, tfAllOrNothing), tx, batch::Inner(pay(alice, bob, XRP(2)), aliceSeq + 1), - batch::Sig(bob)); + batch::Sig(carol)); env.close(); std::vector const testCases = { @@ -4639,7 +5189,7 @@ class Batch_test : public beast::unit_test::Suite // this also makes sure tfInnerBatchTxn won't block delegated AccountSet // with granular permission { - test::jtx::Env env{*this, features}; + Env env{*this, features}; auto const alice = Account("alice"); auto const bob = Account("bob"); @@ -4654,19 +5204,22 @@ class Batch_test : public beast::unit_test::Suite auto const preAlice = env.balance(alice); auto const preBob = env.balance(bob); - auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const batchFee = batch::calcBatchFee(env, 1, 2); auto const seq = env.seq(alice); auto tx = batch::Inner(noop(alice), seq + 1); std::string const domain = "example.com"; tx[sfDomain.jsonName] = strHex(domain); tx[jss::Delegate] = bob.human(); + // Bob is the delegate authorizing the inner AccountSet, so Bob must + // provide the batch signature. auto const [txIDs, batchID] = submitBatch( env, tesSUCCESS, batch::outer(alice, seq, batchFee, tfAllOrNothing), tx, - batch::Inner(pay(alice, bob, XRP(2)), seq + 2)); + batch::Inner(pay(alice, bob, XRP(2)), seq + 2), + batch::Sig(bob)); env.close(); std::vector const testCases = { @@ -4700,7 +5253,7 @@ class Batch_test : public beast::unit_test::Suite // this also makes sure tfInnerBatchTxn won't block delegated // MPTokenIssuanceSet with granular permission { - test::jtx::Env env{*this, features}; + Env env{*this, features}; Account const alice{"alice"}; Account const bob{"bob"}; env.fund(XRP(100000), alice, bob); @@ -4717,7 +5270,7 @@ class Batch_test : public beast::unit_test::Suite env.close(); auto const seq = env.seq(alice); - auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const batchFee = batch::calcBatchFee(env, 1, 2); json::Value jv1; jv1[sfTransactionType] = jss::MPTokenIssuanceSet; @@ -4735,12 +5288,15 @@ class Batch_test : public beast::unit_test::Suite jv2[sfMPTokenIssuanceID] = to_string(mptID); jv2[sfFlags] = tfMPTUnlock; + // Both inners are delegated to Bob, so Bob must provide the batch + // signature (one signer covers both). auto const [txIDs, batchID] = submitBatch( env, tesSUCCESS, batch::outer(alice, seq, batchFee, tfAllOrNothing), batch::Inner(jv1, seq + 1), - batch::Inner(jv2, seq + 2)); + batch::Inner(jv2, seq + 2), + batch::Sig(bob)); env.close(); std::vector const testCases = { @@ -4767,7 +5323,7 @@ class Batch_test : public beast::unit_test::Suite // this also makes sure tfInnerBatchTxn won't block delegated TrustSet // with granular permission { - test::jtx::Env env{*this, features}; + Env env{*this, features}; Account const gw{"gw"}; Account const alice{"alice"}; Account const bob{"bob"}; @@ -4781,19 +5337,22 @@ class Batch_test : public beast::unit_test::Suite env.close(); auto const seq = env.seq(gw); - auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const batchFee = batch::calcBatchFee(env, 1, 2); auto jv1 = trust(gw, gw["USD"](0), alice, tfSetfAuth); jv1[sfDelegate] = bob.human(); auto jv2 = trust(gw, gw["USD"](0), alice, tfSetFreeze); jv2[sfDelegate] = bob.human(); + // Both inners are delegated to Bob, so Bob must provide the batch + // signature. auto const [txIDs, batchID] = submitBatch( env, tesSUCCESS, batch::outer(gw, seq, batchFee, tfAllOrNothing), batch::Inner(jv1, seq + 1), - batch::Inner(jv2, seq + 2)); + batch::Inner(jv2, seq + 2), + batch::Sig(bob)); env.close(); std::vector const testCases = { @@ -4818,7 +5377,7 @@ class Batch_test : public beast::unit_test::Suite // inner transaction not authorized by the delegating account. { - test::jtx::Env env{*this, features}; + Env env{*this, features}; Account const gw{"gw"}; Account const alice{"alice"}; Account const bob{"bob"}; @@ -4832,20 +5391,23 @@ class Batch_test : public beast::unit_test::Suite env.close(); auto const seq = env.seq(gw); - auto const batchFee = batch::calcBatchFee(env, 0, 2); + auto const batchFee = batch::calcBatchFee(env, 1, 2); auto jv1 = trust(gw, gw["USD"](0), alice, tfSetFreeze); jv1[sfDelegate] = bob.human(); auto jv2 = trust(gw, gw["USD"](0), alice, tfClearFreeze); jv2[sfDelegate] = bob.human(); + // Both inners are delegated to Bob, so Bob must provide the batch + // signature; jv2 still fails preclaim for lack of permission. auto const [txIDs, batchID] = submitBatch( env, tesSUCCESS, batch::outer(gw, seq, batchFee, tfIndependent), batch::Inner(jv1, seq + 1), // terNO_DELEGATE_PERMISSION: not authorized to clear freeze - batch::Inner(jv2, seq + 2)); + batch::Inner(jv2, seq + 2), + batch::Sig(bob)); env.close(); std::vector const testCases = { @@ -5004,7 +5566,7 @@ class Batch_test : public beast::unit_test::Suite batch::outer(alice, seq, batchFee, tfAllOrNothing), batch::Inner(pay(alice, bob, XRP(10)), seq + 1), batch::Inner(pay(alice, bob, XRP(5)), seq + 2), - batch::Sig(bob, carol, alice, bob, carol, alice, bob, carol, alice, alice)); + batch::Sig(std::vector(kMaxBatchSigners + 1, bob))); XRPAmount const txBaseFee = getBaseFee(jtx); BEAST_EXPECT(txBaseFee == XRPAmount(kInitialXrp)); } @@ -5022,6 +5584,304 @@ class Batch_test : public beast::unit_test::Suite } } + void + testStandaloneInnerBatchFlag(FeatureBitset features) + { + testcase("standalone tx with tfInnerBatchTxn rejected"); + + using namespace test::jtx; + using namespace std::literals; + + // A standalone Payment with tfInnerBatchTxn must be rejected. + // Without proper guards this would bypass signature verification + // in preflight2. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + env.fund(XRP(10000), alice, bob); + env.close(); + + // Submit a normal Payment with tfInnerBatchTxn flag. + // preflight1 must reject with temINVALID_INNER_BATCH because + // the flag is set but no parentBatchId exists. + env(pay(alice, bob, XRP(1)), Txflags(tfInnerBatchTxn), Ter(telENV_RPC_FAILED)); + env.close(); + + // Verify via direct apply path (bypassing RPC layer) + env.app().getOpenLedger().modify([&](OpenView& view, beast::Journal j) { + // Construct a Payment STTx with tfInnerBatchTxn, + // empty signing pub key, and no signature — mimicking + // what an attacker would send to skip sig verification. + STTx const stx = STTx(ttPAYMENT, [&](auto& obj) { + obj.setAccountID(sfAccount, alice.id()); + obj.setAccountID(sfDestination, bob.id()); + obj.setFieldAmount(sfAmount, XRP(1)); + obj.setFieldAmount(sfFee, XRP(0)); + obj.setFieldU32(sfSequence, env.seq(alice)); + obj.setFieldU32(sfFlags, tfInnerBatchTxn); + }); + + auto const result = xrpl::apply(env.app(), view, stx, TapNone, j); + // Must NOT be applied — signature was never checked + BEAST_EXPECT(!result.applied); + return false; + }); + } + } + + void + testOuterBinding(FeatureBitset features) + { + testcase("outer binding"); + + using namespace test::jtx; + + // Signatures captured from one outer account cannot be replayed + // under a different outer account. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + auto const eve = Account("eve"); + env.fund(XRP(10000), alice, bob, carol, eve); + env.close(); + + auto const preCarol = env.balance(carol); + auto const bobSeq = env.seq(bob); + auto const carolSeq = env.seq(carol); + + auto const aliceSeq = env.seq(alice); + auto const batchFee1 = batch::calcBatchFee(env, 2, 2); + auto jt1 = env.jt( + batch::outer(alice, aliceSeq, batchFee1, tfOnlyOne), + batch::Inner(pay(bob, alice, XRP(100)), bobSeq), + batch::Inner(pay(carol, alice, XRP(50)), carolSeq), + batch::Sig(bob, carol)); + + auto const capturedSigners = jt1.jv[sfBatchSigners.jsonName]; + + env(jt1, Ter(tesSUCCESS)); + env.close(); + BEAST_EXPECT(env.seq(bob) == bobSeq + 1); + BEAST_EXPECT(env.seq(carol) == carolSeq); + + auto const batchFee2 = batch::calcBatchFee(env, 2, 2); + auto jt2 = env.jtnofill( + batch::outer(eve, env.seq(eve), batchFee2, tfOnlyOne), + batch::Inner(pay(bob, alice, XRP(100)), bobSeq), + batch::Inner(pay(carol, alice, XRP(50)), carolSeq)); + + jt2.jv[sfBatchSigners.jsonName] = capturedSigners; + env(jt2.jv, Ter(telENV_RPC_FAILED)); + env.close(); + + BEAST_EXPECT(env.seq(carol) == carolSeq); + BEAST_EXPECT(env.balance(carol) == preCarol); + } + + // Signatures are bound to the outer sequence; replaying them + // at a higher sequence must fail. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + env.fund(XRP(10000), alice, bob, carol); + env.close(); + + auto const preCarol = env.balance(carol); + auto const bobSeq = env.seq(bob); + auto const carolSeq = env.seq(carol); + + auto const aliceSeq1 = env.seq(alice); + auto const batchFee1 = batch::calcBatchFee(env, 2, 2); + auto jt1 = env.jt( + batch::outer(alice, aliceSeq1, batchFee1, tfOnlyOne), + batch::Inner(pay(bob, alice, XRP(500)), bobSeq), + batch::Inner(pay(carol, alice, XRP(500)), carolSeq), + batch::Sig(bob, carol)); + + auto const capturedSigners = jt1.jv[sfBatchSigners.jsonName]; + + env(jt1, Ter(tesSUCCESS)); + env.close(); + BEAST_EXPECT(env.seq(bob) == bobSeq + 1); + BEAST_EXPECT(env.seq(carol) == carolSeq); + + auto const batchFee2 = batch::calcBatchFee(env, 2, 2); + auto jt2 = env.jtnofill( + batch::outer(alice, env.seq(alice), batchFee2, tfOnlyOne), + batch::Inner(pay(bob, alice, XRP(500)), bobSeq), + batch::Inner(pay(carol, alice, XRP(500)), carolSeq)); + + jt2.jv[sfBatchSigners.jsonName] = capturedSigners; + env(jt2.jv, Ter(telENV_RPC_FAILED)); + env.close(); + + BEAST_EXPECT(env.balance(carol) == preCarol); + BEAST_EXPECT(env.seq(carol) == carolSeq); + } + + // Multi-signed batch signer entries are bound to their account; + // reusing inner signatures under a different batch signer must fail. + { + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + auto const dave = Account("dave"); + auto const elsa = Account("elsa"); + env.fund(XRP(10000), alice, bob, carol, dave, elsa); + env.close(); + + env(signers(bob, 2, {{dave, 1}, {elsa, 1}})); + env.close(); + env(signers(carol, 2, {{dave, 1}, {elsa, 1}})); + env.close(); + + auto const seq = env.seq(alice); + auto const batchFee = batch::calcBatchFee(env, 3, 2); + auto jt1 = env.jt( + batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(pay(alice, bob, XRP(10)), seq + 1), + batch::Inner(pay(bob, alice, XRP(5)), env.seq(bob)), + batch::Msig(bob, {dave, elsa}), + Ter(tesSUCCESS)); + + auto const bobSignerEntry = jt1.jv[sfBatchSigners.jsonName][0u]; + + env(jt1, Ter(tesSUCCESS)); + env.close(); + + auto const seq2 = env.seq(alice); + auto const batchFee2 = batch::calcBatchFee(env, 3, 2); + auto jt2 = env.jtnofill( + batch::outer(alice, seq2, batchFee2, tfAllOrNothing), + batch::Inner(pay(alice, carol, XRP(10)), seq2 + 1), + batch::Inner(pay(carol, alice, XRP(5)), env.seq(carol))); + + json::Value carolSigner; + carolSigner[sfBatchSigner.jsonName][jss::Account] = carol.human(); + carolSigner[sfBatchSigner.jsonName][jss::SigningPubKey] = ""; + carolSigner[sfBatchSigner.jsonName][sfSigners.jsonName] = + bobSignerEntry[sfBatchSigner.jsonName][sfSigners.jsonName]; + + jt2.jv[sfBatchSigners.jsonName][0u] = carolSigner; + env(jt2.jv, Ter(telENV_RPC_FAILED)); + env.close(); + } + } + + void + testUnsortedBatchSigners(FeatureBitset features) + { + testcase("unsorted batch signers"); + + using namespace test::jtx; + + Env env{*this, features}; + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const carol = Account("carol"); + env.fund(XRP(10000), alice, bob, carol); + env.close(); + + auto const seq = env.seq(alice); + auto const bobSeq = env.seq(bob); + auto const carolSeq = env.seq(carol); + auto const batchFee = batch::calcBatchFee(env, 2, 2); + + auto jt = env.jt( + batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(pay(bob, alice, XRP(10)), bobSeq), + batch::Inner(pay(carol, alice, XRP(5)), carolSeq), + batch::Sig(bob, carol)); + + auto const s0 = jt.jv[sfBatchSigners.jsonName][0u]; + auto const s1 = jt.jv[sfBatchSigners.jsonName][1u]; + jt.jv[sfBatchSigners.jsonName][0u] = s1; + jt.jv[sfBatchSigners.jsonName][1u] = s0; + + env(jt.jv, Ter(temBAD_SIGNER)); + env.close(); + } + + void + testBatchSigCache(FeatureBitset features) + { + testcase("batch signature caching"); + + using namespace test::jtx; + + // Mirrors apply.cpp's file-local kSfSiggood (the standard signature-good + // cache); batch signer sigs are now verified and cached alongside the + // outer signature in checkSign/checkValidity. + constexpr HashRouterFlags kSfSiggood = HashRouterFlags::PRIVATE2; + + // Valid batch: alice (outer) + an inner from bob, who co-signs. + auto buildValidBatch = [](Env& env) { + auto const alice = Account("alice"); + auto const bob = Account("bob"); + auto const seq = env.seq(alice); + auto const batchFee = batch::calcBatchFee(env, 1, 2); + return env.jt( + batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(pay(alice, bob, XRP(1)), seq + 1), + batch::Inner(pay(bob, alice, XRP(2)), env.seq(bob)), + batch::Sig(bob)); + }; + + // WRITE: a valid batch records "good" on its tx id. + { + Env env{*this, features}; + env.fund(XRP(10000), Account("alice"), Account("bob")); + env.close(); + + auto jt = buildValidBatch(env); + auto const txid = jt.stx->getTransactionID(); + + BEAST_EXPECT(!any(env.app().getHashRouter().getFlags(txid) & kSfSiggood)); + env(jt, Ter(tesSUCCESS)); + BEAST_EXPECT(any(env.app().getHashRouter().getFlags(txid) & kSfSiggood)); + env.close(); + } + + // READ: corrupt only a signer's signature (outer sig + signer key + // untouched), so just the crypto would fail. Caught when uncached... + { + Env env{*this, features}; + env.fund(XRP(10000), Account("alice"), Account("bob")); + env.close(); + + auto jt = buildValidBatch(env); + jt.jv[sfBatchSigners.jsonName][0u][sfBatchSigner.jsonName][sfTxnSignature.jsonName] = + "00"; + env(jt.jv, Ter(telENV_RPC_FAILED)); + env.close(); + } + { + // ...but a planted "good" skips the crypto, so it applies. + Env env{*this, features}; + env.fund(XRP(10000), Account("alice"), Account("bob")); + env.close(); + + auto jt = buildValidBatch(env); + jt.jv[sfBatchSigners.jsonName][0u][sfBatchSigner.jsonName][sfTxnSignature.jsonName] = + "00"; + auto const txid = STTx{parse(jt.jv)}.getTransactionID(); + env.app().getHashRouter().setFlags(txid, kSfSiggood); + env(jt.jv, Ter(tesSUCCESS)); + env.close(); + } + } + void testWithFeats(FeatureBitset features) { @@ -5038,6 +5898,7 @@ class Batch_test : public beast::unit_test::Suite testIndependent(features); testInnerSubmitRPC(features); testAccountActivation(features); + testCheckAllSignatures(features); testAccountSet(features); testAccountDelete(features); testLoan(features); @@ -5053,8 +5914,13 @@ class Batch_test : public beast::unit_test::Suite testBatchTxQueue(features); testBatchNetworkOps(features); testBatchDelegate(features); + testBatchDelegateConsent(features); testValidateRPCResponse(features); testBatchCalculateBaseFee(features); + testStandaloneInnerBatchFlag(features); + testOuterBinding(features); + testUnsortedBatchSigners(features); + testBatchSigCache(features); } public: @@ -5064,7 +5930,6 @@ public: using namespace test::jtx; auto const sa = testableAmendments(); - testWithFeats(sa - fixBatchInnerSigs); testWithFeats(sa); } }; diff --git a/src/test/app/ConfidentialTransferExtended_test.cpp b/src/test/app/ConfidentialTransferExtended_test.cpp index 0aee7516c9..953325a6e9 100644 --- a/src/test/app/ConfidentialTransferExtended_test.cpp +++ b/src/test/app/ConfidentialTransferExtended_test.cpp @@ -1945,7 +1945,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env.close(); auto const bobSeq = env.seq(bob); - auto const batchFee = batch::calcConfidentialBatchFee(env, 0, 2); + auto const batchFee = batch::calcConfidentialBatchFee(env, 1, 2); // jv1: proof against spending balance 100 auto jv1 = mpt.sendJV({.account = bob, .dest = carol, .amt = 60}, bobSeq + 1); @@ -1957,6 +1957,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env(batch::outer(bob, bobSeq, batchFee, tfAllOrNothing), batch::Inner(jv1, bobSeq + 1), batch::Inner(jv2, bobSeq + 2), + batch::Sig(dave), Ter(tesSUCCESS)); env.close(); @@ -1981,7 +1982,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env.close(); auto const bobSeq = env.seq(bob); - auto const batchFee = batch::calcConfidentialBatchFee(env, 0, 2); + auto const batchFee = batch::calcConfidentialBatchFee(env, 1, 2); // jv1: proof against spending balance 100. auto jv1 = mpt.sendJV({.account = bob, .dest = carol, .amt = 40}, bobSeq + 1); @@ -1994,6 +1995,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env(batch::outer(bob, bobSeq, batchFee, tfAllOrNothing), batch::Inner(jv1, bobSeq + 1), batch::Inner(jv2, bobSeq + 2), + batch::Sig(dave), Ter(tesSUCCESS)); env.close(); @@ -2029,7 +2031,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase auto const bobSeq = env.seq(bob); auto const carolSeq = env.seq(carol); - auto const batchFee = batch::calcConfidentialBatchFee(env, 1, 2); + auto const batchFee = batch::calcConfidentialBatchFee(env, 2, 2); // jv1: direct send from carol (valid proof). auto const jv1 = mpt.sendJV({.account = carol, .dest = dave, .amt = 30}, carolSeq); @@ -2040,7 +2042,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env(batch::outer(bob, bobSeq, batchFee, tfAllOrNothing), batch::Inner(jv1, carolSeq), batch::Inner(jv2, bobSeq + 1), - batch::Sig(carol), + batch::Sig(carol, dave), Ter(tesSUCCESS)); env.close(); @@ -2066,7 +2068,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase // Bob does not grant dave any permissions. auto const bobSeq = env.seq(bob); auto const carolSeq = env.seq(carol); - auto const batchFee = batch::calcConfidentialBatchFee(env, 1, 2); + auto const batchFee = batch::calcConfidentialBatchFee(env, 2, 2); auto jv1 = mpt.sendJV({.account = bob, .dest = carol, .amt = 50}, bobSeq + 1); jv1[jss::Delegate] = dave.human(); @@ -2075,7 +2077,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env(batch::outer(bob, bobSeq, batchFee, tfIndependent), batch::Inner(jv1, bobSeq + 1), batch::Inner(jv2, carolSeq), - batch::Sig(carol), + batch::Sig(carol, dave), Ter(tesSUCCESS)); env.close(); @@ -2093,8 +2095,9 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase testcase("Test batch delegated send with delegate as outer account"); using namespace test::jtx; - // Dave has delegation permission, but the inner Account is bob. - // Without bob's BatchSigner, the batch is rejected. + // Dave holds bob's ConfidentialMPTSend delegation and is the outer batch + // signer, so dave's outer signature consents to the delegated inner. + // The batch applies. { Env env{*this, features}; Account const alice("alice"); @@ -2119,11 +2122,11 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase env(batch::outer(dave, daveSeq, batchFee, tfAllOrNothing), batch::Inner(jv1, bobSeq), batch::Inner(jv2, daveSeq + 1), - Ter(temBAD_SIGNER)); + Ter(tesSUCCESS)); env.close(); - BEAST_EXPECT(mpt.getDecryptedBalance(bob, MPTTester::holderEncryptedSpending) == 100); - BEAST_EXPECT(mpt.getDecryptedBalance(carol, MPTTester::holderEncryptedInbox) == 0); + BEAST_EXPECT(mpt.getDecryptedBalance(bob, MPTTester::holderEncryptedSpending) == 60); + BEAST_EXPECT(mpt.getDecryptedBalance(carol, MPTTester::holderEncryptedInbox) == 40); } // Dave submits a mixed batch: bob signs inner tx1, and @@ -2163,8 +2166,10 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase BEAST_EXPECT(mpt.getDecryptedBalance(carol, MPTTester::holderEncryptedInbox) == 70); } - // Verify the delegator Bob's BatchSigner does not bypass the missing delegation permission. - // The delegated inner send fails. + // The delegated inner's required signer is the delegate (dave), not bob. + // Bob signs but is not a required signer, so the batch is rejected as an + // extra signer. The delegator's signature cannot stand in for the + // delegate's. { Env env{*this, features}; Account const alice("alice"); @@ -2189,7 +2194,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase batch::Inner(jv1, bobSeq), batch::Inner(jv2, carolSeq), batch::Sig(bob, carol), - Ter(tesSUCCESS)); + Ter(temBAD_SIGNER)); env.close(); // jv1 fails before jv2 is attempted. @@ -2257,7 +2262,7 @@ class ConfidentialTransferExtended_test : public ConfidentialTransferTestBase batch::Inner(jv4, frankSeq), batch::Inner(jv5, frankSeq + 1), batch::Inner(jv6, bobSeq + 2), - batch::Sig(bob, carol, frank), + batch::Sig(erin, frank), Ter(tesSUCCESS)); env.close(); diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index 2422db05de..ed99817f34 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -1,12 +1,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -36,6 +38,8 @@ #include #include #include +#include +#include #include #include #include @@ -68,7 +72,7 @@ namespace xrpl::test { struct LedgerReplay_test : public beast::unit_test::Suite { void - run() override + testReplayLedger() { testcase("Replay ledger"); @@ -91,6 +95,45 @@ struct LedgerReplay_test : public beast::unit_test::Suite BEAST_EXPECT(replayed->header().hash == lastClosed->header().hash); } + + void + testReplayBatchLedger() + { + testcase("Replay ledger with batch transactions"); + + using namespace jtx; + + Env env(*this, testableAmendments()); + + auto const alice = Account("alice"); + auto const bob = Account("bob"); + env.fund(XRP(100000), alice, bob); + env.close(); + + auto const seq = env.seq(alice); + auto const batchFee = batch::calcBatchFee(env, 0, 2); + env(batch::outer(alice, seq, batchFee, tfAllOrNothing), + batch::Inner(pay(alice, bob, XRP(1)), seq + 1), + batch::Inner(pay(alice, bob, XRP(2)), seq + 2), + Ter(tesSUCCESS)); + env.close(); + + LedgerMaster& ledgerMaster = env.app().getLedgerMaster(); + auto const lastClosed = ledgerMaster.getClosedLedger(); + auto const lastClosedParent = ledgerMaster.getLedgerByHash(lastClosed->header().parentHash); + + auto const replayed = buildLedger( + LedgerReplay(lastClosedParent, lastClosed), TapNone, env.app(), env.journal); + + BEAST_EXPECT(replayed->header().hash == lastClosed->header().hash); + } + + void + run() override + { + testReplayLedger(); + testReplayBatchLedger(); + } }; enum class InboundLedgersBehavior { diff --git a/src/test/app/TxQ_test.cpp b/src/test/app/TxQ_test.cpp index 2d10eb4beb..91eb26da7e 100644 --- a/src/test/app/TxQ_test.cpp +++ b/src/test/app/TxQ_test.cpp @@ -61,8 +61,7 @@ namespace xrpl::test { class TxQPosNegFlows_test : public beast::unit_test::Suite { - // Same as corresponding values from TxQ.h - static constexpr FeeLevel64 kBaseFeeLevel{256}; + static constexpr FeeLevel64 kBaseFeeLevel{TxQ::kBaseLevel}; static constexpr FeeLevel64 kMinEscalationFeeLevel = kBaseFeeLevel * 500; static void diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 0e35e6b9ec..34532b17f7 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -731,8 +731,8 @@ create(jtx::Account const& account, jtx::Account const& dest, STAmount const& se } // namespace check -static constexpr FeeLevel64 kBaseFeeLevel{TxQ::kBaseLevel}; -static constexpr FeeLevel64 kMinEscalationFeeLevel = kBaseFeeLevel * 500; +inline constexpr FeeLevel64 kBaseFeeLevel{TxQ::kBaseLevel}; +inline constexpr FeeLevel64 kMinEscalationFeeLevel = kBaseFeeLevel * 500; inline uint256 getCheckIndex(AccountID const& account, std::uint32_t uSequence) diff --git a/src/test/jtx/batch.h b/src/test/jtx/batch.h index 0e78d409fa..4d564f150a 100644 --- a/src/test/jtx/batch.h +++ b/src/test/jtx/batch.h @@ -58,7 +58,6 @@ class Inner { private: json::Value txn_; - std::uint32_t seq_; std::optional ticket_; public: @@ -66,10 +65,10 @@ public: json::Value txn, std::uint32_t const& sequence, std::optional const& ticket = std::nullopt) - : txn_(std::move(txn)), seq_(sequence), ticket_(ticket) + : txn_(std::move(txn)), ticket_(ticket) { txn_[jss::SigningPubKey] = ""; - txn_[jss::Sequence] = seq_; + txn_[jss::Sequence] = sequence; txn_[jss::Fee] = "0"; txn_[jss::Flags] = txn_[jss::Flags].asUInt() | tfInnerBatchTxn; diff --git a/src/test/jtx/impl/batch.cpp b/src/test/jtx/impl/batch.cpp index 66ca0c7d54..b1061f65a3 100644 --- a/src/test/jtx/impl/batch.cpp +++ b/src/test/jtx/impl/batch.cpp @@ -99,7 +99,13 @@ Sig::operator()(Env& env, JTx& jt) const jo[jss::SigningPubKey] = strHex(e.sig.pk().slice()); Serializer msg; - serializeBatch(msg, stx.getFlags(), stx.getBatchTransactionIDs()); + serializeBatch( + msg, + stx.getAccountID(sfAccount), + stx.getSeqValue(), + stx.getFlags(), + stx.getBatchTransactionIDs()); + finishMultiSigningData(e.acct.id(), msg); // NOLINTNEXTLINE(bugprone-unchecked-optional-access) auto const sig = xrpl::sign(*publicKeyType(e.sig.pk().slice()), e.sig.sk(), msg.slice()); jo[sfTxnSignature.getJsonName()] = strHex(Slice{sig.data(), sig.size()}); @@ -137,7 +143,13 @@ Msig::operator()(Env& env, JTx& jt) const iso[jss::SigningPubKey] = strHex(e.sig.pk().slice()); Serializer msg; - serializeBatch(msg, stx.getFlags(), stx.getBatchTransactionIDs()); + serializeBatch( + msg, + stx.getAccountID(sfAccount), + stx.getSeqValue(), + stx.getFlags(), + stx.getBatchTransactionIDs()); + msg.addBitString(master.id()); finishMultiSigningData(e.acct.id(), msg); // NOLINTNEXTLINE(bugprone-unchecked-optional-access) auto const sig = xrpl::sign(*publicKeyType(e.sig.pk().slice()), e.sig.sk(), msg.slice()); diff --git a/src/test/rpc/Feature_test.cpp b/src/test/rpc/Feature_test.cpp index 8cda5965cb..a36e51cb6f 100644 --- a/src/test/rpc/Feature_test.cpp +++ b/src/test/rpc/Feature_test.cpp @@ -134,7 +134,7 @@ class Feature_test : public beast::unit_test::Suite // or removed, swap out for any other feature. BEAST_EXPECT( featureToName(fixRemoveNFTokenAutoTrustLine) == "fixRemoveNFTokenAutoTrustLine"); - BEAST_EXPECT(featureToName(featureBatch) == "Batch"); + BEAST_EXPECT(featureToName(featureBatchV1_1) == "BatchV1_1"); BEAST_EXPECT(featureToName(featureDID) == "DID"); BEAST_EXPECT(featureToName(fixIncludeKeyletFields) == "fixIncludeKeyletFields"); BEAST_EXPECT(featureToName(featureTokenEscrow) == "TokenEscrow"); diff --git a/src/test/rpc/Simulate_test.cpp b/src/test/rpc/Simulate_test.cpp index 5ea79c3996..0d00360a58 100644 --- a/src/test/rpc/Simulate_test.cpp +++ b/src/test/rpc/Simulate_test.cpp @@ -420,6 +420,20 @@ class Simulate_test : public beast::unit_test::Suite BEAST_EXPECT( resp[jss::result][jss::error_message] == "Transaction should not be signed."); } + { + // tfInnerBatchTxn flag on top-level transaction + json::Value params; + json::Value txJson{json::ValueType::Object}; + txJson[jss::TransactionType] = jss::AccountSet; + txJson[jss::Account] = env.master.human(); + txJson[jss::Flags] = tfInnerBatchTxn; + params[jss::tx_json] = txJson; + + auto const resp = env.rpc("json", "simulate", to_string(params)); + BEAST_EXPECT( + resp[jss::result][jss::error_message] == + "tfInnerBatchTxn flag is not allowed on top-level transactions."); + } } void @@ -476,7 +490,7 @@ class Simulate_test : public beast::unit_test::Suite auto jt = env.jtnofill( batch::outer(alice, env.seq(alice), batchFee, tfAllOrNothing), batch::Inner(pay(alice, bob, XRP(10)), seq + 1), - batch::Inner(pay(alice, bob, XRP(10)), seq + 1)); + batch::Inner(pay(alice, bob, XRP(10)), seq + 2)); jt.jv.removeMember(jss::TxnSignature); json::Value params; diff --git a/src/xrpld/app/ledger/detail/BuildLedger.cpp b/src/xrpld/app/ledger/detail/BuildLedger.cpp index 2eb64ecaf9..038a7be4b7 100644 --- a/src/xrpld/app/ledger/detail/BuildLedger.cpp +++ b/src/xrpld/app/ledger/detail/BuildLedger.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -233,7 +234,15 @@ buildLedger( j, [&](OpenView& accum, std::shared_ptr const& built) { for (auto& tx : replayData.orderedTxns()) + { + // Inner batch transactions are applied as part of their outer + // Batch transaction, never on their own. Skip them here so they + // are not re-applied a second time outside of the batch during + // replay. + if (tx.second->isFlag(tfInnerBatchTxn)) + continue; applyTransaction(app, accum, *tx.second, false, applyFlags, j); + } }); } diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 1802441a66..82445f3625 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -1253,8 +1253,9 @@ NetworkOPsImp::submitTransaction(std::shared_ptr const& iTrans) return; } - // Enforce Network bar for batch txn - if (iTrans->isFlag(tfInnerBatchTxn) && ledgerMaster_.getValidatedRules().enabled(featureBatch)) + // Reject any transaction with the tfInnerBatchTxn flag at the network + // boundary, regardless of amendment state. + if (iTrans->isFlag(tfInnerBatchTxn)) { JLOG(journal_.error()) << "Submitted transaction invalid: tfInnerBatchTxn flag present."; return; @@ -1320,7 +1321,7 @@ NetworkOPsImp::preProcessTransaction(std::shared_ptr& transaction) // under no circumstances will we ever accept an inner txn within a batch // txn from the network. auto const sttx = *transaction->getSTransaction(); - if (sttx.isFlag(tfInnerBatchTxn) && view->rules().enabled(featureBatch)) + if (sttx.isFlag(tfInnerBatchTxn)) { transaction->setStatus(TransStatus::INVALID); transaction->setResult(temINVALID_FLAG); diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index ec5ac569d6..7e57302d23 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -390,6 +391,12 @@ TxQ::canBeHeld( std::optional const& replacementIter, std::scoped_lock const& lock) { + // A Batch is never queued: its inner transactions can change the sequence + // numbers of multiple accounts, which the TxQ's per-account model cannot + // forecast. It must apply straight to the open ledger or not at all. + if (tx.getTxnType() == ttBATCH) + return telCAN_NOT_QUEUE; + // PreviousTxnID is deprecated and should never be used. // AccountTxnID is not supported by the transaction // queue yet, but should be added in the future. diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index e1d7d23215..5ac61cfd91 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -1309,7 +1309,7 @@ PeerImp::handleTransaction( // Charge strongly for attempting to relay a txn with tfInnerBatchTxn // LCOV_EXCL_START /* - There is no need to check whether the featureBatch amendment is + There is no need to check whether the featureBatchV1_1 amendment is enabled. * If the `tfInnerBatchTxn` flag is set, and the amendment is @@ -2873,7 +2873,7 @@ PeerImp::checkTransaction( // charge strongly for relaying batch txns // LCOV_EXCL_START /* - There is no need to check whether the featureBatch amendment is + There is no need to check whether the featureBatchV1_1 amendment is enabled. * If the `tfInnerBatchTxn` flag is set, and the amendment is diff --git a/src/xrpld/rpc/handlers/transaction/Simulate.cpp b/src/xrpld/rpc/handlers/transaction/Simulate.cpp index 7ee28c4886..2a6c2280e3 100644 --- a/src/xrpld/rpc/handlers/transaction/Simulate.cpp +++ b/src/xrpld/rpc/handlers/transaction/Simulate.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -355,6 +356,13 @@ doSimulate(RPC::JsonContext& context) return RPC::makeError(RpcNotImpl); } + // Reject transactions with the tfInnerBatchTxn flag. + if (stTx->isFlag(tfInnerBatchTxn)) + { + return RPC::makeError( + RpcInvalidParams, "tfInnerBatchTxn flag is not allowed on top-level transactions."); + } + std::string reason; auto transaction = std::make_shared(stTx, reason, context.app); // Actually run the transaction through the transaction processor From ea13be81b7037ce0a03c706e5b916b0beb581496 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:21:23 +0200 Subject: [PATCH 03/10] feat: Add an invariant to ensure object deletion also deletes its pseudo-account (#7445) Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com> --- include/xrpl/tx/invariants/InvariantCheck.h | 26 +++- src/libxrpl/tx/invariants/InvariantCheck.cpp | 95 +++++++++++-- src/test/app/Invariants_test.cpp | 142 +++++++++++++++++-- 3 files changed, 242 insertions(+), 21 deletions(-) diff --git a/include/xrpl/tx/invariants/InvariantCheck.h b/include/xrpl/tx/invariants/InvariantCheck.h index 8931d189fd..ba91cba064 100644 --- a/include/xrpl/tx/invariants/InvariantCheck.h +++ b/include/xrpl/tx/invariants/InvariantCheck.h @@ -375,16 +375,35 @@ public: */ class ValidAmounts { - std::vector> afterEntries_; + std::vector afterEntries_; public: void - visitEntry(bool, std::shared_ptr const&, std::shared_ptr const&); + visitEntry(bool, SLE::const_ref, SLE::const_ref); [[nodiscard]] bool finalize(STTx const&, TER const, XRPAmount const, ReadView const&, beast::Journal const&) const; }; +/* + * Verify that when an object with an associated pseudo-account is deleted, + * its pseudo-account is also deleted. + * + * The reverse (pseudo-account deleted → object deleted) is enforced by + * AccountRootsDeletedClean via getPseudoAccountFields(). + */ +class ObjectHasPseudoAccount +{ +public: + void + visitEntry(bool, SLE::const_ref, SLE::const_ref); + + [[nodiscard]] bool + finalize(STTx const&, TER const, XRPAmount const, ReadView const&, beast::Journal const&) const; + +private: + std::vector deletedObjSles_; +}; // additional invariant checks can be declared above and then added to this // tuple using InvariantChecks = std::tuple< @@ -416,7 +435,8 @@ using InvariantChecks = std::tuple< ValidConfidentialMPToken, ValidMPTPayment, ValidAmounts, - ValidMPTTransfer>; + ValidMPTTransfer, + ObjectHasPseudoAccount>; /** * @brief get a tuple of all invariant checks diff --git a/src/libxrpl/tx/invariants/InvariantCheck.cpp b/src/libxrpl/tx/invariants/InvariantCheck.cpp index 308342da74..32df44a96b 100644 --- a/src/libxrpl/tx/invariants/InvariantCheck.cpp +++ b/src/libxrpl/tx/invariants/InvariantCheck.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include namespace xrpl { @@ -63,6 +64,23 @@ hasPrivilege(STTx const& tx, Privilege priv) #undef TRANSACTION #pragma pop_macro("TRANSACTION") +// Returns the human-readable name of a ledger entry's type, falling back to +// the numeric type if the format is somehow unknown. +static std::string +ledgerEntryTypeName(SLE const& sle) +{ + auto const item = LedgerFormats::getInstance().findByType(sle.getType()); + + if (item == nullptr) + { + // LCOV_EXCL_START + UNREACHABLE("xrpl::ledgerEntryTypeName : ledger entry has no known ledger format"); + return std::to_string(sle.getType()); + // LCOV_EXCL_STOP + } + return item->getName(); +} + void TransactionFeeCheck::visitEntry(bool, SLE::const_ref, SLE::const_ref) { @@ -457,16 +475,8 @@ AccountRootsDeletedClean::finalize( if (auto const sle = view.read(keylet)) { // Finding the object is bad - auto const typeName = [&sle]() { - auto item = LedgerFormats::getInstance().findByType(sle->getType()); - - if (item != nullptr) - return item->getName(); - return std::to_string(sle->getType()); - }(); - - JLOG(j.fatal()) << "Invariant failed: account deletion left behind a " << typeName - << " object"; + JLOG(j.fatal()) << "Invariant failed: account deletion left behind a " + << ledgerEntryTypeName(*sle) << " object"; // The comment above starting with "assert(enforce)" explains this // assert. XRPL_ASSERT( @@ -1070,4 +1080,69 @@ ValidAmounts::finalize( return true; } +void +ObjectHasPseudoAccount::visitEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) +{ + if (!isDelete) + return; + + // Before should never be null when isDelete = true + if (!before) + { + // LCOV_EXCL_START + UNREACHABLE( + "xrpl::ObjectHasPseudoAccount::visitEntry : deleted ledger entry missing before state"); + return; + // LCOV_EXCL_STOP + } + + switch (before->getType()) + { + case ltAMM: + case ltVAULT: + case ltLOAN_BROKER: + deletedObjSles_.push_back(before); + break; + default: + return; + } +} + +[[nodiscard]] bool +ObjectHasPseudoAccount::finalize( + STTx const&, + TER const, + XRPAmount const, + ReadView const& view, + beast::Journal const& j) const +{ + if (!view.rules().enabled(fixCleanup3_3_0)) + return true; + + if (deletedObjSles_.empty()) + return true; + + bool failed = false; + for (auto const& sle : deletedObjSles_) + { + if (!sle->isFieldPresent(sfAccount)) + { + JLOG(j.fatal()) << "Invariant failed: deleted " << ledgerEntryTypeName(*sle) + << " is missing pseudo-account field"; + failed = true; + continue; + } + + // The pseudo-account must NOT exist on the ledger after the object is deleted. + if (view.exists(keylet::account(sle->getAccountID(sfAccount)))) + { + JLOG(j.fatal()) << "Invariant failed: deleted " << ledgerEntryTypeName(*sle) + << " without deleting its pseudo-account"; + failed = true; + } + } + + return !failed; +} + } // namespace xrpl diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index 9fde52ecb2..079ff9df88 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -2829,7 +2829,8 @@ class Invariants_test : public beast::unit_test::Suite }); doInvariantCheck( - {"vault updated by a wrong transaction type"}, + {"vault updated by a wrong transaction type", + "deleted Vault without deleting its pseudo-account"}, [&](Account const& a1, Account const& a2, ApplyContext& ac) { auto const keylet = keylet::vault(a1.id(), ac.view().seq()); auto sleVault = ac.view().peek(keylet); @@ -2840,7 +2841,7 @@ class Invariants_test : public beast::unit_test::Suite }, XRPAmount{}, STTx{ttPAYMENT, [](STObject&) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, [&](Account const& a1, Account const& a2, Env& env) { Vault const vault{env}; auto [tx, _] = vault.create({.owner = a1, .asset = xrpIssue()}); @@ -2877,6 +2878,7 @@ class Invariants_test : public beast::unit_test::Suite auto const vaultPage = ac.view().dirInsert( keylet::ownerDir(a1.id()), sleVault->key(), describeOwnerDir(a1.id())); sleVault->setFieldU64(sfOwnerNode, *vaultPage); + sleVault->setAccountID(sfAccount, a1.id()); ac.view().insert(sleVault); return true; }, @@ -2885,7 +2887,8 @@ class Invariants_test : public beast::unit_test::Suite {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); doInvariantCheck( - {"vault deleted by a wrong transaction type"}, + {"vault deleted by a wrong transaction type", + "deleted Vault without deleting its pseudo-account"}, [&](Account const& a1, Account const& a2, ApplyContext& ac) { auto const keylet = keylet::vault(a1.id(), ac.view().seq()); auto sleVault = ac.view().peek(keylet); @@ -2896,7 +2899,7 @@ class Invariants_test : public beast::unit_test::Suite }, XRPAmount{}, STTx{ttVAULT_SET, [](STObject&) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, [&](Account const& a1, Account const& a2, Env& env) { Vault const vault{env}; auto [tx, _] = vault.create({.owner = a1, .asset = xrpIssue()}); @@ -2905,7 +2908,8 @@ class Invariants_test : public beast::unit_test::Suite }); doInvariantCheck( - {"vault operation updated more than single vault"}, + {"vault operation updated more than single vault", + "deleted Vault without deleting its pseudo-account"}, [&](Account const& a1, Account const& a2, ApplyContext& ac) { { auto const keylet = keylet::vault(a1.id(), ac.view().seq()); @@ -2925,7 +2929,7 @@ class Invariants_test : public beast::unit_test::Suite }, XRPAmount{}, STTx{ttVAULT_DELETE, [](STObject&) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, [&](Account const& a1, Account const& a2, Env& env) { Vault const vault{env}; { @@ -2949,6 +2953,7 @@ class Invariants_test : public beast::unit_test::Suite auto const vaultPage = ac.view().dirInsert( keylet::ownerDir(a.id()), sleVault->key(), describeOwnerDir(a.id())); sleVault->setFieldU64(sfOwnerNode, *vaultPage); + sleVault->setAccountID(sfAccount, a.id()); ac.view().insert(sleVault); }; insertVault(a1); @@ -2960,7 +2965,8 @@ class Invariants_test : public beast::unit_test::Suite {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); doInvariantCheck( - {"deleted vault must also delete shares"}, + {"deleted vault must also delete shares", + "deleted Vault without deleting its pseudo-account"}, [&](Account const& a1, Account const& a2, ApplyContext& ac) { auto const keylet = keylet::vault(a1.id(), ac.view().seq()); auto sleVault = ac.view().peek(keylet); @@ -2971,7 +2977,7 @@ class Invariants_test : public beast::unit_test::Suite }, XRPAmount{}, STTx{ttVAULT_DELETE, [](STObject&) {}}, - {tecINVARIANT_FAILED, tecINVARIANT_FAILED}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, [&](Account const& a1, Account const& a2, Env& env) { Vault const vault{env}; auto [tx, _] = vault.create({.owner = a1, .asset = xrpIssue()}); @@ -5176,6 +5182,125 @@ class Invariants_test : public beast::unit_test::Suite } } + void + testObjectHasPseudoAccount() + { + testcase << "object has pseudo-account"; + using namespace jtx; + + auto const amendments = defaultAmendments() | fixCleanup3_3_0; + + // Vault: object deleted without its pseudo-account + { + Keylet vaultKeylet = keylet::amendments(); + doInvariantCheck( + Env{*this, amendments}, + {{"deleted Vault without deleting its pseudo-account"}}, + [&vaultKeylet](Account const&, Account const&, ApplyContext& ac) { + auto sle = ac.view().peek(vaultKeylet); + if (!sle) + return false; + ac.view().erase(sle); + return true; + }, + XRPAmount{}, + STTx{ttVAULT_DELETE, [](STObject&) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + [&vaultKeylet](Account const& a1, Account const&, Env& env) { + Vault const vault{env}; + auto [tx, keylet] = vault.create({.owner = a1, .asset = xrpIssue()}); + env(tx); + vaultKeylet = keylet; + return true; + }); + } + + // AMM: object deleted without its pseudo-account + { + uint256 ammID{}; + Account const gw{"gw"}; + doInvariantCheck( + Env{*this, amendments}, + {{"deleted AMM without deleting its pseudo-account"}}, + [&ammID](Account const&, Account const&, ApplyContext& ac) { + auto sle = ac.view().peek(keylet::amm(ammID)); + if (!sle) + return false; + ac.view().erase(sle); + return true; + }, + XRPAmount{}, + STTx{ttAMM_DELETE, [](STObject&) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + [&ammID, &gw](Account const&, Account const&, Env& env) { + env.fund(XRP(1'000), gw); + AMM const amm(env, gw, XRP(100), gw["USD"](100)); + ammID = amm.ammID(); + return true; + }); + } + + // LoanBroker: object deleted without its pseudo-account + { + Keylet loanBrokerKeylet = keylet::amendments(); + doInvariantCheck( + Env{*this, amendments}, + {{"deleted LoanBroker without deleting its pseudo-account"}}, + [&loanBrokerKeylet](Account const&, Account const&, ApplyContext& ac) { + auto sle = ac.view().peek(loanBrokerKeylet); + if (!sle) + return false; + ac.view().erase(sle); + return true; + }, + XRPAmount{}, + STTx{ttLOAN_BROKER_DELETE, [](STObject&) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + [&loanBrokerKeylet, this](Account const& a1, Account const&, Env& env) { + PrettyAsset const xrpAsset{xrpIssue(), 1'000'000}; + loanBrokerKeylet = this->createLoanBroker(a1, env, xrpAsset); + return BEAST_EXPECT(env.le(loanBrokerKeylet)); + }); + } + + // Deleted object missing sfAccount field (defensive check). + // Manually construct the view to place a vault SLE without + // sfAccount into the base ledger, then erase it. + { + Env env{*this, amendments}; + Account const a1{"A1"}; + Account const a2{"A2"}; + env.fund(XRP(1000), a1, a2); + env.close(); + + OpenView ov{*env.current()}; + + auto const vaultKeylet = keylet::vault(a1.id(), ov.seq()); + auto sleVault = std::make_shared(vaultKeylet); + sleVault->makeFieldAbsent(sfAccount); + ov.rawInsert(sleVault); + + STTx const tx{ttVAULT_DELETE, [](STObject&) {}}; + test::StreamSink sink{beast::Severity::Warning}; + beast::Journal const jlog{sink}; + ApplyContext ac{ + env.app(), ov, tx, tesSUCCESS, env.current()->fees().base, TapNone, jlog}; + CurrentTransactionRulesGuard const rulesGuard(ov.rules()); + + auto sle = ac.view().peek(vaultKeylet); + if (!BEAST_EXPECT(sle)) + return; + ac.view().erase(sle); + + auto transactor = makeTransactor(ac); + if (!BEAST_EXPECT(transactor)) + return; + TER const result = transactor->checkInvariants(tesSUCCESS, XRPAmount{}); + BEAST_EXPECT(result == tecINVARIANT_FAILED); + BEAST_EXPECT(sink.messages().str().contains("is missing pseudo-account field")); + } + } + void testConfidentialMPTTransfer() { @@ -5458,6 +5583,7 @@ public: testInvariantOverwrite(defaultAmendments() - fixCleanup3_1_3); testVaultComputeCoarsestScale(); testAMM(); + testObjectHasPseudoAccount(); } }; From 6aed3bb71d2820f081ce2a22666e456420a814b2 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 1 Jul 2026 14:28:14 +0100 Subject: [PATCH 04/10] chore: Update pre-commit hooks && actions (#7686) --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- .github/workflows/reusable-build-test-config.yml | 2 +- .github/workflows/reusable-clang-tidy.yml | 2 +- .github/workflows/upload-conan-deps.yml | 2 +- .pre-commit-config.yaml | 6 +++--- docs/0001-negative-unl/README.md | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 0363534af5..1acd28208e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,7 +14,7 @@ on: jobs: # Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks. run-hooks: - uses: XRPLF/actions/.github/workflows/pre-commit.yml@e06d4138c9ec8dceeb7c818645faa38087ea9e3d + uses: XRPLF/actions/.github/workflows/pre-commit.yml@1bde119a1ab71305ba5d3716e7a82cea1c7bdede with: runs_on: ubuntu-latest container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-41ec7c1" }' diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index bfa8d2e79c..1ac8d61655 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Prepare runner - uses: XRPLF/actions/prepare-runner@9355d190fd7d4de80fadfd161e6edddc9702cd9f + uses: XRPLF/actions/prepare-runner@64ec3cf3b152b4444638f470bbd6df7a7a30c81c with: enable_ccache: false diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index 0cb0219d72..e7a88a0e66 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -113,7 +113,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Prepare runner - uses: XRPLF/actions/prepare-runner@9355d190fd7d4de80fadfd161e6edddc9702cd9f + uses: XRPLF/actions/prepare-runner@64ec3cf3b152b4444638f470bbd6df7a7a30c81c with: enable_ccache: ${{ inputs.ccache_enabled }} diff --git a/.github/workflows/reusable-clang-tidy.yml b/.github/workflows/reusable-clang-tidy.yml index b04847e137..5528f3452e 100644 --- a/.github/workflows/reusable-clang-tidy.yml +++ b/.github/workflows/reusable-clang-tidy.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Prepare runner - uses: XRPLF/actions/prepare-runner@9355d190fd7d4de80fadfd161e6edddc9702cd9f + uses: XRPLF/actions/prepare-runner@64ec3cf3b152b4444638f470bbd6df7a7a30c81c with: enable_ccache: false diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index 88b364c2b1..22ad36d98f 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -68,7 +68,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Prepare runner - uses: XRPLF/actions/prepare-runner@9355d190fd7d4de80fadfd161e6edddc9702cd9f + uses: XRPLF/actions/prepare-runner@64ec3cf3b152b4444638f470bbd6df7a7a30c81c with: enable_ccache: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4cbf4c1dd0..7bac4d1140 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,12 +51,12 @@ repos: exclude: ^include/xrpl/protocol_autogen/(transactions|ledger_entries)/ - repo: https://github.com/BlankSpruce/gersemi-pre-commit - rev: faadd6a9d852369ca94f4d15b2404c967ba8cb01 # frozen: 0.27.6 + rev: e98930bdc210d3387007f9252d8c1694ea7e410f # frozen: 0.27.7 hooks: - id: gersemi - repo: https://github.com/rbubley/mirrors-prettier - rev: 515f543f5718ebfd6ce22e16708bb32c68ff96e1 # frozen: v3.8.3 + rev: 39e2973981e6d2f9b6c543b0086a2d2393abdc89 # frozen: v3.9.4 hooks: - id: prettier args: [--end-of-line=auto] @@ -86,7 +86,7 @@ repos: files: \.md$ - repo: https://github.com/streetsidesoftware/cspell-cli - rev: 4643f154907327ee0a2c7038f0296e0dd77d9776 # frozen: v10.0.0 + rev: ea11f9efc0bec520073405bc30552da887ba71bc # frozen: v10.0.1 hooks: - id: cspell # Spell check changed files exclude: | diff --git a/docs/0001-negative-unl/README.md b/docs/0001-negative-unl/README.md index dd5f9af2ae..0bc65cd860 100644 --- a/docs/0001-negative-unl/README.md +++ b/docs/0001-negative-unl/README.md @@ -288,7 +288,7 @@ components with non-trivial changes are colored green. validated. ![Sequence diagram](./negativeUNL_highLevel_sequence.png?raw=true "Negative UNL - Changes") +Changes") ## Roads Not Taken From 6d0b758a12eeb24b3c980d4673be3673040fdc63 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 1 Jul 2026 14:28:41 +0100 Subject: [PATCH 05/10] build: Don't reuse binaries between different C++ versions (#7681) --- conan/profiles/default | 12 +++++++----- conan/profiles/sanitizers | 10 +++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/conan/profiles/default b/conan/profiles/default index e0a88ebca1..ae6e23c3c3 100644 --- a/conan/profiles/default +++ b/conan/profiles/default @@ -10,16 +10,18 @@ os={{ os }} arch={{ arch }} build_type=Debug -compiler={{compiler}} +compiler={{ compiler }} compiler.version={{ compiler_version }} compiler.cppstd=23 {% if os == "Windows" %} compiler.runtime=static {% else %} -compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}} +compiler.libcxx={{ detect_api.detect_libcxx(compiler, version, compiler_exe) }} {% endif %} [conf] -{% if compiler == "gcc" and compiler_version < 13 %} -tools.build:cxxflags+=['-Wno-restrict'] -{% endif %} +{# By default, Conan tries to reuse binaries built with different cppstd versions. #} +{# We want to avoid that to improve reproduceability, so we add the cppstd version to the package ID. #} +{# More info: https://docs.conan.io/2/reference/extensions/binary_compatibility.html #} +user.package:cppstd_version=23 +tools.info.package_id:confs+=["user.package:cppstd_version"] diff --git a/conan/profiles/sanitizers b/conan/profiles/sanitizers index 083807ea9e..09e6aef02b 100644 --- a/conan/profiles/sanitizers +++ b/conan/profiles/sanitizers @@ -87,15 +87,15 @@ include(default) {% endif %} [conf] -tools.build:defines+={{defines}} -tools.build:cxxflags+={{sanitizer_compiler_flags}} -tools.build:sharedlinkflags+={{sanitizer_linker_flags}} -tools.build:exelinkflags+={{sanitizer_linker_flags}} +tools.build:defines+={{ defines }} +tools.build:cxxflags+={{ sanitizer_compiler_flags }} +tools.build:sharedlinkflags+={{ sanitizer_linker_flags }} +tools.build:exelinkflags+={{ sanitizer_linker_flags }} tools.info.package_id:confs+=["tools.build:cxxflags", "tools.build:exelinkflags", "tools.build:sharedlinkflags", "tools.build:defines"] # &: means "apply only to the consumer/root package" -&:tools.cmake.cmaketoolchain:extra_variables={"SANITIZERS": "{{sanitizers}}", "SANITIZERS_COMPILER_FLAGS": "{{sanitizer_compiler_flags | join(' ')}}", "SANITIZERS_LINKER_FLAGS": "{{sanitizer_linker_flags | join(' ')}}"} +&:tools.cmake.cmaketoolchain:extra_variables={"SANITIZERS": "{{ sanitizers }}", "SANITIZERS_COMPILER_FLAGS": "{{ sanitizer_compiler_flags | join(' ') }}", "SANITIZERS_LINKER_FLAGS": "{{ sanitizer_linker_flags | join(' ') }}"} [options] {% if enable_asan %} From ba739c94ce184933e728295527131242317acb9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 09:29:06 -0400 Subject: [PATCH 06/10] ci: [DEPENDABOT] bump actions/setup-python from 6.2.0 to 6.3.0 (#7657) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/reusable-package.yml | 2 +- .github/workflows/reusable-strategy-matrix.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-package.yml b/.github/workflows/reusable-package.yml index 249e807592..6feecbfb75 100644 --- a/.github/workflows/reusable-package.yml +++ b/.github/workflows/reusable-package.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: "3.13" diff --git a/.github/workflows/reusable-strategy-matrix.yml b/.github/workflows/reusable-strategy-matrix.yml index c1a1c1a78b..690aa3d423 100644 --- a/.github/workflows/reusable-strategy-matrix.yml +++ b/.github/workflows/reusable-strategy-matrix.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: "3.13" From d1ff948244cb8b3027a74851466e8816f7940a90 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 1 Jul 2026 14:30:03 +0100 Subject: [PATCH 07/10] test: Add tests for TMProofPathResponse and TMReplayDeltaResponse invalid hash/key sizes (#7593) --- src/test/app/LedgerReplay_test.cpp | 62 ++++++++++++++++++++++++++++++ src/test/basics/base_uint_test.cpp | 18 +++++++++ 2 files changed, 80 insertions(+) diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index ed99817f34..da98c03380 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -982,6 +982,46 @@ struct LedgerReplayer_test : public beast::unit_test::Suite BEAST_EXPECT(!reply->has_error()); BEAST_EXPECT(server.msgHandler.processProofPathResponse(reply)); + { + // bad reply: invalid hash/key sizes + { + // reply with undersized ledgerhash (31 bytes) + auto bad = std::make_shared(*reply); + bad->set_ledgerhash(std::string(31, '\x01')); + BEAST_EXPECT(!server.msgHandler.processProofPathResponse(bad)); + } + { + // reply with oversized ledgerhash (33 bytes) + auto bad = std::make_shared(*reply); + bad->set_ledgerhash(std::string(33, '\x01')); + BEAST_EXPECT(!server.msgHandler.processProofPathResponse(bad)); + } + { + // reply with empty ledgerhash + auto bad = std::make_shared(*reply); + bad->set_ledgerhash(std::string()); + BEAST_EXPECT(!server.msgHandler.processProofPathResponse(bad)); + } + { + // reply with undersized key (31 bytes) + auto bad = std::make_shared(*reply); + bad->set_key(std::string(31, '\x01')); + BEAST_EXPECT(!server.msgHandler.processProofPathResponse(bad)); + } + { + // reply with oversized key (33 bytes) + auto bad = std::make_shared(*reply); + bad->set_key(std::string(33, '\x01')); + BEAST_EXPECT(!server.msgHandler.processProofPathResponse(bad)); + } + { + // reply with empty key + auto bad = std::make_shared(*reply); + bad->set_key(std::string()); + BEAST_EXPECT(!server.msgHandler.processProofPathResponse(bad)); + } + } + { // bad reply // bad header @@ -1031,6 +1071,28 @@ struct LedgerReplayer_test : public beast::unit_test::Suite BEAST_EXPECT(!reply->has_error()); BEAST_EXPECT(server.msgHandler.processReplayDeltaResponse(reply)); + { + // bad reply: invalid hash sizes + { + // reply with undersized ledgerhash (31 bytes) + auto bad = std::make_shared(*reply); + bad->set_ledgerhash(std::string(31, '\x01')); + BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(bad)); + } + { + // reply with oversized ledgerhash (33 bytes) + auto bad = std::make_shared(*reply); + bad->set_ledgerhash(std::string(33, '\x01')); + BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(bad)); + } + { + // reply with empty ledgerhash + auto bad = std::make_shared(*reply); + bad->set_ledgerhash(std::string()); + BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(bad)); + } + } + { // bad reply // bad header diff --git a/src/test/basics/base_uint_test.cpp b/src/test/basics/base_uint_test.cpp index 5816b4eb59..c6572a0028 100644 --- a/src/test/basics/base_uint_test.cpp +++ b/src/test/basics/base_uint_test.cpp @@ -117,11 +117,29 @@ struct base_uint_test : beast::unit_test::Suite } } + void + testFromRawSizeMismatch() + { + testcase("base_uint: fromRaw size mismatch"); + + // Container larger than the base_uint (16 bytes vs 12 bytes for test96). + // Only the first 12 bytes are copied; the extra bytes are ignored. + { + Blob const tooBig{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; + test96 const result = test96::fromRaw(tooBig); + BEAST_EXPECT(to_string(result) == "0102030405060708090A0B0C"); + } + } + void run() override { testcase("base_uint: general purpose tests"); +#ifdef NDEBUG + testFromRawSizeMismatch(); +#endif + static_assert(!std::is_constructible_v>); static_assert(!std::is_assignable_v>); From 0d149ba5b621d7ae6210c8ed005c3109a4782413 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:04:38 +0200 Subject: [PATCH 08/10] fix: Disable AMM creation with Vault shares (#7666) --- include/xrpl/ledger/helpers/MPTokenHelpers.h | 9 + include/xrpl/ledger/helpers/TokenHelpers.h | 32 +- src/libxrpl/ledger/helpers/TokenHelpers.cpp | 61 +- src/libxrpl/tx/invariants/MPTInvariant.cpp | 25 +- src/libxrpl/tx/transactors/dex/AMMCreate.cpp | 17 + src/test/app/AMMMPT_test.cpp | 176 +----- src/test/app/Invariants_test.cpp | 217 ++----- src/test/app/Vault_test.cpp | 619 ++++++++++--------- 8 files changed, 495 insertions(+), 661 deletions(-) diff --git a/include/xrpl/ledger/helpers/MPTokenHelpers.h b/include/xrpl/ledger/helpers/MPTokenHelpers.h index c709badab8..b7f87337cf 100644 --- a/include/xrpl/ledger/helpers/MPTokenHelpers.h +++ b/include/xrpl/ledger/helpers/MPTokenHelpers.h @@ -23,6 +23,15 @@ namespace xrpl { [[nodiscard]] bool isGlobalFrozen(ReadView const& view, MPTIssue const& mptIssue); +/** Returns true if @p account's MPToken for @p mptIssue carries the + * individual-lock flag (lsfMPTLocked). + * + * @warning This checks only the raw per-holder lock bit. It does **not** + * perform the transitive vault pseudo-account check: if @p mptIssue is a + * vault share whose underlying asset is frozen, this function returns false. + * Call @ref isFrozen instead when determining whether an account may send or + * receive tokens — it combines isIndividualFrozen, isGlobalFrozen, and + * isVaultPseudoAccountFrozen into a single complete check. */ [[nodiscard]] bool isIndividualFrozen(ReadView const& view, AccountID const& account, MPTIssue const& mptIssue); diff --git a/include/xrpl/ledger/helpers/TokenHelpers.h b/include/xrpl/ledger/helpers/TokenHelpers.h index 0c9871cd76..c8a67f776a 100644 --- a/include/xrpl/ledger/helpers/TokenHelpers.h +++ b/include/xrpl/ledger/helpers/TokenHelpers.h @@ -144,19 +144,18 @@ checkDeepFrozen(ReadView const& view, AccountID const& account, Asset const& ass * * Otherwise checks, in order: * 1. If the asset is globally frozen the remaining checks are redundant. - * 2. For MPT shares: The pseudo-account's vault share must not be transitively frozen via its - * underlying asset. - * 3. The pseudo-account's trustline / MPToken must not be frozen for sending. - * 4. Skipped when submitter == dst (self-withdrawal); a regular freeze should not prevent - * recovering one's own funds. - * 5. The destination must not be deep-frozen (cannot receive under any circumstance). + * 2. The pseudo-account's trustline / MPToken must not be individually frozen for sending. + * 3. The submitter's trustline / MPToken must not be individually frozen. Skipped when + * submitter == dst (self-withdrawal) so a regular freeze does not prevent recovering one's own + * funds. (Enforced as defensive code; no current caller exercises a frozen submitter ≠ dst.) + * 4. The destination must not be deep-frozen. * - * For IOUs a regular individual freeze on the withdrawer does NOT block self-withdrawal; only deep - * freeze does. For MPTs "locked" is equivalent to deep-frozen, so locked MPT holders are always + * For IOUs a regular individual freeze on the submitter does NOT block self-withdrawal; only deep + * freeze does. For MPTs "locked" is equivalent to deep-frozen, so locked MPT holders are always * blocked. * * @param view Ledger view to read freeze state from. - * @param srcAcct Pseudo-account the funds are withdrawn from (sender). + * @param pseudoAcct Pseudo-account the funds are withdrawn from (sender). * @param submitterAcct Account that submitted the withdrawal transaction. * @param dstAcct Account receiving the withdrawn funds. * @param asset Asset being withdrawn. @@ -166,7 +165,7 @@ checkDeepFrozen(ReadView const& view, AccountID const& account, Asset const& ass [[nodiscard]] TER checkWithdrawFreeze( ReadView const& view, - AccountID const& srcAcct, + AccountID const& pseudoAcct, AccountID const& submitterAcct, AccountID const& dstAcct, Asset const& asset); @@ -175,20 +174,17 @@ checkWithdrawFreeze( * Checks freeze compliance for depositing an asset into a pseudo-account (e.g. Vault, AMM, * LoanBroker). * - * * Checks, in order: * 1. If the asset is globally frozen the remaining checks are redundant. - * 2. For MPT shares: the pseudo-account's vault share must not be transitively frozen via its - * underlying asset (returns tecLOCKED). - * 3. The depositor must not be individually frozen. Skipped when srcAcct is the asset issuer, - * since the issuer can always send its own asset. - * 4. The pseudo-account must not be individually frozen for the asset. Unlike regular accounts, + * 2. The depositor must not be individually frozen for the asset. Skipped when srcAcct is the + * asset issuer, since the issuer can always send its own asset. + * 3. The pseudo-account must not be individually frozen for the asset. Unlike regular accounts, * pseudo-accounts cannot receive deposits under a regular freeze because the deposited funds * could not later be withdrawn. * * @param view Ledger view to read freeze state from. * @param srcAcct Depositor sending the funds. - * @param dstAcct Pseudo-account receiving the deposit. + * @param pseudoAcct Pseudo-account receiving the deposit. * @param asset Asset being deposited. * @return tesSUCCESS if the deposit is permitted, otherwise a freeze result * (tecFROZEN for IOUs, tecLOCKED for MPTs). @@ -197,7 +193,7 @@ checkWithdrawFreeze( checkDepositFreeze( ReadView const& view, AccountID const& srcAcct, - AccountID const& dstAcct, + AccountID const& pseudoAcct, Asset const& asset); //------------------------------------------------------------------------------ diff --git a/src/libxrpl/ledger/helpers/TokenHelpers.cpp b/src/libxrpl/ledger/helpers/TokenHelpers.cpp index 7988e24a56..0ab97a4b60 100644 --- a/src/libxrpl/ledger/helpers/TokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/TokenHelpers.cpp @@ -160,19 +160,24 @@ checkDeepFrozen(ReadView const& view, AccountID const& account, Asset const& ass [[nodiscard]] TER checkWithdrawFreeze( ReadView const& view, - AccountID const& srcAcct, + AccountID const& pseudoAcct, AccountID const& submitterAcct, AccountID const& dstAcct, Asset const& asset) { XRPL_ASSERT( - isPseudoAccount(view, srcAcct), "xrpl::checkWithdrawFreeze : source is a pseudo-account"); + isPseudoAccount(view, pseudoAcct), + "xrpl::checkWithdrawFreeze : source is a pseudo-account"); XRPL_ASSERT( !isPseudoAccount(view, submitterAcct), "xrpl::checkWithdrawFreeze : submitter is not a pseudo-account"); XRPL_ASSERT( !isPseudoAccount(view, dstAcct), "xrpl::checkWithdrawFreeze : destination is not a pseudo-account"); + // The asset being withdrawn must not be issued by a pseudo-account + XRPL_ASSERT( + !isPseudoAccount(view, asset.getIssuer()), + "xrpl::checkWithdrawFreeze : asset issuer cannot be a pseudo-account"); // Funds can always be sent to the issuer if (dstAcct == asset.getIssuer()) @@ -182,16 +187,9 @@ checkWithdrawFreeze( if (auto const ret = checkGlobalFrozen(view, asset); !isTesSuccess(ret)) return ret; - // Special case for shares - check if the shares (and the transitive asset) is not frozen - if (asset.holds() && - isVaultPseudoAccountFrozen(view, srcAcct, asset.get(), 0)) - { - return tecLOCKED; - } - // The transfer is from Submitter to Destination via Source (pseudo-account) // Both Source and Submitter must not be frozen to allow sending funds - if (auto const ret = checkIndividualFrozen(view, srcAcct, asset); !isTesSuccess(ret)) + if (auto const ret = checkIndividualFrozen(view, pseudoAcct, asset); !isTesSuccess(ret)) return ret; // Check submitter's individual freeze only when Submitter != Destination (a regular freeze @@ -203,33 +201,42 @@ checkWithdrawFreeze( } // The destination account must not be deep frozen to receive the funds - return checkDeepFrozen(view, dstAcct, asset); + if (auto const ret = checkDeepFrozen(view, dstAcct, asset); !isTesSuccess(ret)) + return ret; + + if (asset.holds() && + isVaultPseudoAccountFrozen(view, pseudoAcct, asset.get(), 0)) + { + // LCOV_EXCL_START + UNREACHABLE("xrpl::checkWithdrawFreeze : pseudo-account backed object holds shares"); + return tecINTERNAL; + // LCOV_EXCL_STOP + } + + return tesSUCCESS; } [[nodiscard]] TER checkDepositFreeze( ReadView const& view, AccountID const& srcAcct, - AccountID const& dstAcct, + AccountID const& pseudoAcct, Asset const& asset) { XRPL_ASSERT( - isPseudoAccount(view, dstAcct), + isPseudoAccount(view, pseudoAcct), "xrpl::checkDepositFreeze : destination is a pseudo-account"); XRPL_ASSERT( !isPseudoAccount(view, srcAcct), "xrpl::checkDepositFreeze : source is not a pseudo-account"); + // The asset being deposited must not be issued by a pseudo-account + XRPL_ASSERT( + !isPseudoAccount(view, asset.getIssuer()), + "xrpl::checkDepositFreeze : asset issuer cannot be a pseudo-account"); if (auto const ret = checkGlobalFrozen(view, asset); !isTesSuccess(ret)) return ret; - // Special case for shares - check if the shares and the transitive asset is not frozen - if (asset.holds() && - isVaultPseudoAccountFrozen(view, dstAcct, asset.get(), 0)) - { - return tecLOCKED; - } - if (srcAcct != asset.getIssuer()) { if (auto const ret = checkIndividualFrozen(view, srcAcct, asset); !isTesSuccess(ret)) @@ -238,7 +245,19 @@ checkDepositFreeze( // Unlike regular accounts, pseudo-accounts cannot receive deposits under a regular freeze // because those funds cannot be later withdrawn - return checkIndividualFrozen(view, dstAcct, asset); + if (auto const ret = checkIndividualFrozen(view, pseudoAcct, asset); !isTesSuccess(ret)) + return ret; + + if (asset.holds() && + isVaultPseudoAccountFrozen(view, pseudoAcct, asset.get(), 0)) + { + // LCOV_EXCL_START + UNREACHABLE("xrpl::checkDepositFreeze : pseudo-account backed object holds shares"); + return tecINTERNAL; + // LCOV_EXCL_STOP + } + + return tesSUCCESS; } //------------------------------------------------------------------------------ diff --git a/src/libxrpl/tx/invariants/MPTInvariant.cpp b/src/libxrpl/tx/invariants/MPTInvariant.cpp index 26bee4effb..d8f7fcc27d 100644 --- a/src/libxrpl/tx/invariants/MPTInvariant.cpp +++ b/src/libxrpl/tx/invariants/MPTInvariant.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -837,8 +836,6 @@ ValidMPTTransfer::finalize( ReadView const& view, beast::Journal const& j) { - auto const fix330Enabled = view.rules().enabled(fixCleanup3_3_0); - if (hasPrivilege(tx, OverrideFreeze)) return true; @@ -901,27 +898,9 @@ ValidMPTTransfer::finalize( // Check once: if any involved account is frozen, the whole issuance transfer is // considered frozen. Only need to check for frozen if there is a transfer of funds. - // - // Post-fix330: full isFrozen() applies — vault-share transitive freeze is part of - // the freeze semantics for all changed holders. - // - // Pre-fix330: legacy AMM withdraw only checked individual freeze on the - // destination, not the transitive vault freeze. All other paths (and the AMM - // account itself as sender) did apply the full check. - MPTIssue const issue{mptID}; - auto const legacyAccountFrozen = [&] { - if (isGlobalFrozen(view, issue) || isIndividualFrozen(view, account, issue)) - return true; - bool const isReceiver = - !value.amtBefore.has_value() || *value.amtAfter > *value.amtBefore; - if (txnType == ttAMM_WITHDRAW && isReceiver) - return false; - return isVaultPseudoAccountFrozen(view, account, issue, 0); - }; - bool const accountFrozen = - fix330Enabled ? isFrozen(view, account, issue) : legacyAccountFrozen(); if (!invalidTransfer && - (accountFrozen || !isAuthorized(view, mptID, account, reqAuth))) + (isFrozen(view, account, MPTIssue{mptID}) || + !isAuthorized(view, mptID, account, reqAuth))) { invalidTransfer = true; } diff --git a/src/libxrpl/tx/transactors/dex/AMMCreate.cpp b/src/libxrpl/tx/transactors/dex/AMMCreate.cpp index ef271ba362..66d059c54d 100644 --- a/src/libxrpl/tx/transactors/dex/AMMCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMCreate.cpp @@ -193,6 +193,23 @@ AMMCreate::preclaim(PreclaimContext const& ctx) pseudoAccountAddress(ctx.view, keylet::amm(amount.asset(), amount2.asset()).key); accountId == beast::kZero) return terADDRESS_COLLISION; + + auto const isMPTIssuerPseudo = [&](Asset const& asset) { + if (asset.native()) + return false; + + if (asset.holds()) + return false; + + return isPseudoAccount(ctx.view, asset.getIssuer()); + }; + + if (isMPTIssuerPseudo(amount.asset()) || isMPTIssuerPseudo(amount2.asset())) + { + JLOG(ctx.j.debug()) << "AMM Instance: can't create with vault shares " << amount << " " + << amount2; + return tecWRONG_ASSET; + } } if (auto const ter = canMPTTradeAndTransfer(ctx.view, amount.asset(), accountID, accountID); diff --git a/src/test/app/AMMMPT_test.cpp b/src/test/app/AMMMPT_test.cpp index 9ff6c65c17..c68270591a 100644 --- a/src/test/app/AMMMPT_test.cpp +++ b/src/test/app/AMMMPT_test.cpp @@ -6892,168 +6892,38 @@ private: void testAMMWithVaultShares() { - testcase("AMM with vault shares — underlying freeze blocks share withdrawal"); + testcase("AMM with vault shares not allowed"); using namespace jtx; + // AMMTestBase::testableAmendments() strips featureSingleAssetVault, // but vault shares require it. Use the global jtx set directly. - FeatureBitset const all{jtx::testableAmendments()}; + Env env{*this, envconfig(), jtx::testableAmendments(), nullptr, beast::Severity::Disabled}; - // When alice's underlying asset is individually frozen: - // - // Deposit (post-fixCleanup3_3_0): checkDepositFreeze checks the AMM - // pseudo-account's underlying, not alice's — deposit is allowed. - // Pre-fix: featureAMMClawback calls isFrozen(alice, share) which - // descends via isVaultPseudoAccountFrozen(alice,...) and finds the - // frozen underlying — deposit is blocked. - // - // Withdrawal (post-fixCleanup3_3_0): checkWithdrawFreeze ends with - // checkDeepFrozen(alice, share) which calls isFrozen(alice, share) - // and finds the frozen underlying — withdrawal is blocked. - // Pre-fix: the old path only checks the AMM account's MPToken lock, - // which is unset — withdrawal succeeds. + env.fund(XRP(100'000), gw_, alice_); + env(fset(gw_, asfDefaultRipple)); + env.close(); - auto runIOU = [&](FeatureBitset const& features) { - bool const fix330 = features[fixCleanup3_3_0]; - Env env{*this, envconfig(), features, nullptr, beast::Severity::Disabled}; + PrettyAsset const iou = gw_["IOU"]; + env.trust(iou(1'000'000), alice_); + env(pay(gw_, alice_, iou(10'000))); + env.close(); - env.fund(XRP(100'000), gw_, alice_); - env(fset(gw_, asfDefaultRipple)); - env.close(); + Vault const vault{env}; + auto [createTx, vaultKeylet] = vault.create({.owner = alice_, .asset = iou}); + env(createTx); + env.close(); - PrettyAsset const iou = gw_["IOU"]; - env.trust(iou(1'000'000), alice_); - env(pay(gw_, alice_, iou(10'000))); - env.close(); + env(vault.deposit({.depositor = alice_, .id = vaultKeylet.key, .amount = iou(200)})); + env.close(); - Vault const vault{env}; - auto [createTx, vaultKeylet] = vault.create({.owner = alice_, .asset = iou}); - env(createTx); - env.close(); + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; - // 200 IOU → 200,000,000 vault shares (IOU vault scale = 6) - env(vault.deposit({.depositor = alice_, .id = vaultKeylet.key, .amount = iou(200)})); - env.close(); - - auto const shareMPTID = env.le(vaultKeylet)->at(sfShareMPTID); - // Use half the shares for the AMM; alice keeps the other half. - STAmount const shareAmt{MPTIssue{shareMPTID}, 100'000'000}; - // Pool: XRP(100) = 1e8 drops, shares = 1e8 → LP ≈ 1e8 - AMM amm{env, alice_, XRP(100), shareAmt}; - env.close(); - - // Freeze alice's IOU trustline (individual freeze on underlying). - env(trust(gw_, iou(0), alice_, tfSetFreeze)); - env.close(); - - // post-fix330: checkDepositFreeze checks AMM pseudo's underlying - // (not alice's) → deposit is allowed - // pre-fix330: featureAMMClawback path calls isFrozen(alice, share) - // which descends to alice's frozen IOU → tecLOCKED - amm.deposit( - {.account = alice_, - .asset1In = XRP(1), - .err = Ter(fix330 ? TER(tesSUCCESS) : TER(tecLOCKED))}); - - // post-fix330: checkWithdrawFreeze → checkDeepFrozen(alice, share) - // descends to alice's frozen IOU → tecLOCKED - // pre-fix330: the AMM pseudo-account is not authorized for the - // share's underlying (requireAuth recurses share→IOU - // and the AMM holds no IOU trustline), so - // accountHolds(ZeroIfUnauthorized) reports the pool's - // share balance as 0 and the withdrawal math fails → - // tecAMM_FAILED. Vault shares deposited into an AMM are - // only withdrawable once fixCleanup3_3_0 exempts the - // pseudo-account from the recursive auth check. - amm.withdraw( - {.account = alice_, - .tokens = 1'000, - .err = Ter(fix330 ? TER(tecLOCKED) : TER(tecAMM_FAILED))}); - - env(trust(gw_, iou(0), alice_, tfClearFreeze)); - env.close(); - - // Lifting the freeze lets the deposit through in both cases. The - // withdrawal only succeeds post-fix330; pre-fix330 the share balance - // remains inaccessible to the unauthorized pseudo-account, so the - // shares stay stuck → tecAMM_FAILED. - amm.deposit({.account = alice_, .asset1In = XRP(1)}); - amm.withdraw( - {.account = alice_, - .tokens = 1'000, - .err = Ter(fix330 ? TER(tesSUCCESS) : TER(tecAMM_FAILED))}); - }; - - runIOU(all); - runIOU(all - fixCleanup3_3_0); - - auto runMPT = [&](FeatureBitset const& features) { - bool const fix330 = features[fixCleanup3_3_0]; - // Expected freeze failures fire invariant checks that log at Error; - // silence them so the test output stays clean. - Env env{*this, envconfig(), features, nullptr, beast::Severity::Disabled}; - - env.fund(XRP(100'000), gw_, alice_); - env.close(); - - MPTTester mptt{env, gw_, kMptInitNoFund}; - mptt.create({.flags = kMptDexFlags | tfMPTCanLock}); - PrettyAsset const mpt = mptt.issuanceID(); - mptt.authorize({.account = alice_}); - env(pay(gw_, alice_, mpt(30'000))); - env.close(); - - Vault const vault{env}; - auto [createTx, vaultKeylet] = vault.create({.owner = alice_, .asset = mpt}); - env(createTx); - env.close(); - - // 20000 MPT → 20000 vault shares (MPT vault scale = 0) - env(vault.deposit({.depositor = alice_, .id = vaultKeylet.key, .amount = mpt(20'000)})); - env.close(); - - auto const shareMPTID = env.le(vaultKeylet)->at(sfShareMPTID); - // Use half the shares for the AMM; alice keeps the other half. - // Pool: XRP(100) = 1e8 drops, shares = 10000 → LP ≈ 1e6 - STAmount const shareAmt{MPTIssue{shareMPTID}, 10'000}; - AMM amm{env, alice_, XRP(100), shareAmt}; - env.close(); - - // Lock alice's underlying MPT (individual lock). - mptt.set({.holder = alice_, .flags = tfMPTLock}); - - // Same pre/post-fix330 semantics as the IOU case above. - amm.deposit( - {.account = alice_, - .asset1In = XRP(1), - .err = Ter(fix330 ? TER(tesSUCCESS) : TER(tecLOCKED))}); - - // {.tokens = 1'000} → frac = 1000/1e6 = 0.001 - // XRP out = 1e8 * 0.001 = 1e5 drops, shares out = 10000 * 0.001 = 10 - // post-fix330: checkWithdrawFreeze sees alice's locked underlying - // MPT via the share → tecLOCKED. - // pre-fix330: the AMM pseudo-account is unauthorized for the - // share's underlying MPT (it holds no underlying - // MPToken), so accountHolds(ZeroIfUnauthorized) zeros - // the pool's share balance and the math fails → - // tecAMM_FAILED. - amm.withdraw( - {.account = alice_, - .tokens = 1'000, - .err = Ter(fix330 ? TER(tecLOCKED) : TER(tecAMM_FAILED))}); - - mptt.set({.holder = alice_, .flags = tfMPTUnlock}); - - // Unlocking lets the deposit through; the withdrawal only succeeds - // post-fix330 (pre-fix330 the shares remain stuck → tecAMM_FAILED). - amm.deposit({.account = alice_, .asset1In = XRP(1)}); - amm.withdraw( - {.account = alice_, - .tokens = 1'000, - .err = Ter(fix330 ? TER(tesSUCCESS) : TER(tecAMM_FAILED))}); - }; - - runMPT(all); - runMPT(all - fixCleanup3_3_0); + auto const shareMPTID = vaultSle->at(sfShareMPTID); + STAmount const shareAmt{MPTIssue{shareMPTID}, 100'000'000}; + AMM const amm{env, alice_, XRP(100), shareAmt, Ter(tecWRONG_ASSET)}; + env.close(); } void diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index 079ff9df88..79fdbb54ed 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -65,6 +64,7 @@ #include #include #include +#include #include #include @@ -4606,15 +4606,17 @@ class Invariants_test : public beast::unit_test::Suite } } - // Vault-share transfer: ValidMPTTransfer gates isVaultPseudoAccountFrozen - // on fixCleanup3_3_0. Pre-amendment, vault-share transfers are allowed - // even when the underlying asset is individually frozen for the sender; - // post-amendment they are blocked. + // Vault-share freeze invariant: isVaultPseudoAccountFrozen descends + // through sfReferenceHolding to test the vault's underlying asset for + // each changed holder. { Account const gw{"gw"}; MPTID shareID{}; - auto const preclose = [&](Account const& a1, Account const& a2, Env& env) -> bool { + // Vault setup: a1 and a2 both deposit IOU and hold vault shares. + auto const setupVault = [&](Account const& a1, + Account const& a2, + Env& env) -> std::tuple { env.fund(XRP(1'000), gw); env.trust(gw["IOU"](10'000), a1); env.trust(gw["IOU"](10'000), a2); @@ -4623,25 +4625,17 @@ class Invariants_test : public beast::unit_test::Suite env(pay(gw, a2, gw["IOU"](500))); env.close(); - PrettyAsset const iou = gw["IOU"]; Vault const vault{env}; - auto [createTx, vaultKeylet] = vault.create({.owner = a1, .asset = iou}); + auto [createTx, vaultKeylet] = vault.create({.owner = a1, .asset = gw["IOU"]}); env(createTx); env.close(); - // Both a1 and a2 deposit IOU, each receiving vault shares. - env(vault.deposit({.depositor = a1, .id = vaultKeylet.key, .amount = iou(100)})); - env(vault.deposit({.depositor = a2, .id = vaultKeylet.key, .amount = iou(100)})); + env(vault.deposit( + {.depositor = a1, .id = vaultKeylet.key, .amount = gw["IOU"](100)})); + env(vault.deposit( + {.depositor = a2, .id = vaultKeylet.key, .amount = gw["IOU"](100)})); env.close(); - shareID = env.le(vaultKeylet)->at(sfShareMPTID); - - // Freeze a2's IOU trustline from the issuer side. - // a2 is the receiver in the simulated AMM withdraw; the - // distinction under test is that pre-fix330 the invariant - // does not apply the transitive vault freeze to receivers. - env(trust(gw, gw["IOU"](0), a2, tfSetFreeze)); - env.close(); - return true; + return {env.le(vaultKeylet)->at(sfShareMPTID), env.le(vaultKeylet)->at(sfAccount)}; }; // Simulate a vault-share transfer: a1 sends 10 shares to a2. @@ -4658,156 +4652,45 @@ class Invariants_test : public beast::unit_test::Suite return true; }; - // post-fixCleanup3_3_0: full isFrozen() applies to all holders; - // isVaultPseudoAccountFrozen finds a2's underlying IOU frozen → - // invalidTransfer → invariant fires. - doInvariantCheck( - Env{*this, defaultAmendments()}, - {{"invalid MPToken transfer between holders"}}, - precheck, - XRPAmount{}, - STTx{ttAMM_WITHDRAW, [](STObject&) {}}, - {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, - preclose); + // Case: vault pseudo-account's IOU trustline is frozen. + { + auto const preclose = [&](Account const& a1, Account const& a2, Env& env) -> bool { + auto [sid, vid] = setupVault(a1, a2, env); + shareID = sid; + env(trust(gw, gw["IOU"](0), Account{"vaultPseudo", vid}, tfSetFreeze)); + env.close(); + return true; + }; - // pre-fixCleanup3_3_0: legacy AMM withdraw only checked - // checkIndividualFrozen on the destination, not the transitive - // vault freeze; a2 as receiver is exempt → invariant passes. - doInvariantCheck( - Env{*this, defaultAmendments() - fixCleanup3_3_0}, - {}, - precheck, - XRPAmount{}, - STTx{ttAMM_WITHDRAW, [](STObject&) {}}, - {tesSUCCESS, tesSUCCESS}, - preclose); - } + doInvariantCheck( + Env{*this, defaultAmendments()}, + {{"invalid MPToken transfer between holders"}}, + precheck, + XRPAmount{}, + STTx{ttPAYMENT, [](STObject&) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + preclose); + } - // Side-specific vault-share AMM_WITHDRAW invariant tests. - // Both cases use a real vault (IOU underlying) and a real AMM whose - // pool includes vault shares. precheck simulates an AMM_WITHDRAW by - // transferring 10 vault shares from the AMM pseudo-account to a2. - { - MPTID shareID{}; - AccountID ammAcctID{}; - AccountID vaultPseudoID{}; - Account const gw{"gw"}; + // Case: receiver's (a2's) IOU trustline is frozen. + { + auto const preclose = [&](Account const& a1, Account const& a2, Env& env) -> bool { + auto [sid, vid] = setupVault(a1, a2, env); + shareID = sid; + env(trust(gw, gw["IOU"](0), a2, tfSetFreeze)); + env.close(); + return true; + }; - // Simulate AMM_WITHDRAW: AMM pseudo-account sends 10 vault shares - // to a2. The AMM pseudo is the sender (decreasing balance); - // a2 is the receiver (increasing balance). - auto const precheck2 = - [&](Account const& /*a1*/, Account const& a2, ApplyContext& ac) -> bool { - auto sleAMM = ac.view().peek(keylet::mptoken(shareID, ammAcctID)); - auto sle2 = ac.view().peek(keylet::mptoken(shareID, a2.id())); - if (!sleAMM || !sle2) - return false; - (*sleAMM)[sfMPTAmount] -= 10; - (*sle2)[sfMPTAmount] += 10; - ac.view().update(sleAMM); - ac.view().update(sle2); - return true; - }; - - // Shared vault + AMM setup: a1 deposits 500 IOU into a vault and - // creates an AMM with XRP + 100 vault shares, giving the AMM - // pseudo-account a vault-share MPToken balance. - auto const setupVaultAMM = [&](Account const& a1, Account const& a2, Env& env) -> bool { - env.fund(XRP(1'000), gw); - env(fset(gw, asfDefaultRipple)); - env.close(); - - env.trust(gw["IOU"](10'000), a1); - env.trust(gw["IOU"](10'000), a2); - env.close(); - env(pay(gw, a1, gw["IOU"](1'000))); - env(pay(gw, a2, gw["IOU"](500))); - env.close(); - - Vault const vault{env}; - auto [createTx, vaultKeylet] = vault.create({.owner = a1, .asset = gw["IOU"]}); - env(createTx); - env.close(); - - env(vault.deposit( - {.depositor = a1, .id = vaultKeylet.key, .amount = gw["IOU"](500)})); - env(vault.deposit( - {.depositor = a2, .id = vaultKeylet.key, .amount = gw["IOU"](200)})); - env.close(); - - shareID = env.le(vaultKeylet)->at(sfShareMPTID); - vaultPseudoID = env.le(vaultKeylet)->at(sfAccount); - - // a1 creates AMM with XRP + 100 vault shares; the AMM - // pseudo-account receives an MPToken record for shareID. - AMM const amm(env, a1, XRP(100), STAmount{MPTIssue{shareID}, 100}); - ammAcctID = amm.ammAccount(); - return true; - }; - - // Case 1: freeze the vault pseudo-account's IOU trustline. - // isVaultPseudoAccountFrozen(ammAcct) calls isAnyFrozen({vaultPseudo, - // ammAcct}, IOU); since vaultPseudo is frozen it returns true. The - // AMM sender has a decreasing balance (not a receiver) so it is - // never exempt from the check — invariant fires both pre- and - // post-fixCleanup3_3_0. - auto const preclose3 = [&](Account const& a1, Account const& a2, Env& env) -> bool { - if (!setupVaultAMM(a1, a2, env)) - return false; - env(trust(gw, gw["IOU"](0), Account{"vaultPseudo", vaultPseudoID}, tfSetFreeze)); - env.close(); - return true; - }; - - doInvariantCheck( - Env{*this, defaultAmendments()}, - {{"invalid MPToken transfer between holders"}}, - precheck2, - XRPAmount{}, - STTx{ttAMM_WITHDRAW, [](STObject&) {}}, - {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, - preclose3); - - doInvariantCheck( - Env{*this, defaultAmendments() - fixCleanup3_3_0}, - {{"invalid MPToken transfer between holders"}}, - precheck2, - XRPAmount{}, - STTx{ttAMM_WITHDRAW, [](STObject&) {}}, - {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, - preclose3); - - // Case 2: freeze a2's (receiver's) IOU trustline. - // isVaultPseudoAccountFrozen(a2) → isAnyFrozen({vaultPseudo, a2}, - // IOU) → true. The AMM sender's check passes (vaultPseudo and - // ammAcct are not frozen). Pre-fix330: receiver is exempt from - // isVaultPseudoAccountFrozen in ttAMM_WITHDRAW → passes. - // Post-fix330: full isFrozen() applied to a2 → fires. - auto const preclose4 = [&](Account const& a1, Account const& a2, Env& env) -> bool { - if (!setupVaultAMM(a1, a2, env)) - return false; - env(trust(gw, gw["IOU"](0), a2, tfSetFreeze)); - env.close(); - return true; - }; - - doInvariantCheck( - Env{*this, defaultAmendments()}, - {{"invalid MPToken transfer between holders"}}, - precheck2, - XRPAmount{}, - STTx{ttAMM_WITHDRAW, [](STObject&) {}}, - {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, - preclose4); - - doInvariantCheck( - Env{*this, defaultAmendments() - fixCleanup3_3_0}, - {}, - precheck2, - XRPAmount{}, - STTx{ttAMM_WITHDRAW, [](STObject&) {}}, - {tesSUCCESS, tesSUCCESS}, - preclose4); + doInvariantCheck( + Env{*this, defaultAmendments()}, + {{"invalid MPToken transfer between holders"}}, + precheck, + XRPAmount{}, + STTx{ttPAYMENT, [](STObject&) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + preclose); + } } } diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index d9afd93b23..f6574872f9 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -1634,8 +1634,6 @@ class Vault_test : public beast::unit_test::Suite env(tx, Ter(tecNO_ENTRY)); }); - // Freeze/lock tests are in testVaultDepositFreeze/testVaultWithdrawFreeze - testCase([this]( Env& env, Account const& issuer, @@ -2238,11 +2236,6 @@ class Vault_test : public beast::unit_test::Suite env(offer(alice, XRP(1), shares(1)), Ter{tecNO_PERMISSION}); env.close(); - // The inherited CanTrade restriction also blocks AMM creation. - AMM const ammUnderlyingFail( - env, alice, XRP(1'000), asset(1'000), Ter{tecNO_PERMISSION}); - AMM const ammShares(env, alice, XRP(1'000), shares(100), Ter{tecNO_PERMISSION}); - // Deposit still works before enabling CanTrade. env(vault.deposit({.depositor = alice, .id = keylet.key, .amount = asset(100)})); env.close(); @@ -7580,185 +7573,212 @@ class Vault_test : public beast::unit_test::Suite } void - testVaultDepositFreeze() + testVaultDepositFreezeIOU() { using namespace test::jtx; + testcase("VaultDeposit IOU freeze checks"); Account const issuer{"issuer"}; Account const owner{"owner"}; + Env env{*this}; + Vault vault{env}; - // === IOU === - { - testcase("VaultDeposit IOU freeze checks"); - Env env{*this}; - Vault vault{env}; + env.fund(XRP(100'000), issuer, owner); + env(fset(issuer, asfAllowTrustLineClawback)); + env.close(); + PrettyAsset const asset = issuer["IOU"]; + env.trust(asset(1'000'000), owner); + env(pay(issuer, owner, asset(100'000))); + env.close(); - env.fund(XRP(100'000), issuer, owner); - env(fset(issuer, asfAllowTrustLineClawback)); - env.close(); - PrettyAsset const asset = issuer["IOU"]; - env.trust(asset(1'000'000), owner); - env(pay(issuer, owner, asset(100'000))); - env.close(); + auto [tx, keylet] = vault.create({.owner = owner, .asset = asset}); + env(tx); + env.close(); + auto const vaultAcct = Account("vault", env.le(keylet)->at(sfAccount)); - auto [tx, keylet] = vault.create({.owner = owner, .asset = asset}); - env(tx); - env.close(); - auto const vaultAcct = Account("vault", env.le(keylet)->at(sfAccount)); + // Initial deposit so the vault pseudo-account has a trustline + env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(100)})); + env.close(); - // Initial deposit so the vault pseudo-account has a trustline - env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(100)})); - env.close(); + auto runTests = [&]() { + auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); - auto runTests = [&]() { - auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); - - // Global freeze + // Global freeze + { + testcase("VaultDeposit IOU global freeze"); env(fset(issuer, asfGlobalFreeze)); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), Ter(tecFROZEN)); env(fclear(issuer, asfGlobalFreeze)); + } - // Depositor regular freeze + // Depositor freeze + { + testcase("VaultDeposit IOU depositor freeze"); env(trust(issuer, asset(0), owner, tfSetFreeze)); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), Ter(tecFROZEN)); env(trust(issuer, asset(0), owner, tfClearFreeze)); + } - // Depositor deep freeze + // Depositor deep freeze + { + testcase("VaultDeposit IOU depositor deep freeze"); env(trust(issuer, asset(0), owner, tfSetFreeze | tfSetDeepFreeze)); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), Ter(tecFROZEN)); env(trust(issuer, asset(0), owner, tfClearFreeze | tfClearDeepFreeze)); + } - // Vault-account regular freeze - // Post-fix: checkDepositFreeze catches it → tecFROZEN - // Pre-fix: not checked directly, but the transitive share - // check triggers → tecLOCKED - { - auto trustSet = [&]() { - json::Value jv; - jv[jss::Account] = issuer.human(); - { - auto& ja = jv[jss::LimitAmount] = - asset(0).value().getJson(JsonOptions::Values::None); - ja[jss::issuer] = toBase58(vaultAcct.id()); - } - jv[jss::TransactionType] = jss::TrustSet; - return jv; - }(); + // Vault-account freeze + // Post-fix: checkDepositFreeze catches it → tecFROZEN + // Pre-fix: not checked directly, but the transitive share + // check triggers → tecLOCKED + { + testcase("VaultDeposit IOU pseudo-account freeze"); + auto trustSet = [&]() { + json::Value jv; + jv[jss::Account] = issuer.human(); + { + auto& ja = jv[jss::LimitAmount] = + asset(0).value().getJson(JsonOptions::Values::None); + ja[jss::issuer] = toBase58(vaultAcct.id()); + } + jv[jss::TransactionType] = jss::TrustSet; + return jv; + }(); - trustSet[jss::Flags] = tfSetFreeze; - env(trustSet); - env.close(); + trustSet[jss::Flags] = tfSetFreeze; + env(trustSet); + env.close(); - TER const expected = fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED); - env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), - Ter(expected)); + TER const expected = fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED); + env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), + Ter(expected)); - trustSet[jss::Flags] = tfClearFreeze; - env(trustSet); - env.close(); - } + trustSet[jss::Flags] = tfClearFreeze; + env(trustSet); + env.close(); + } - // Vault-account deep freeze - { - auto trustSet = [&]() { - json::Value jv; - jv[jss::Account] = issuer.human(); - { - auto& ja = jv[jss::LimitAmount] = - asset(0).value().getJson(JsonOptions::Values::None); - ja[jss::issuer] = toBase58(vaultAcct.id()); - } - jv[jss::TransactionType] = jss::TrustSet; - return jv; - }(); + // Vault-account deep freeze + { + testcase("VaultDeposit IOU pseudo-account deep freeze"); + auto trustSet = [&]() { + json::Value jv; + jv[jss::Account] = issuer.human(); + { + auto& ja = jv[jss::LimitAmount] = + asset(0).value().getJson(JsonOptions::Values::None); + ja[jss::issuer] = toBase58(vaultAcct.id()); + } + jv[jss::TransactionType] = jss::TrustSet; + return jv; + }(); - trustSet[jss::Flags] = tfSetFreeze | tfSetDeepFreeze; - env(trustSet); - env.close(); + trustSet[jss::Flags] = tfSetFreeze | tfSetDeepFreeze; + env(trustSet); + env.close(); - env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), - Ter(fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED))); + env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)}), + Ter(fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED))); - trustSet[jss::Flags] = tfClearFreeze | tfClearDeepFreeze; - env(trustSet); - env.close(); - } + trustSet[jss::Flags] = tfClearFreeze | tfClearDeepFreeze; + env(trustSet); + env.close(); + } - // Clawback works while frozen + // Clawback works while frozen + { + testcase("VaultDeposit IOU freeze clawback unaffected"); env(fset(issuer, asfGlobalFreeze)); env(vault.clawback( {.issuer = issuer, .id = keylet.key, .holder = owner, .amount = asset(1)})); env(fclear(issuer, asfGlobalFreeze)); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)})); env.close(); - }; + } + }; - runTests(); - env.disableFeature(fixCleanup3_3_0); - runTests(); - env.enableFeature(fixCleanup3_3_0); - } + runTests(); + env.disableFeature(fixCleanup3_3_0); + runTests(); + env.enableFeature(fixCleanup3_3_0); + } - // === MPT === - { - testcase("VaultDeposit MPT lock checks"); - Env env{*this}; - Vault vault{env}; + void + testVaultDepositFreezeMPT() + { + using namespace test::jtx; + testcase("VaultDeposit MPT lock checks"); - env.fund(XRP(100'000), issuer, owner); - env.close(); + Account const issuer{"issuer"}; + Account const owner{"owner"}; + Env env{*this}; + Vault vault{env}; - MPTTester mptt{env, issuer, kMptInitNoFund}; - mptt.create( - {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTRequireAuth}); - PrettyAsset const mpt{mptt.issuanceID()}; + env.fund(XRP(100'000), issuer, owner); + env.close(); - mptt.authorize({.account = owner}); - mptt.authorize({.account = issuer, .holder = owner}); - env.close(); - env(pay(issuer, owner, mpt(100'000))); - env.close(); + MPTTester mptt{env, issuer, kMptInitNoFund}; + mptt.create( + {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTRequireAuth}); + PrettyAsset const mpt{mptt.issuanceID()}; - auto [tx, keylet] = vault.create({.owner = owner, .asset = mpt}); - env(tx); - env.close(); - auto const vaultAcctID = env.le(keylet)->at(sfAccount); - Account const vaultAcct("vault", vaultAcctID); + mptt.authorize({.account = owner}); + mptt.authorize({.account = issuer, .holder = owner}); + env.close(); + env(pay(issuer, owner, mpt(100'000))); + env.close(); - env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(100)})); - env.close(); + auto [tx, keylet] = vault.create({.owner = owner, .asset = mpt}); + env(tx); + env.close(); + auto const vaultAcctID = env.le(keylet)->at(sfAccount); + Account const vaultAcct("vault", vaultAcctID); - // For MPT isDeepFrozen == isFrozen, so all locks block in - // both pre- and post-fix. - auto runTests = [&]() { - // Global lock + env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(100)})); + env.close(); + + // For MPT isDeepFrozen == isFrozen, so all locks block in + // both pre- and post-fix. + auto runTests = [&]() { + // Global lock + { + testcase("VaultDeposit MPT global lock"); mptt.set({.flags = tfMPTLock}); env.close(); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)}), Ter(tecLOCKED)); mptt.set({.flags = tfMPTUnlock}); env.close(); + } - // Depositor individual lock + // Depositor individual lock + { + testcase("VaultDeposit MPT depositor lock"); mptt.set({.holder = owner, .flags = tfMPTLock}); env.close(); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)}), Ter(tecLOCKED)); mptt.set({.holder = owner, .flags = tfMPTUnlock}); env.close(); + } - // Vault pseudo-account individual lock + // Vault pseudo-account individual lock + { + testcase("VaultDeposit MPT pseudo-account lock"); mptt.set({.holder = vaultAcct, .flags = tfMPTLock}); env.close(); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)}), Ter(tecLOCKED)); mptt.set({.holder = vaultAcct, .flags = tfMPTUnlock}); env.close(); + } - // Clawback works while locked + // Clawback works while locked + { + testcase("VaultDeposit MPT lock clawback unaffected"); mptt.set({.flags = tfMPTLock}); env.close(); env(vault.clawback( @@ -7767,16 +7787,16 @@ class Vault_test : public beast::unit_test::Suite env.close(); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)})); env.close(); - }; + } + }; - runTests(); - env.disableFeature(fixCleanup3_3_0); - runTests(); - env.enableFeature(fixCleanup3_3_0); - } + runTests(); + env.disableFeature(fixCleanup3_3_0); + runTests(); + env.enableFeature(fixCleanup3_3_0); } - // Focused demonstration: a depositor under a regular individual IOU freeze + // Focused demonstration: a depositor under an individual IOU freeze // can still withdraw to themselves (self-withdrawal), but is blocked from // withdrawing to a third party. // @@ -7818,7 +7838,7 @@ class Vault_test : public beast::unit_test::Suite auto runTests = [&]() { auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); - // Set a regular individual freeze on the owner's IOU trustline. + // Set an individual freeze on the owner's IOU trustline. env(trust(issuer, asset(0), owner, tfSetFreeze)); env.close(); @@ -7850,110 +7870,111 @@ class Vault_test : public beast::unit_test::Suite } void - testVaultWithdrawFreeze() + testVaultWithdrawFreezeIOU() { using namespace test::jtx; + testcase("VaultWithdraw IOU freeze checks"); Account const issuer{"issuer"}; Account const owner{"owner"}; + Env env{*this}; + Vault const vault{env}; - // === IOU === - { - testcase("VaultWithdraw IOU freeze checks"); - Env env{*this}; - Vault vault{env}; + env.fund(XRP(100'000), issuer, owner); + env(fset(issuer, asfAllowTrustLineClawback)); + env.close(); + PrettyAsset const asset = issuer["IOU"]; + env.trust(asset(1'000'000), owner); + env(pay(issuer, owner, asset(100'000))); + env.close(); - env.fund(XRP(100'000), issuer, owner); - env(fset(issuer, asfAllowTrustLineClawback)); - env.close(); - PrettyAsset const asset = issuer["IOU"]; - env.trust(asset(1'000'000), owner); - env(pay(issuer, owner, asset(100'000))); - env.close(); + auto [tx, keylet] = vault.create({.owner = owner, .asset = asset}); + env(tx); + env.close(); + auto const vaultAcct = Account("vault", env.le(keylet)->at(sfAccount)); - auto [tx, keylet] = vault.create({.owner = owner, .asset = asset}); - env(tx); - env.close(); - auto const vaultAcct = Account("vault", env.le(keylet)->at(sfAccount)); + env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(100)})); + env.close(); - env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(100)})); - env.close(); + Account const charlie{"charlie"}; + env.fund(XRP(10'000), charlie); + env.trust(asset(1'000'000), charlie); + env.close(); - Account const charlie{"charlie"}; - env.fund(XRP(10'000), charlie); - env.trust(asset(1'000'000), charlie); - env.close(); - - auto runTests = [&]() { - auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); - // Post-fix: submitter freeze blocks withdraw to 3rd party - // Pre-fix: submitter's IOU freeze not checked, but - // checkFrozen(depositor, share) may trigger tecLOCKED - TER const submitterTo3rd = fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED); - - // Global freeze → self-withdraw + auto runTests = [&]() { + auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); + // Global freeze → self-withdraw + { + testcase("VaultWithdraw IOU global freeze"); env(fset(issuer, asfGlobalFreeze)); env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}), Ter(tecFROZEN)); // Global freeze → withdraw to 3rd party - { - auto withdrawToCharlie = - vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); - withdrawToCharlie[sfDestination] = charlie.human(); - env(withdrawToCharlie, Ter(tecFROZEN)); - } + + auto withdrawToCharlie = + vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); + withdrawToCharlie[sfDestination] = charlie.human(); + env(withdrawToCharlie, Ter(tecFROZEN)); + env(fclear(issuer, asfGlobalFreeze)); + } - // Vault-account regular freeze - { - auto trustSet = [&]() { - json::Value jv; - jv[jss::Account] = issuer.human(); - { - auto& ja = jv[jss::LimitAmount] = - asset(0).value().getJson(JsonOptions::Values::None); - ja[jss::issuer] = toBase58(vaultAcct.id()); - } - jv[jss::TransactionType] = jss::TrustSet; - return jv; - }(); - - trustSet[jss::Flags] = tfSetFreeze; - env(trustSet); - env.close(); - - TER const vaultAcctFreeze = fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED); - - // Self-withdraw - env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}), - Ter(vaultAcctFreeze)); - // Withdraw to 3rd party + // Vault-account freeze + { + testcase("VaultWithdraw IOU pseudo-account freeze"); + auto trustSet = [&]() { + json::Value jv; + jv[jss::Account] = issuer.human(); { - auto withdrawToCharlie = vault.withdraw( - {.depositor = owner, .id = keylet.key, .amount = asset(1)}); - withdrawToCharlie[sfDestination] = charlie.human(); - env(withdrawToCharlie, Ter(vaultAcctFreeze)); + auto& ja = jv[jss::LimitAmount] = + asset(0).value().getJson(JsonOptions::Values::None); + ja[jss::issuer] = toBase58(vaultAcct.id()); } + jv[jss::TransactionType] = jss::TrustSet; + return jv; + }(); - trustSet[jss::Flags] = tfClearFreeze; - env(trustSet); - env.close(); - } + trustSet[jss::Flags] = tfSetFreeze; + env(trustSet); + env.close(); - // Depositor regular freeze → self-withdraw + TER const terExpected = fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED); + + // Self-withdraw + env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}), + Ter(terExpected)); + // Withdraw to 3rd party + + auto withdrawToCharlie = + vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); + withdrawToCharlie[sfDestination] = charlie.human(); + env(withdrawToCharlie, Ter(terExpected)); + + trustSet[jss::Flags] = tfClearFreeze; + env(trustSet); + env.close(); + } + + // Depositor freeze, self-withdraw + { + testcase("VaultWithdraw IOU self-withdraw freeze check"); env(trust(issuer, asset(0), owner, tfSetFreeze)); + // Post-fix: self-withdraw allowed (submitter==dst skip) // Pre-fix: isFrozen(depositor, iou) catches it env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}), Ter(fix330Enabled ? TER(tesSUCCESS) : TER(tecFROZEN))); - // Depositor regular freeze → withdraw to 3rd party - { - auto withdrawTo3rd = - vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); - withdrawTo3rd[sfDestination] = charlie.human(); - env(withdrawTo3rd, Ter(submitterTo3rd)); - } + // Depositor freeze withdraw to 3rd party + auto withdrawTo3rd = + vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); + withdrawTo3rd[sfDestination] = charlie.human(); + + // Post-fix: submitter freeze blocks withdraw to 3rd party + // Pre-fix: submitter's IOU freeze not checked, but checkFrozen(depositor, + // share) triggers tecLOCKED + env(withdrawTo3rd, Ter(fix330Enabled ? TER(tecFROZEN) : TER(tecLOCKED))); + env(trust(issuer, asset(0), owner, tfClearFreeze)); // Replenish what was withdrawn if (fix330Enabled) @@ -7961,104 +7982,131 @@ class Vault_test : public beast::unit_test::Suite env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)})); } env.close(); + } - // Depositor deep freeze → self-withdraw blocked + // Depositor deep freeze → self-withdraw blocked + { + testcase("VaultWithdraw IOU depositor deep freeze"); env(trust(issuer, asset(0), owner, tfSetFreeze | tfSetDeepFreeze)); - // TODO: branches are identical - confirm the intended pre/post-fix330 - // expectations and replace with the correct values (one branch may be wrong). - env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}), - // NOLINTNEXTLINE(bugprone-branch-clone) - Ter(fix330Enabled ? TER(tecFROZEN) : TER(tecFROZEN))); - env(trust(issuer, asset(0), owner, tfClearFreeze | tfClearDeepFreeze)); - // Destination regular freeze → withdraw to 3rd party + env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}), + Ter(tecFROZEN)); + + env(trust(issuer, asset(0), owner, tfClearFreeze | tfClearDeepFreeze)); + } + + // Destination freeze → withdraw to 3rd party + { + testcase("VaultWithdraw IOU freeze withdraw to 3rd party"); + env(trust(issuer, asset(0), charlie, tfSetFreeze)); + // Self-withdraw unaffected by charlie's freeze env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)})); - { - auto withdrawToCharlie = - vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); - withdrawToCharlie[sfDestination] = charlie.human(); - // Post-fix: regular freeze on dst allowed - // Pre-fix: checkFrozen(dst, iou) catches it - env(withdrawToCharlie, Ter(fix330Enabled ? TER(tesSUCCESS) : TER(tecFROZEN))); - } + + auto withdrawToCharlie = + vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); + withdrawToCharlie[sfDestination] = charlie.human(); + + // Post-fix: freeze on dst allowed + // Pre-fix: checkFrozen(dst, iou) catches it + env(withdrawToCharlie, Ter(fix330Enabled ? TER(tesSUCCESS) : TER(tecFROZEN))); + env(trust(issuer, asset(0), charlie, tfClearFreeze)); + // Replenish: 1 for self-withdraw + 1 if charlie withdraw succeeded env(vault.deposit( {.depositor = owner, .id = keylet.key, .amount = asset(fix330Enabled ? 2 : 1)})); env.close(); + } + + // Destination deep freeze → withdraw to 3rd party blocked + { + testcase("VaultWithdraw IOU deep freeze withdraw to 3rd party"); - // Destination deep freeze → withdraw to 3rd party blocked env(trust(issuer, asset(0), charlie, tfSetFreeze | tfSetDeepFreeze)); - { - auto withdrawToCharlie = - vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); - withdrawToCharlie[sfDestination] = charlie.human(); - env(withdrawToCharlie, Ter(tecFROZEN)); - } + + auto withdrawToCharlie = + vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)}); + withdrawToCharlie[sfDestination] = charlie.human(); + env(withdrawToCharlie, Ter(tecFROZEN)); + // Destination deep freeze → self-withdraw unaffected env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = asset(1)})); + env(trust(issuer, asset(0), charlie, tfClearFreeze | tfClearDeepFreeze)); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)})); env.close(); + } - // Clawback works while frozen + // Clawback works while frozen + { + testcase("VaultWithdraw IOU freeze clawback unaffected"); env(fset(issuer, asfGlobalFreeze)); + env(vault.clawback( {.issuer = issuer, .id = keylet.key, .holder = owner, .amount = asset(1)})); + env(fclear(issuer, asfGlobalFreeze)); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = asset(1)})); env.close(); - }; + } + }; - runTests(); - env.disableFeature(fixCleanup3_3_0); - runTests(); - env.enableFeature(fixCleanup3_3_0); - } + runTests(); + env.disableFeature(fixCleanup3_3_0); + runTests(); + env.enableFeature(fixCleanup3_3_0); + } - // === MPT === - { - testcase("VaultWithdraw MPT lock checks"); - Env env{*this}; - Vault vault{env}; + void + testVaultWithdrawFreezeMPT() + { + using namespace test::jtx; + testcase("VaultWithdraw MPT lock checks"); - env.fund(XRP(100'000), issuer, owner); - env.close(); + Account const issuer{"issuer"}; + Account const owner{"owner"}; + Env env{*this}; + Vault vault{env}; - MPTTester mptt{env, issuer, kMptInitNoFund}; - mptt.create( - {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTRequireAuth}); - PrettyAsset const mpt{mptt.issuanceID()}; + env.fund(XRP(100'000), issuer, owner); + env.close(); - mptt.authorize({.account = owner}); - mptt.authorize({.account = issuer, .holder = owner}); - env.close(); - env(pay(issuer, owner, mpt(100'000))); - env.close(); + MPTTester mptt{env, issuer, kMptInitNoFund}; + mptt.create( + {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTRequireAuth}); + PrettyAsset const mpt{mptt.issuanceID()}; - auto [tx, keylet] = vault.create({.owner = owner, .asset = mpt}); - env(tx); - env.close(); - Account const vaultAcct("vault", env.le(keylet)->at(sfAccount)); + mptt.authorize({.account = owner}); + mptt.authorize({.account = issuer, .holder = owner}); + env.close(); + env(pay(issuer, owner, mpt(100'000))); + env.close(); - env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(100)})); - env.close(); + auto [tx, keylet] = vault.create({.owner = owner, .asset = mpt}); + env(tx); + env.close(); + Account const vaultAcct("vault", env.le(keylet)->at(sfAccount)); - Account const charlie{"charlie"}; - env.fund(XRP(10'000), charlie); - env.close(); - mptt.authorize({.account = charlie}); - mptt.authorize({.account = issuer, .holder = charlie}); - env.close(); + env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(100)})); + env.close(); - auto runTests = [&]() { - auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); + Account const charlie{"charlie"}; + env.fund(XRP(10'000), charlie); + env.close(); + mptt.authorize({.account = charlie}); + mptt.authorize({.account = issuer, .holder = charlie}); + env.close(); - // Global lock + auto runTests = [&]() { + auto const fix330Enabled = env.current()->rules().enabled(fixCleanup3_3_0); + + // Global lock + { + testcase("VaultWithdraw MPT global lock"); mptt.set({.flags = tfMPTLock}); env.close(); env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = mpt(1)}), @@ -8081,17 +8129,23 @@ class Vault_test : public beast::unit_test::Suite env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)})); } env.close(); + } - // Vault pseudo-account individual lock + // Vault pseudo-account individual lock + { + testcase("VaultWithdraw MPT pseudo-account lock"); mptt.set({.holder = vaultAcct, .flags = tfMPTLock}); env.close(); env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = mpt(1)}), Ter(tecLOCKED)); mptt.set({.holder = vaultAcct, .flags = tfMPTUnlock}); env.close(); + } - // Depositor individual lock → self-withdraw blocked - // (isDeepFrozen == isFrozen for MPT) + // Depositor individual lock → self-withdraw blocked + // (isDeepFrozen == isFrozen for MPT) + { + testcase("VaultWithdraw MPT depositor lock"); mptt.set({.holder = owner, .flags = tfMPTLock}); env.close(); env(vault.withdraw({.depositor = owner, .id = keylet.key, .amount = mpt(1)}), @@ -8120,8 +8174,11 @@ class Vault_test : public beast::unit_test::Suite env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)})); } env.close(); + } - // 3rd party destination lock → withdraw to 3rd party blocked + // 3rd party destination lock → withdraw to 3rd party blocked + { + testcase("VaultWithdraw MPT 3rd party destination lock"); mptt.set({.holder = charlie, .flags = tfMPTLock}); env.close(); { @@ -8136,8 +8193,11 @@ class Vault_test : public beast::unit_test::Suite env.close(); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)})); env.close(); + } - // Clawback works while locked + // Clawback works while locked + { + testcase("VaultWithdraw MPT lock clawback unaffected"); mptt.set({.flags = tfMPTLock}); env.close(); env(vault.clawback( @@ -8146,14 +8206,13 @@ class Vault_test : public beast::unit_test::Suite env.close(); env(vault.deposit({.depositor = owner, .id = keylet.key, .amount = mpt(1)})); env.close(); - }; + } + }; - runTests(); - env.disableFeature(fixCleanup3_3_0); - - runTests(); - env.enableFeature(fixCleanup3_3_0); - } + runTests(); + env.disableFeature(fixCleanup3_3_0); + runTests(); + env.enableFeature(fixCleanup3_3_0); } public: @@ -8198,8 +8257,10 @@ public: testWithdrawSoleShareholderPartialFixedSharesUsesFullPrice(); testWithdrawSoleShareholderLoanRepaymentExit(); - testVaultDepositFreeze(); - testVaultWithdrawFreeze(); + testVaultDepositFreezeIOU(); + testVaultDepositFreezeMPT(); + testVaultWithdrawFreezeIOU(); + testVaultWithdrawFreezeMPT(); testVaultSelfWithdrawWhileFrozen(); testReferenceHolding(); From c53aafa6bfeb8591532c770cfcc59abf5f156a2f Mon Sep 17 00:00:00 2001 From: Timothy Banks Date: Wed, 1 Jul 2026 11:36:28 -0400 Subject: [PATCH 09/10] refactor: Retire InnerObjTemplate fix (#7368) --- include/xrpl/protocol/detail/features.macro | 2 +- src/libxrpl/ledger/helpers/AMMHelpers.cpp | 6 ++--- src/libxrpl/protocol/STObject.cpp | 6 ++--- src/libxrpl/tx/transactors/dex/AMMBid.cpp | 17 ++++---------- src/libxrpl/tx/transactors/dex/AMMVote.cpp | 4 +--- src/test/app/AMM_test.cpp | 24 +------------------- src/test/jtx/impl/AMM.cpp | 10 ++------ src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp | 4 +--- 8 files changed, 15 insertions(+), 58 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index a1911761bb..7e64a49b0c 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -58,7 +58,6 @@ XRPL_FIX (XChainRewardRounding, Supported::Yes, VoteBehavior::DefaultNo XRPL_FIX (EmptyDID, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PriceOracle, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMOverflowOffer, Supported::Yes, VoteBehavior::DefaultYes) -XRPL_FIX (InnerObjTemplate, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (FillOrKill, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FEATURE(DID, Supported::Yes, VoteBehavior::DefaultNo) XRPL_FIX (DisallowIncomingV1, Supported::Yes, VoteBehavior::DefaultNo) @@ -101,6 +100,7 @@ XRPL_RETIRE_FIX(1623) XRPL_RETIRE_FIX(1781) XRPL_RETIRE_FIX(AmendmentMajorityCalc) XRPL_RETIRE_FIX(CheckThreading) +XRPL_RETIRE_FIX(InnerObjTemplate) XRPL_RETIRE_FIX(MasterKeyAsRegularKey) XRPL_RETIRE_FIX(NonFungibleTokensV1_2) XRPL_RETIRE_FIX(NFTokenRemint) diff --git a/src/libxrpl/ledger/helpers/AMMHelpers.cpp b/src/libxrpl/ledger/helpers/AMMHelpers.cpp index 7cd27a1f34..df6d335085 100644 --- a/src/libxrpl/ledger/helpers/AMMHelpers.cpp +++ b/src/libxrpl/ledger/helpers/AMMHelpers.cpp @@ -602,9 +602,7 @@ std::uint16_t getTradingFee(ReadView const& view, SLE const& ammSle, AccountID const& account) { using namespace std::chrono; - XRPL_ASSERT( - !view.rules().enabled(fixInnerObjTemplate) || ammSle.isFieldPresent(sfAuctionSlot), - "xrpl::getTradingFee : auction present"); + XRPL_ASSERT(ammSle.isFieldPresent(sfAuctionSlot), "xrpl::getTradingFee : auction present"); if (ammSle.isFieldPresent(sfAuctionSlot)) { auto const& auctionSlot = safeDowncast(ammSle.peekAtField(sfAuctionSlot)); @@ -822,7 +820,7 @@ initializeFeeAuctionVote( // AMM creator gets the auction slot for free. // AuctionSlot is created on AMMCreate and updated on AMMDeposit // when AMM is in an empty state - if (rules.enabled(fixInnerObjTemplate) && !ammSle->isFieldPresent(sfAuctionSlot)) + if (!ammSle->isFieldPresent(sfAuctionSlot)) { STObject auctionSlot = STObject::makeInnerObject(sfAuctionSlot); ammSle->set(std::move(auctionSlot)); diff --git a/src/libxrpl/protocol/STObject.cpp b/src/libxrpl/protocol/STObject.cpp index 445da16828..c493ba65af 100644 --- a/src/libxrpl/protocol/STObject.cpp +++ b/src/libxrpl/protocol/STObject.cpp @@ -78,12 +78,10 @@ STObject::makeInnerObject(SField const& name) // The if is complicated because inner object templates were added in // two phases: // 1. If there are no available Rules, then always apply the template. - // 2. fixInnerObjTemplate added templates to two AMM inner objects. - // 3. fixInnerObjTemplate2 added templates to all remaining inner objects. + // 2. fixInnerObjTemplate2 added templates to all remaining inner objects. std::optional const& rules = getCurrentTransactionRules(); bool const isAMMObj = name == sfAuctionSlot || name == sfVoteEntry; - if (!rules || (rules->enabled(fixInnerObjTemplate) && isAMMObj) || - (rules->enabled(fixInnerObjTemplate2) && !isAMMObj)) + if (!rules || isAMMObj || rules->enabled(fixInnerObjTemplate2)) { if (SOTemplate const* elements = InnerObjectFormats::getInstance().findSOTemplateBySField(name)) diff --git a/src/libxrpl/tx/transactors/dex/AMMBid.cpp b/src/libxrpl/tx/transactors/dex/AMMBid.cpp index 83432fa0d0..3454559e82 100644 --- a/src/libxrpl/tx/transactors/dex/AMMBid.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMBid.cpp @@ -184,18 +184,11 @@ applyBid(ApplyContext& ctx, Sandbox& sb, AccountID const& account, beast::Journa return {tecINTERNAL, false}; STAmount const lptAMMBalance = (*ammSle)[sfLPTokenBalance]; auto const lpTokens = ammLPHolds(sb, *ammSle, account, ctx.journal); - auto const& rules = ctx.view().rules(); - if (!rules.enabled(fixInnerObjTemplate)) - { - if (!ammSle->isFieldPresent(sfAuctionSlot)) - ammSle->makeFieldPresent(sfAuctionSlot); - } - else - { - XRPL_ASSERT(ammSle->isFieldPresent(sfAuctionSlot), "xrpl::applyBid : has auction slot"); - if (!ammSle->isFieldPresent(sfAuctionSlot)) - return {tecINTERNAL, false}; - } + + XRPL_ASSERT(ammSle->isFieldPresent(sfAuctionSlot), "xrpl::applyBid : has auction slot"); + if (!ammSle->isFieldPresent(sfAuctionSlot)) + return {tecINTERNAL, false}; + auto& auctionSlot = ammSle->peekFieldObject(sfAuctionSlot); auto const current = duration_cast(ctx.view().header().parentCloseTime.time_since_epoch()).count(); diff --git a/src/libxrpl/tx/transactors/dex/AMMVote.cpp b/src/libxrpl/tx/transactors/dex/AMMVote.cpp index 23604d46cc..0f2b721ac4 100644 --- a/src/libxrpl/tx/transactors/dex/AMMVote.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMVote.cpp @@ -195,9 +195,7 @@ applyVote(ApplyContext& ctx, Sandbox& sb, AccountID const& accountID, beast::Jou } } - XRPL_ASSERT( - !ctx.view().rules().enabled(fixInnerObjTemplate) || ammSle->isFieldPresent(sfAuctionSlot), - "xrpl::applyVote : has auction slot"); + XRPL_ASSERT(ammSle->isFieldPresent(sfAuctionSlot), "xrpl::applyVote : has auction slot"); // Update the vote entries and the trading/discounted fee. ammSle->setFieldArray(sfVoteSlots, updatedVoteSlots); diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index 3672c4a68a..d4b6ba5429 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -5747,38 +5747,16 @@ private: }; // ledger is closed after each transaction, vote/withdraw don't fail - // regardless whether the amendment is enabled or not test(all, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 0, true); - test(all - fixInnerObjTemplate, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 0, true); // ledger is not closed after each transaction - // vote/withdraw don't fail if the amendment is enabled test(all, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 0, false); - // vote/withdraw fail if the amendment is not enabled - // second vote/withdraw still fail: second vote fails because - // the initial trading fee is 0, consequently second withdraw fails - // because the second vote fails - test( - all - fixInnerObjTemplate, - tefEXCEPTION, - tefEXCEPTION, - tefEXCEPTION, - tefEXCEPTION, - 0, - false); // if non-zero trading/discounted fee then vote/withdraw - // don't fail whether the ledger is closed or not and - // the amendment is enabled or not + // don't fail whether the ledger is closed or not test(all, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 10, true); - test(all - fixInnerObjTemplate, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 10, true); test(all, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 10, false); - test(all - fixInnerObjTemplate, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 10, false); // non-zero trading fee but discounted fee is 0, vote doesn't fail // but withdraw fails test(all, tesSUCCESS, tesSUCCESS, tesSUCCESS, tesSUCCESS, 9, false); - // second vote sets the trading fee to non-zero, consequently - // second withdraw doesn't fail even if the amendment is not - // enabled and the ledger is not closed - test(all - fixInnerObjTemplate, tesSUCCESS, tefEXCEPTION, tesSUCCESS, tesSUCCESS, 9, false); } void diff --git a/src/test/jtx/impl/AMM.cpp b/src/test/jtx/impl/AMM.cpp index 2184f7e1b0..5c815d4226 100644 --- a/src/test/jtx/impl/AMM.cpp +++ b/src/test/jtx/impl/AMM.cpp @@ -738,8 +738,7 @@ AMM::bid(BidArg const& arg) { if (auto const amm = env_.current()->read(keylet::amm(asset1_.asset(), asset2_.asset()))) { - if (env_.current()->rules().enabled(fixInnerObjTemplate) && - !amm->isFieldPresent(sfAuctionSlot)) + if (!amm->isFieldPresent(sfAuctionSlot)) Throw("AMM::Bid"); if (amm->isFieldPresent(sfAuctionSlot)) { @@ -867,8 +866,7 @@ AMM::expectAuctionSlot(auto&& cb) const { if (auto const amm = env_.current()->read(keylet::amm(asset1_.asset(), asset2_.asset()))) { - if (env_.current()->rules().enabled(fixInnerObjTemplate) && - !amm->isFieldPresent(sfAuctionSlot)) + if (!amm->isFieldPresent(sfAuctionSlot)) Throw("AMM::expectAuctionSlot"); if (amm->isFieldPresent(sfAuctionSlot)) { @@ -876,10 +874,6 @@ AMM::expectAuctionSlot(auto&& cb) const safeDowncast(amm->peekAtField(sfAuctionSlot)); if (auctionSlot.isFieldPresent(sfAccount)) { - // This could fail in pre-fixInnerObjTemplate tests - // if the submitted transactions recreate one of - // the failure scenarios. Access as optional - // to avoid the failure. auto const slotFee = auctionSlot[~sfDiscountedFee].value_or(0); auto const slotInterval = ammAuctionTimeSlot( env_.app().getTimeKeeper().now().time_since_epoch().count(), auctionSlot); diff --git a/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp b/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp index 043fdd2d7b..7f54f81423 100644 --- a/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp +++ b/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp @@ -214,9 +214,7 @@ doAMMInfo(RPC::JsonContext& context) } if (voteSlots.size() > 0) ammResult[jss::vote_slots] = std::move(voteSlots); - XRPL_ASSERT( - !ledger->rules().enabled(fixInnerObjTemplate) || amm->isFieldPresent(sfAuctionSlot), - "xrpl::doAMMInfo : auction slot is set"); + XRPL_ASSERT(amm->isFieldPresent(sfAuctionSlot), "xrpl::doAMMInfo : auction slot is present"); if (amm->isFieldPresent(sfAuctionSlot)) { auto const& auctionSlot = safeDowncast(amm->peekAtField(sfAuctionSlot)); From 8e378c4f4727a188ca0300b76142f2f867ba1e30 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 2 Jul 2026 00:14:17 +0100 Subject: [PATCH 10/10] build: Add verify-headers target to cleanup headers (#7670) --- .clang-tidy | 2 +- .gersemi/definitions.cmake | 6 + .../scripts/levelization/results/loops.txt | 6 - .../scripts/levelization/results/ordering.txt | 11 +- .github/workflows/reusable-clang-tidy.yml | 3 +- .pre-commit-config.yaml | 6 +- BUILD.md | 38 +++- bin/pre-commit/clang_tidy_check.py | 171 ++---------------- cmake/XrplCore.cmake | 9 + cmake/XrplSettings.cmake | 17 ++ cmake/add_module.cmake | 17 ++ cmake/verify_headers.cmake | 84 +++++++++ include/xrpl/basics/Buffer.h | 1 + include/xrpl/basics/CompressionAlgorithms.h | 1 + include/xrpl/basics/DecayingSample.h | 1 + include/xrpl/basics/FileUtilities.h | 2 + include/xrpl/basics/IntrusivePointer.h | 1 + include/xrpl/basics/IntrusiveRefCounts.h | 1 + include/xrpl/basics/Log.h | 3 +- include/xrpl/basics/Number.h | 4 + include/xrpl/basics/RangeSet.h | 1 + include/xrpl/basics/Resolver.h | 1 + include/xrpl/basics/ResolverAsio.h | 2 + include/xrpl/basics/SHAMapHash.h | 2 + include/xrpl/basics/SharedWeakCachePointer.h | 2 + include/xrpl/basics/SlabAllocator.h | 1 + include/xrpl/basics/StringUtilities.h | 3 +- include/xrpl/basics/TaggedCache.h | 15 +- include/xrpl/basics/TaggedCache.ipp | 1 + include/xrpl/basics/UnorderedContainers.h | 4 +- include/xrpl/basics/base64.h | 1 + include/xrpl/basics/base_uint.h | 10 + include/xrpl/basics/chrono.h | 1 + include/xrpl/basics/hardened_hash.h | 1 - include/xrpl/basics/join.h | 2 + include/xrpl/basics/make_SSLContext.h | 1 + .../xrpl/basics/partitioned_unordered_map.h | 3 + include/xrpl/basics/random.h | 1 - include/xrpl/basics/safe_cast.h | 2 - include/xrpl/basics/strHex.h | 3 + include/xrpl/basics/tagged_integer.h | 1 + include/xrpl/beast/asio/io_latency_probe.h | 1 + .../beast/container/aged_container_utility.h | 1 + include/xrpl/beast/container/aged_map.h | 1 + include/xrpl/beast/container/aged_multimap.h | 1 + .../xrpl/beast/container/aged_unordered_map.h | 1 + .../beast/container/aged_unordered_multimap.h | 1 + .../container/detail/aged_ordered_container.h | 27 +-- .../detail/aged_unordered_container.h | 6 + include/xrpl/beast/core/CurrentThreadName.h | 1 + include/xrpl/beast/core/LexicalCast.h | 5 +- include/xrpl/beast/core/List.h | 2 + include/xrpl/beast/core/LockFreeStack.h | 3 +- include/xrpl/beast/hash/hash_append.h | 2 +- include/xrpl/beast/insight/Collector.h | 2 + include/xrpl/beast/insight/Insight.h | 15 -- include/xrpl/beast/insight/NullCollector.h | 2 + include/xrpl/beast/insight/StatsDCollector.h | 3 + include/xrpl/beast/net/IPAddress.h | 1 + include/xrpl/beast/net/IPAddressV4.h | 2 - include/xrpl/beast/net/IPAddressV6.h | 2 - include/xrpl/beast/net/IPEndpoint.h | 5 + include/xrpl/beast/rfc2616.h | 1 + include/xrpl/beast/test/yield_to.h | 2 + include/xrpl/beast/unit_test.h | 9 - include/xrpl/beast/unit_test/match.h | 1 + include/xrpl/beast/unit_test/recorder.h | 4 + include/xrpl/beast/unit_test/reporter.h | 5 +- include/xrpl/beast/unit_test/results.h | 1 + include/xrpl/beast/unit_test/suite.h | 4 +- include/xrpl/beast/unit_test/suite_info.h | 2 +- include/xrpl/beast/unit_test/suite_list.h | 1 + include/xrpl/beast/unit_test/thread.h | 2 + include/xrpl/beast/utility/Journal.h | 3 + include/xrpl/beast/utility/PropertyStream.h | 2 + include/xrpl/beast/utility/WrappedSink.h | 1 + include/xrpl/beast/utility/rngfill.h | 2 - include/xrpl/conditions/Condition.h | 4 + include/xrpl/conditions/Fulfillment.h | 5 + .../xrpl/conditions/detail/PreimageSha256.h | 4 + include/xrpl/conditions/detail/utils.h | 3 + include/xrpl/config/BasicConfig.h | 4 + include/xrpl/core/ClosureCounter.h | 3 + include/xrpl/core/HashRouter.h | 6 + include/xrpl/core/Job.h | 5 + include/xrpl/core/JobQueue.h | 22 ++- include/xrpl/core/JobTypeData.h | 3 + include/xrpl/core/JobTypeInfo.h | 4 + include/xrpl/core/JobTypes.h | 4 + include/xrpl/core/LoadMonitor.h | 1 + include/xrpl/core/PeerReservationTable.h | 1 + include/xrpl/core/PerfLog.h | 3 +- include/xrpl/core/ServiceRegistry.h | 6 + include/xrpl/core/StartUpType.h | 2 +- include/xrpl/core/detail/semaphore.h | 1 + include/xrpl/crypto/RFC1751.h | 1 + include/xrpl/crypto/csprng.h | 3 + include/xrpl/json/JsonPropertyStream.h | 3 + include/xrpl/json/Writer.h | 4 +- include/xrpl/json/detail/json_assert.h | 3 - include/xrpl/json/json_reader.h | 3 + include/xrpl/json/json_writer.h | 3 + include/xrpl/ledger/AcceptedLedgerTx.h | 10 + include/xrpl/ledger/AmendmentTable.h | 23 +++ include/xrpl/ledger/ApplyView.h | 15 +- include/xrpl/ledger/ApplyViewImpl.h | 11 ++ include/xrpl/ledger/BookDirs.h | 7 + include/xrpl/ledger/CachedView.h | 9 + include/xrpl/ledger/CanonicalTXSet.h | 6 + include/xrpl/ledger/Dir.h | 10 +- include/xrpl/ledger/Ledger.h | 22 ++- include/xrpl/ledger/LedgerTiming.h | 5 +- include/xrpl/ledger/OpenView.h | 13 +- include/xrpl/ledger/PaymentSandbox.h | 10 +- include/xrpl/ledger/RawView.h | 3 + include/xrpl/ledger/ReadView.h | 11 +- include/xrpl/ledger/Sandbox.h | 2 + include/xrpl/ledger/View.h | 9 + include/xrpl/ledger/detail/ApplyStateTable.h | 13 ++ include/xrpl/ledger/detail/ApplyViewBase.h | 10 + include/xrpl/ledger/detail/RawStateTable.h | 8 + include/xrpl/ledger/detail/ReadViewFwdRange.h | 2 + include/xrpl/ledger/helpers/AMMHelpers.h | 16 +- .../xrpl/ledger/helpers/AccountRootHelpers.h | 5 + .../xrpl/ledger/helpers/CredentialHelpers.h | 9 +- include/xrpl/ledger/helpers/DelegateHelpers.h | 3 + .../xrpl/ledger/helpers/DirectoryHelpers.h | 6 +- include/xrpl/ledger/helpers/EscrowHelpers.h | 17 +- include/xrpl/ledger/helpers/LendingHelpers.h | 21 ++- include/xrpl/ledger/helpers/MPTokenHelpers.h | 6 + include/xrpl/ledger/helpers/NFTokenHelpers.h | 16 +- .../ledger/helpers/PaymentChannelHelpers.h | 5 +- .../ledger/helpers/PermissionedDEXHelpers.h | 6 +- .../xrpl/ledger/helpers/RippleStateHelpers.h | 7 + include/xrpl/ledger/helpers/TokenHelpers.h | 7 + include/xrpl/net/AutoSocket.h | 8 + include/xrpl/net/HTTPClient.h | 1 + include/xrpl/net/HTTPClientSSLContext.h | 8 + include/xrpl/net/RegisterSSLCerts.h | 2 +- include/xrpl/nodestore/Backend.h | 9 + include/xrpl/nodestore/Database.h | 18 +- include/xrpl/nodestore/DatabaseRotating.h | 7 + include/xrpl/nodestore/DummyScheduler.h | 1 + include/xrpl/nodestore/Factory.h | 6 +- include/xrpl/nodestore/Manager.h | 9 +- include/xrpl/nodestore/NodeObject.h | 4 + include/xrpl/nodestore/Types.h | 1 + include/xrpl/nodestore/detail/BatchWriter.h | 2 + .../xrpl/nodestore/detail/DatabaseNodeImp.h | 16 ++ .../nodestore/detail/DatabaseRotatingImp.h | 11 ++ include/xrpl/nodestore/detail/DecodedBlob.h | 2 + include/xrpl/nodestore/detail/EncodedBlob.h | 3 + include/xrpl/nodestore/detail/ManagerImp.h | 11 ++ include/xrpl/nodestore/detail/codec.h | 4 + include/xrpl/nodestore/detail/varint.h | 1 + include/xrpl/proto/org/xrpl/rpc/v1/README.md | 6 +- include/xrpl/protocol/AMMCore.h | 5 + include/xrpl/protocol/AccountID.h | 6 +- include/xrpl/protocol/AmountConversions.h | 10 + include/xrpl/protocol/ApiVersion.h | 1 + include/xrpl/protocol/Asset.h | 11 +- include/xrpl/protocol/Batch.h | 5 +- include/xrpl/protocol/Book.h | 11 ++ include/xrpl/protocol/BuildInfo.h | 1 + include/xrpl/protocol/ConfidentialTransfer.h | 15 +- include/xrpl/protocol/ErrorCodes.h | 3 +- include/xrpl/protocol/Feature.h | 2 + include/xrpl/protocol/Fees.h | 3 + include/xrpl/protocol/IOUAmount.h | 1 + include/xrpl/protocol/Indexes.h | 11 +- include/xrpl/protocol/InnerObjectFormats.h | 2 + include/xrpl/protocol/Issue.h | 6 +- include/xrpl/protocol/KnownFormats.h | 4 + include/xrpl/protocol/LedgerFormats.h | 3 + include/xrpl/protocol/LedgerHeader.h | 3 + include/xrpl/protocol/MPTAmount.h | 4 +- include/xrpl/protocol/MPTIssue.h | 10 + include/xrpl/protocol/PathAsset.h | 7 + include/xrpl/protocol/Permissions.h | 5 +- include/xrpl/protocol/Protocol.h | 2 + include/xrpl/protocol/PublicKey.h | 10 + include/xrpl/protocol/Quality.h | 6 +- include/xrpl/protocol/QualityFunction.h | 6 + include/xrpl/protocol/Rate.h | 2 +- include/xrpl/protocol/Rules.h | 3 + include/xrpl/protocol/SField.h | 3 +- include/xrpl/protocol/SOTemplate.h | 2 + include/xrpl/protocol/STAccount.h | 4 + include/xrpl/protocol/STAmount.h | 16 +- include/xrpl/protocol/STArray.h | 11 ++ include/xrpl/protocol/STBase.h | 3 + include/xrpl/protocol/STBitString.h | 7 + include/xrpl/protocol/STBlob.h | 6 +- include/xrpl/protocol/STCurrency.h | 6 +- include/xrpl/protocol/STExchange.h | 3 +- include/xrpl/protocol/STInteger.h | 8 + include/xrpl/protocol/STIssue.h | 9 + include/xrpl/protocol/STLedgerEntry.h | 14 +- include/xrpl/protocol/STNumber.h | 7 + include/xrpl/protocol/STObject.h | 14 +- include/xrpl/protocol/STParsedJSON.h | 5 +- include/xrpl/protocol/STPathSet.h | 5 +- include/xrpl/protocol/STTakesAsset.h | 2 + include/xrpl/protocol/STTx.h | 14 +- include/xrpl/protocol/STValidation.h | 43 +++-- include/xrpl/protocol/STVector256.h | 10 +- include/xrpl/protocol/STXChainBridge.h | 10 + include/xrpl/protocol/SecretKey.h | 4 + include/xrpl/protocol/Seed.h | 3 + include/xrpl/protocol/Serializer.h | 3 +- include/xrpl/protocol/Sign.h | 4 + include/xrpl/protocol/SystemParameters.h | 3 + include/xrpl/protocol/TER.h | 2 + include/xrpl/protocol/TxFormats.h | 2 + include/xrpl/protocol/TxMeta.h | 11 +- include/xrpl/protocol/UintTypes.h | 6 +- include/xrpl/protocol/Units.h | 4 + include/xrpl/protocol/XChainAttestations.h | 8 +- include/xrpl/protocol/XRPAmount.h | 5 + include/xrpl/protocol/detail/STVar.h | 1 + include/xrpl/protocol/detail/b58_utils.h | 4 +- include/xrpl/protocol/detail/token_errors.h | 2 + include/xrpl/protocol/digest.h | 3 + include/xrpl/protocol/json_get_or_throw.h | 4 + include/xrpl/protocol/messages.h | 2 - include/xrpl/protocol/serialize.h | 3 + include/xrpl/protocol/st.h | 18 -- include/xrpl/protocol/tokens.h | 3 +- include/xrpl/rdb/DatabaseCon.h | 12 +- include/xrpl/rdb/RelationalDatabase.h | 18 +- include/xrpl/rdb/SociDB.h | 5 +- include/xrpl/resource/Charge.h | 2 + include/xrpl/resource/Consumer.h | 5 +- include/xrpl/resource/ResourceManager.h | 4 + include/xrpl/resource/Types.h | 10 - include/xrpl/resource/detail/Entry.h | 7 +- include/xrpl/resource/detail/Import.h | 2 + include/xrpl/resource/detail/Key.h | 3 +- include/xrpl/resource/detail/Logic.h | 11 +- include/xrpl/server/InfoSub.h | 9 + include/xrpl/server/LoadFeeTrack.h | 1 + include/xrpl/server/Manifest.h | 8 + include/xrpl/server/NetworkOPs.h | 15 +- include/xrpl/server/Port.h | 3 +- include/xrpl/server/Server.h | 4 +- include/xrpl/server/Session.h | 6 +- include/xrpl/server/SimpleWriter.h | 5 +- include/xrpl/server/State.h | 4 +- include/xrpl/server/Vacuum.h | 1 + include/xrpl/server/WSSession.h | 3 +- include/xrpl/server/Wallet.h | 12 ++ include/xrpl/server/Writer.h | 1 + include/xrpl/server/detail/BaseHTTPPeer.h | 11 +- include/xrpl/server/detail/BasePeer.h | 3 +- include/xrpl/server/detail/BaseWSPeer.h | 8 + include/xrpl/server/detail/Door.h | 5 + include/xrpl/server/detail/JSONRPCUtil.h | 3 +- include/xrpl/server/detail/LowestLayer.h | 9 - include/xrpl/server/detail/PlainHTTPPeer.h | 5 + include/xrpl/server/detail/PlainWSPeer.h | 4 + include/xrpl/server/detail/SSLHTTPPeer.h | 6 + include/xrpl/server/detail/SSLWSPeer.h | 7 +- include/xrpl/server/detail/ServerImpl.h | 11 +- include/xrpl/server/detail/Spawn.h | 1 + include/xrpl/server/detail/io_list.h | 1 + include/xrpl/shamap/Family.h | 2 + include/xrpl/shamap/FullBelowCache.h | 4 + include/xrpl/shamap/SHAMap.h | 19 +- .../xrpl/shamap/SHAMapAccountStateLeafNode.h | 7 + include/xrpl/shamap/SHAMapInnerNode.h | 6 +- include/xrpl/shamap/SHAMapItem.h | 8 + include/xrpl/shamap/SHAMapLeafNode.h | 3 + include/xrpl/shamap/SHAMapMissingNode.h | 4 +- include/xrpl/shamap/SHAMapNodeID.h | 2 + include/xrpl/shamap/SHAMapSyncFilter.h | 3 + include/xrpl/shamap/SHAMapTreeNode.h | 2 +- include/xrpl/shamap/SHAMapTxLeafNode.h | 7 + .../xrpl/shamap/SHAMapTxPlusMetaLeafNode.h | 7 + include/xrpl/shamap/TreeNodeCache.h | 1 + include/xrpl/shamap/detail/TaggedPointer.h | 7 +- include/xrpl/tx/ApplyContext.h | 11 ++ include/xrpl/tx/SignerEntries.h | 8 +- include/xrpl/tx/Transactor.h | 16 ++ include/xrpl/tx/apply.h | 6 +- include/xrpl/tx/applySteps.h | 14 +- include/xrpl/tx/invariants/AMMInvariant.h | 3 + .../xrpl/tx/invariants/DirectoryInvariant.h | 2 + include/xrpl/tx/invariants/FreezeInvariant.h | 3 + include/xrpl/tx/invariants/InvariantCheck.h | 7 +- .../tx/invariants/InvariantCheckPrivilege.h | 1 + .../xrpl/tx/invariants/LoanBrokerInvariant.h | 2 + include/xrpl/tx/invariants/LoanInvariant.h | 3 + include/xrpl/tx/invariants/MPTInvariant.h | 8 + include/xrpl/tx/invariants/NFTInvariant.h | 3 +- .../tx/invariants/PermissionedDEXInvariant.h | 3 + .../invariants/PermissionedDomainInvariant.h | 3 + include/xrpl/tx/invariants/VaultInvariant.h | 5 + include/xrpl/tx/paths/AMMLiquidity.h | 10 +- include/xrpl/tx/paths/AMMOffer.h | 8 +- include/xrpl/tx/paths/BookTip.h | 7 +- include/xrpl/tx/paths/Flow.h | 7 + include/xrpl/tx/paths/Offer.h | 12 +- include/xrpl/tx/paths/OfferStream.h | 7 +- include/xrpl/tx/paths/RippleCalc.h | 5 + include/xrpl/tx/paths/detail/EitherAmount.h | 7 +- include/xrpl/tx/paths/detail/FlowDebugInfo.h | 12 +- include/xrpl/tx/paths/detail/StepChecks.h | 6 + include/xrpl/tx/paths/detail/Steps.h | 16 +- include/xrpl/tx/paths/detail/StrandFlow.h | 21 ++- .../tx/transactors/account/AccountDelete.h | 7 + .../xrpl/tx/transactors/account/AccountSet.h | 10 +- .../tx/transactors/account/SetRegularKey.h | 7 + .../tx/transactors/account/SignerListSet.h | 9 + .../xrpl/tx/transactors/bridge/XChainBridge.h | 11 +- .../xrpl/tx/transactors/check/CheckCancel.h | 7 + include/xrpl/tx/transactors/check/CheckCash.h | 7 + .../xrpl/tx/transactors/check/CheckCreate.h | 7 + .../credentials/CredentialAccept.h | 9 + .../credentials/CredentialCreate.h | 9 + .../credentials/CredentialDelete.h | 9 + .../tx/transactors/delegate/DelegateSet.h | 8 + include/xrpl/tx/transactors/dex/AMMBid.h | 7 + include/xrpl/tx/transactors/dex/AMMClawback.h | 13 ++ include/xrpl/tx/transactors/dex/AMMCreate.h | 7 + include/xrpl/tx/transactors/dex/AMMDelete.h | 7 + include/xrpl/tx/transactors/dex/AMMDeposit.h | 14 ++ include/xrpl/tx/transactors/dex/AMMVote.h | 7 + include/xrpl/tx/transactors/dex/AMMWithdraw.h | 18 +- include/xrpl/tx/transactors/dex/OfferCancel.h | 8 +- include/xrpl/tx/transactors/dex/OfferCreate.h | 20 ++ include/xrpl/tx/transactors/did/DIDDelete.h | 10 + include/xrpl/tx/transactors/did/DIDSet.h | 7 + .../xrpl/tx/transactors/escrow/EscrowCancel.h | 7 + .../xrpl/tx/transactors/escrow/EscrowCreate.h | 7 + .../xrpl/tx/transactors/escrow/EscrowFinish.h | 7 + .../lending/LoanBrokerCoverClawback.h | 7 + .../lending/LoanBrokerCoverDeposit.h | 7 + .../lending/LoanBrokerCoverWithdraw.h | 7 + .../tx/transactors/lending/LoanBrokerDelete.h | 7 + .../tx/transactors/lending/LoanBrokerSet.h | 10 + .../xrpl/tx/transactors/lending/LoanDelete.h | 7 + .../xrpl/tx/transactors/lending/LoanManage.h | 11 ++ include/xrpl/tx/transactors/lending/LoanPay.h | 9 + include/xrpl/tx/transactors/lending/LoanSet.h | 13 +- .../tx/transactors/nft/NFTokenAcceptOffer.h | 10 + include/xrpl/tx/transactors/nft/NFTokenBurn.h | 7 + .../tx/transactors/nft/NFTokenCancelOffer.h | 7 + .../tx/transactors/nft/NFTokenCreateOffer.h | 9 + include/xrpl/tx/transactors/nft/NFTokenMint.h | 12 +- .../xrpl/tx/transactors/nft/NFTokenModify.h | 7 + .../xrpl/tx/transactors/oracle/OracleDelete.h | 9 + .../xrpl/tx/transactors/oracle/OracleSet.h | 7 + .../tx/transactors/payment/DepositPreauth.h | 9 + include/xrpl/tx/transactors/payment/Payment.h | 12 ++ .../payment_channel/PaymentChannelClaim.h | 9 + .../payment_channel/PaymentChannelCreate.h | 7 + .../payment_channel/PaymentChannelFund.h | 7 + .../PermissionedDomainDelete.h | 7 + .../PermissionedDomainSet.h | 7 + include/xrpl/tx/transactors/system/Batch.h | 11 ++ include/xrpl/tx/transactors/system/Change.h | 7 + .../tx/transactors/system/LedgerStateFix.h | 9 + .../xrpl/tx/transactors/system/TicketCreate.h | 9 + include/xrpl/tx/transactors/token/Clawback.h | 7 + .../token/ConfidentialMPTClawback.h | 9 + .../token/ConfidentialMPTConvert.h | 9 + .../token/ConfidentialMPTConvertBack.h | 9 + .../token/ConfidentialMPTMergeInbox.h | 9 + .../transactors/token/ConfidentialMPTSend.h | 9 + .../tx/transactors/token/MPTokenAuthorize.h | 12 ++ .../transactors/token/MPTokenIssuanceCreate.h | 13 ++ .../token/MPTokenIssuanceDestroy.h | 7 + .../tx/transactors/token/MPTokenIssuanceSet.h | 9 + include/xrpl/tx/transactors/token/TrustSet.h | 12 +- .../xrpl/tx/transactors/vault/VaultClawback.h | 10 + .../xrpl/tx/transactors/vault/VaultCreate.h | 9 + .../xrpl/tx/transactors/vault/VaultDelete.h | 7 + .../xrpl/tx/transactors/vault/VaultDeposit.h | 7 + include/xrpl/tx/transactors/vault/VaultSet.h | 7 + .../xrpl/tx/transactors/vault/VaultWithdraw.h | 7 + src/libxrpl/core/detail/JobQueue.cpp | 1 + src/libxrpl/json/json_value.cpp | 2 + src/libxrpl/net/RegisterSSLCerts.cpp | 2 + src/libxrpl/protocol/AMMCore.cpp | 1 + src/libxrpl/protocol/ConfidentialTransfer.cpp | 1 + src/libxrpl/protocol/Permissions.cpp | 1 + src/libxrpl/protocol/STNumber.cpp | 2 +- src/libxrpl/server/State.cpp | 1 + src/libxrpl/server/Wallet.cpp | 2 + .../PermissionedDomainInvariant.cpp | 1 + .../tx/transactors/dex/OfferCreate.cpp | 1 + .../tx/transactors/nft/NFTokenCreateOffer.cpp | 1 + src/libxrpl/tx/transactors/system/Batch.cpp | 1 + src/test/app/FlowMPT_test.cpp | 1 + src/test/app/LedgerReplay_test.cpp | 1 + src/test/app/MultiSign_test.cpp | 1 + src/test/app/OfferMPT_test.cpp | 2 + src/test/app/PayStrand_test.cpp | 1 + src/test/app/SHAMapStore_test.cpp | 1 + src/test/basics/hardened_hash_test.cpp | 1 + src/test/beast/IPEndpointCommon.h | 4 + .../beast/aged_associative_container_test.cpp | 20 +- src/test/core/SociDB_test.cpp | 1 + src/test/csf.h | 19 -- src/test/csf/BasicNetwork.h | 2 + src/test/csf/CollectorRef.h | 7 + src/test/csf/Digraph.h | 5 +- src/test/csf/Histogram.h | 4 +- src/test/csf/Peer.h | 20 +- src/test/csf/PeerGroup.h | 9 + src/test/csf/Scheduler.h | 1 + src/test/csf/Sim.h | 8 +- src/test/csf/TrustGraph.h | 6 +- src/test/csf/Tx.h | 1 + src/test/csf/Validation.h | 4 +- src/test/csf/collectors.h | 10 + src/test/csf/events.h | 5 +- src/test/csf/ledgers.h | 8 +- src/test/csf/random.h | 3 + src/test/csf/submitters.h | 3 +- src/test/csf/timers.h | 1 + src/test/json/TestOutputSuite.h | 9 +- src/test/jtx.h | 60 ------ src/test/jtx/AMM.h | 23 ++- src/test/jtx/AMMTest.h | 12 ++ src/test/jtx/AbstractClient.h | 2 + src/test/jtx/Account.h | 4 +- src/test/jtx/CaptureLogs.h | 6 + src/test/jtx/CheckMessageLogs.h | 5 + src/test/jtx/ConfidentialTransfer.h | 22 --- src/test/jtx/Env.h | 27 ++- src/test/jtx/Env_ss.h | 6 + src/test/jtx/JTx.h | 3 + src/test/jtx/Oracle.h | 21 ++- src/test/jtx/PathSet.h | 16 +- src/test/jtx/TestHelpers.h | 33 +++- src/test/jtx/TestSuite.h | 4 +- src/test/jtx/TrustedPublisherServer.h | 19 ++ src/test/jtx/WSClient.h | 5 + src/test/jtx/account_txn_id.h | 3 + src/test/jtx/acctdelete.h | 4 +- src/test/jtx/amount.h | 14 +- src/test/jtx/balance.h | 4 + src/test/jtx/batch.h | 10 +- src/test/jtx/check.h | 6 +- src/test/jtx/credentials.h | 13 +- src/test/jtx/delegate.h | 6 + src/test/jtx/delivermin.h | 1 + src/test/jtx/deposit.h | 9 +- src/test/jtx/did.h | 8 +- src/test/jtx/directory.h | 6 +- src/test/jtx/domain.h | 3 + src/test/jtx/envconfig.h | 5 + src/test/jtx/escrow.h | 11 +- src/test/jtx/fee.h | 3 + src/test/jtx/flags.h | 4 + src/test/jtx/impl/Oracle.cpp | 1 + src/test/jtx/invoice_id.h | 3 + src/test/jtx/jtx_json.h | 3 + src/test/jtx/last_ledger_sequence.h | 3 + src/test/jtx/ledgerStateFix.h | 4 +- src/test/jtx/memo.h | 2 + src/test/jtx/mpt.h | 20 ++ src/test/jtx/multisign.h | 10 +- src/test/jtx/noop.h | 3 + src/test/jtx/offer.h | 2 + src/test/jtx/owners.h | 3 +- src/test/jtx/paths.h | 7 +- src/test/jtx/pay.h | 1 + src/test/jtx/permissioned_dex.h | 5 + src/test/jtx/permissioned_domains.h | 12 ++ src/test/jtx/prop.h | 2 + src/test/jtx/quality.h | 3 + src/test/jtx/require.h | 1 + src/test/jtx/rpc.h | 7 +- src/test/jtx/sendmax.h | 1 + src/test/jtx/seq.h | 2 + src/test/jtx/sig.h | 5 + src/test/jtx/tag.h | 3 + src/test/jtx/ter.h | 4 + src/test/jtx/ticket.h | 4 + src/test/jtx/token.h | 8 +- src/test/jtx/trust.h | 3 + src/test/jtx/txflags.h | 3 + src/test/jtx/utility.h | 4 +- src/test/jtx/vault.h | 2 +- src/test/jtx/xchain_bridge.h | 9 +- src/test/nodestore/TestBase.h | 11 +- src/test/protocol/STObject_test.cpp | 1 + src/test/protocol/STParsedJSON_test.cpp | 1 + src/test/rpc/GRPCTestClientBase.h | 32 ---- src/test/shamap/common.h | 13 ++ src/test/unit_test/FileDirGuard.h | 8 +- src/test/unit_test/SuiteJournal.h | 7 +- src/test/unit_test/multi_runner.h | 9 +- src/tests/libxrpl/CMakeLists.txt | 7 + src/tests/libxrpl/helpers/IOU.h | 2 +- src/tests/libxrpl/helpers/TestFamily.h | 9 + .../libxrpl/helpers/TestServiceRegistry.h | 5 + src/tests/libxrpl/helpers/TestSink.h | 2 + src/tests/libxrpl/helpers/TxTest.h | 10 +- .../libxrpl/protocol_autogen/TestHelpers.h | 1 + .../app/consensus/RCLCensorshipDetector.h | 2 +- src/xrpld/app/consensus/RCLConsensus.h | 20 +- src/xrpld/app/consensus/RCLCxLedger.h | 8 +- src/xrpld/app/consensus/RCLCxPeerPos.h | 3 + src/xrpld/app/consensus/RCLCxTx.h | 8 + src/xrpld/app/consensus/RCLValidations.h | 11 ++ src/xrpld/app/ledger/AcceptedLedger.h | 5 + src/xrpld/app/ledger/AccountStateSF.h | 6 + src/xrpld/app/ledger/BuildLedger.h | 4 + src/xrpld/app/ledger/ConsensusTransSetSF.cpp | 1 + src/xrpld/app/ledger/ConsensusTransSetSF.h | 7 + src/xrpld/app/ledger/InboundLedger.h | 17 ++ src/xrpld/app/ledger/InboundLedgers.h | 14 ++ src/xrpld/app/ledger/InboundTransactions.h | 7 + src/xrpld/app/ledger/LedgerCleaner.h | 2 + src/xrpld/app/ledger/LedgerHistory.h | 7 + src/xrpld/app/ledger/LedgerHolder.h | 3 + src/xrpld/app/ledger/LedgerMaster.h | 21 ++- src/xrpld/app/ledger/LedgerPersistence.h | 4 + src/xrpld/app/ledger/LedgerReplayTask.h | 5 + src/xrpld/app/ledger/LedgerReplayer.h | 11 +- src/xrpld/app/ledger/LedgerToJson.h | 8 +- src/xrpld/app/ledger/LocalTxs.h | 3 + src/xrpld/app/ledger/OpenLedger.h | 10 +- src/xrpld/app/ledger/OrderBookDBImpl.h | 11 ++ src/xrpld/app/ledger/TransactionMaster.h | 9 + src/xrpld/app/ledger/TransactionStateSF.h | 6 + .../app/ledger/detail/LedgerDeltaAcquire.cpp | 2 + .../app/ledger/detail/LedgerDeltaAcquire.h | 10 + src/xrpld/app/ledger/detail/LedgerMaster.cpp | 1 + .../ledger/detail/LedgerReplayMsgHandler.h | 5 +- .../app/ledger/detail/LedgerReplayTask.cpp | 1 + .../app/ledger/detail/SkipListAcquire.cpp | 2 + src/xrpld/app/ledger/detail/SkipListAcquire.h | 12 +- src/xrpld/app/ledger/detail/TimeoutCounter.h | 6 + .../app/ledger/detail/TransactionAcquire.h | 11 ++ src/xrpld/app/main/Application.cpp | 1 + src/xrpld/app/main/Application.h | 12 +- src/xrpld/app/main/BasicApp.h | 1 + src/xrpld/app/main/CollectorManager.h | 7 +- src/xrpld/app/main/GRPCServer.cpp | 1 + src/xrpld/app/main/GRPCServer.h | 15 +- src/xrpld/app/main/LoadManager.h | 2 +- src/xrpld/app/main/NodeIdentity.h | 2 + src/xrpld/app/main/NodeStoreScheduler.h | 1 + src/xrpld/app/main/Tuning.h | 1 + src/xrpld/app/misc/AmendmentTableImpl.h | 6 +- src/xrpld/app/misc/FeeVote.h | 6 + src/xrpld/app/misc/FeeVoteImpl.cpp | 1 + src/xrpld/app/misc/NegativeUNLVote.h | 7 + src/xrpld/app/misc/SHAMapStore.h | 7 +- src/xrpld/app/misc/SHAMapStoreImp.cpp | 1 + src/xrpld/app/misc/SHAMapStoreImp.h | 16 ++ src/xrpld/app/misc/Transaction.h | 9 + src/xrpld/app/misc/TxQ.h | 18 ++ src/xrpld/app/misc/ValidatorKeys.h | 2 + src/xrpld/app/misc/ValidatorList.h | 17 +- src/xrpld/app/misc/ValidatorSite.h | 9 +- src/xrpld/app/misc/detail/AccountTxPaging.h | 3 + src/xrpld/app/misc/detail/ValidatorSite.cpp | 1 - src/xrpld/app/misc/detail/WorkBase.h | 4 +- src/xrpld/app/misc/detail/WorkFile.h | 3 + src/xrpld/app/misc/detail/WorkPlain.h | 3 + src/xrpld/app/misc/detail/WorkSSL.h | 5 +- src/xrpld/app/misc/make_NetworkOPs.h | 3 +- src/xrpld/app/rdb/PeerFinder.h | 7 +- src/xrpld/app/rdb/backend/SQLiteDatabase.h | 12 ++ src/xrpld/app/rdb/backend/detail/Node.cpp | 2 + src/xrpld/app/rdb/backend/detail/Node.h | 24 +++ src/xrpld/app/rdb/detail/PeerFinder.cpp | 1 + src/xrpld/consensus/Consensus.h | 11 +- src/xrpld/consensus/ConsensusParms.h | 2 +- src/xrpld/consensus/ConsensusProposal.h | 1 + src/xrpld/consensus/ConsensusTypes.h | 4 + src/xrpld/consensus/DisputedTx.h | 5 + src/xrpld/consensus/LedgerTrie.h | 4 + src/xrpld/consensus/Validations.h | 11 +- src/xrpld/core/Config.h | 4 + src/xrpld/core/TimeKeeper.h | 1 + src/xrpld/overlay/Cluster.h | 5 + src/xrpld/overlay/Compression.h | 4 + src/xrpld/overlay/Message.h | 11 +- src/xrpld/overlay/Overlay.h | 11 ++ src/xrpld/overlay/Peer.h | 6 + src/xrpld/overlay/PeerSet.h | 9 + src/xrpld/overlay/ReduceRelayCommon.h | 2 + src/xrpld/overlay/Slot.h | 18 +- src/xrpld/overlay/Squelch.h | 1 + src/xrpld/overlay/detail/ConnectAttempt.h | 12 ++ src/xrpld/overlay/detail/Handshake.h | 6 +- src/xrpld/overlay/detail/OverlayImpl.h | 22 ++- src/xrpld/overlay/detail/PeerImp.h | 31 ++++ src/xrpld/overlay/detail/ProtocolMessage.h | 9 +- src/xrpld/overlay/detail/TrafficCount.h | 8 +- src/xrpld/overlay/detail/TxMetrics.h | 4 +- src/xrpld/overlay/detail/ZeroCopyStream.h | 11 +- src/xrpld/overlay/make_Overlay.h | 7 + src/xrpld/overlay/predicates.h | 1 + src/xrpld/peerfinder/PeerfinderManager.h | 9 + src/xrpld/peerfinder/Slot.h | 2 + src/xrpld/peerfinder/detail/Bootcache.h | 1 + src/xrpld/peerfinder/detail/Checker.h | 2 + src/xrpld/peerfinder/detail/Counts.h | 7 +- src/xrpld/peerfinder/detail/Fixed.h | 5 + src/xrpld/peerfinder/detail/Handouts.h | 5 + src/xrpld/peerfinder/detail/Livecache.h | 14 ++ src/xrpld/peerfinder/detail/Logic.h | 16 ++ src/xrpld/peerfinder/detail/SlotImp.h | 5 + src/xrpld/peerfinder/detail/Source.h | 4 + src/xrpld/peerfinder/detail/SourceStrings.h | 2 + src/xrpld/peerfinder/detail/Store.h | 6 + src/xrpld/peerfinder/detail/StoreSqdb.h | 9 + src/xrpld/peerfinder/detail/Tuning.h | 3 + src/xrpld/peerfinder/detail/iosformat.h | 3 + src/xrpld/peerfinder/make_Manager.h | 4 + src/xrpld/perflog/detail/PerfLogImp.cpp | 3 + src/xrpld/perflog/detail/PerfLogImp.h | 8 +- src/xrpld/rpc/BookChanges.h | 12 ++ src/xrpld/rpc/CTID.h | 7 +- src/xrpld/rpc/Context.h | 6 + src/xrpld/rpc/DeliveredAmount.h | 2 +- src/xrpld/rpc/GRPCHandlers.h | 8 +- src/xrpld/rpc/MPTokenIssuanceID.h | 2 +- src/xrpld/rpc/Output.h | 9 +- src/xrpld/rpc/RPCCall.h | 5 +- src/xrpld/rpc/RPCHandler.h | 5 + src/xrpld/rpc/RPCSub.h | 3 + src/xrpld/rpc/Role.h | 4 +- src/xrpld/rpc/ServerHandler.h | 17 +- src/xrpld/rpc/Status.h | 7 + src/xrpld/rpc/detail/AccountAssets.h | 6 +- src/xrpld/rpc/detail/AssetCache.h | 6 +- src/xrpld/rpc/detail/Handler.h | 10 +- src/xrpld/rpc/detail/MPT.h | 2 +- src/xrpld/rpc/detail/PathRequest.h | 16 +- src/xrpld/rpc/detail/PathRequestManager.h | 10 + src/xrpld/rpc/detail/Pathfinder.h | 16 +- src/xrpld/rpc/detail/PathfinderUtils.h | 4 + src/xrpld/rpc/detail/RPCHandler.cpp | 1 + src/xrpld/rpc/detail/RPCHelpers.h | 15 +- src/xrpld/rpc/detail/RPCLedgerHelpers.cpp | 4 + src/xrpld/rpc/detail/RPCLedgerHelpers.h | 9 +- src/xrpld/rpc/detail/TransactionSign.h | 5 + src/xrpld/rpc/detail/TrustLine.h | 7 +- src/xrpld/rpc/detail/Tuning.h | 2 + src/xrpld/rpc/detail/WSInfoSub.h | 3 + src/xrpld/rpc/handlers/Handlers.h | 2 + .../rpc/handlers/account/AccountNFTs.cpp | 1 + .../admin/peer/PeerReservationsDel.cpp | 1 + .../admin/peer/PeerReservationsList.cpp | 1 + .../rpc/handlers/admin/status/GetCounts.h | 2 + src/xrpld/rpc/handlers/ledger/Ledger.h | 8 +- .../rpc/handlers/ledger/LedgerEntryHelpers.h | 17 +- .../rpc/handlers/orderbook/BookChanges.cpp | 1 + .../handlers/orderbook/GetAggregatePrice.cpp | 1 + .../rpc/handlers/orderbook/NFTOffersHelpers.h | 12 +- src/xrpld/rpc/handlers/server_info/Version.h | 7 + src/xrpld/rpc/json_body.h | 5 + src/xrpld/shamap/NodeFamily.cpp | 1 + src/xrpld/shamap/NodeFamily.h | 9 + 662 files changed, 3870 insertions(+), 743 deletions(-) create mode 100644 cmake/verify_headers.cmake delete mode 100644 include/xrpl/beast/insight/Insight.h delete mode 100644 include/xrpl/protocol/st.h delete mode 100644 include/xrpl/resource/Types.h delete mode 100644 src/test/csf.h delete mode 100644 src/test/jtx.h delete mode 100644 src/test/rpc/GRPCTestClientBase.h diff --git a/.clang-tidy b/.clang-tidy index e12c73cc56..84849db7a0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -147,7 +147,7 @@ CheckOptions: bugprone-unsafe-functions.ReportMoreUnsafeFunctions: true bugprone-unused-return-value.CheckedReturnTypes: ::std::error_code;::std::error_condition;::std::errc - misc-include-cleaner.IgnoreHeaders: ".*/(detail|impl)/.*;.*fwd\\.h(pp)?;time.h;stdlib.h;sqlite3.h;netinet/in\\.h;sys/resource\\.h;sys/sysinfo\\.h;linux/sysinfo\\.h;__chrono/.*;bits/.*;_abort\\.h;boost/uuid/uuid_hash.hpp;boost/beast/core/flat_buffer\\.hpp;boost/beast/http/field\\.hpp;boost/beast/http/dynamic_body\\.hpp;boost/beast/http/message\\.hpp;boost/beast/http/read\\.hpp;boost/beast/http/write\\.hpp;openssl/obj_mac\\.h" + misc-include-cleaner.IgnoreHeaders: ".*/(detail|impl)/.*;.*fwd\\.h(pp)?;time.h;stdlib.h;sqlite3.h;netinet/in\\.h;sys/resource\\.h;sys/sysinfo\\.h;linux/sysinfo\\.h;__chrono/.*;bits/.*;_abort\\.h;boost/.*;openssl/obj_mac\\.h" readability-braces-around-statements.ShortStatementLines: 2 readability-identifier-naming.MacroDefinitionCase: UPPER_CASE diff --git a/.gersemi/definitions.cmake b/.gersemi/definitions.cmake index 58bc74c70a..aa63076c8b 100644 --- a/.gersemi/definitions.cmake +++ b/.gersemi/definitions.cmake @@ -48,6 +48,12 @@ endfunction() function(add_module parent name) endfunction() +function(verify_target_headers target headers_dir) +endfunction() + +function(_verify_add_headers target dir) +endfunction() + function(setup_protocol_autogen) endfunction() diff --git a/.github/scripts/levelization/results/loops.txt b/.github/scripts/levelization/results/loops.txt index fb449441e3..cf70468e32 100644 --- a/.github/scripts/levelization/results/loops.txt +++ b/.github/scripts/levelization/results/loops.txt @@ -1,9 +1,3 @@ -Loop: test.jtx test.toplevel - test.toplevel > test.jtx - -Loop: test.jtx test.unit_test - test.unit_test ~= test.jtx - Loop: xrpld.app xrpld.overlay xrpld.app > xrpld.overlay diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index 7b31042158..5cc49dd2f5 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -105,9 +105,9 @@ test.csf > xrpl.basics test.csf > xrpld.consensus test.csf > xrpl.json test.csf > xrpl.ledger -test.csf > xrpl.protocol test.json > test.jtx test.json > xrpl.json +test.jtx > test.unit_test test.jtx > xrpl.basics test.jtx > xrpl.config test.jtx > xrpl.core @@ -194,8 +194,6 @@ test.shamap > xrpl.config test.shamap > xrpl.nodestore test.shamap > xrpl.protocol test.shamap > xrpl.shamap -test.toplevel > test.csf -test.toplevel > xrpl.json test.unit_test > xrpl.basics test.unit_test > xrpl.protocol tests.libxrpl > xrpl.basics @@ -218,11 +216,14 @@ xrpl.core > xrpl.json xrpl.core > xrpl.protocol xrpl.json > xrpl.basics xrpl.ledger > xrpl.basics +xrpl.ledger > xrpl.json +xrpl.ledger > xrpl.nodestore xrpl.ledger > xrpl.protocol xrpl.ledger > xrpl.shamap xrpl.net > xrpl.basics xrpl.nodestore > xrpl.basics xrpl.nodestore > xrpl.config +xrpl.nodestore > xrpl.json xrpl.nodestore > xrpl.protocol xrpl.protocol > xrpl.basics xrpl.protocol > xrpl.json @@ -240,7 +241,6 @@ xrpl.server > xrpl.json xrpl.server > xrpl.protocol xrpl.server > xrpl.rdb xrpl.server > xrpl.resource -xrpl.server > xrpl.shamap xrpl.shamap > xrpl.basics xrpl.shamap > xrpl.nodestore xrpl.shamap > xrpl.protocol @@ -295,8 +295,10 @@ xrpld.peerfinder > xrpl.rdb xrpld.perflog > xrpl.basics xrpld.perflog > xrpl.config xrpld.perflog > xrpl.core +xrpld.perflog > xrpld.app xrpld.perflog > xrpld.rpc xrpld.perflog > xrpl.json +xrpld.perflog > xrpl.nodestore xrpld.perflog > xrpl.protocol xrpld.rpc > xrpl.basics xrpld.rpc > xrpl.config @@ -314,5 +316,6 @@ xrpld.rpc > xrpl.shamap xrpld.rpc > xrpl.tx xrpld.shamap > xrpl.basics xrpld.shamap > xrpld.core +xrpld.shamap > xrpl.nodestore xrpld.shamap > xrpl.protocol xrpld.shamap > xrpl.shamap diff --git a/.github/workflows/reusable-clang-tidy.yml b/.github/workflows/reusable-clang-tidy.yml index 5528f3452e..a6bbe669ce 100644 --- a/.github/workflows/reusable-clang-tidy.yml +++ b/.github/workflows/reusable-clang-tidy.yml @@ -79,6 +79,7 @@ jobs: -Dtests=ON \ -Dwerr=ON \ -Dxrpld=ON \ + -Dverify_headers=ON \ .. # clang-tidy needs headers generated from proto files @@ -91,7 +92,7 @@ jobs: id: run_clang_tidy continue-on-error: true env: - TARGETS: ${{ needs.determine-files.outputs.need_full_run != 'true' && needs.determine-files.outputs.cpp_changed_files || 'src tests' }} + TARGETS: ${{ needs.determine-files.outputs.need_full_run != 'true' && needs.determine-files.outputs.cpp_changed_files || 'include src tests' }} run: | set -o pipefail run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" -quiet -fix -allow-no-checks ${TARGETS} 2>&1 | tee "${OUTPUT_FILE}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bac4d1140..2e4521870d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,8 +28,10 @@ repos: entry: ./bin/pre-commit/clang_tidy_check.py language: python types_or: [c++, c] - exclude: ^include/xrpl/protocol_autogen - pass_filenames: false # script determines the staged files itself + # .ipp fragments are included by their owning header rather than compiled + # as standalone translation units, so they have no compile_commands.json + # entry to lint (verify_headers checks them transitively). + exclude: '^include/xrpl/protocol_autogen|\.ipp$' - id: fix-include-style name: fix include style entry: ./bin/pre-commit/fix_include_style.py diff --git a/BUILD.md b/BUILD.md index 847cd7bc1a..6ccdde12d5 100644 --- a/BUILD.md +++ b/BUILD.md @@ -317,21 +317,41 @@ See [Sanitizers docs](./docs/build/sanitizers.md) for more details. ## Options -| Option | Default Value | Description | -| ---------- | ------------- | -------------------------------------------------------------- | -| `assert` | OFF | Force enabling assertions. | -| `coverage` | OFF | Prepare the coverage report. | -| `tests` | OFF | Build tests. | -| `unity` | OFF | Configure a unity build. | -| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. | -| `werr` | OFF | Treat compilation warnings as errors | -| `wextra` | OFF | Enable additional compilation warnings | +| Option | Default Value | Description | +| ---------------- | ------------- | ----------------------------------------------------------------------------- | +| `assert` | OFF | Force enabling assertions. | +| `coverage` | OFF | Prepare the coverage report. | +| `tests` | OFF | Build tests. | +| `unity` | OFF | Configure a unity build. | +| `verify_headers` | ON | Make the `verify-headers` target available to compile each header on its own. | +| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. | +| `werr` | OFF | Treat compilation warnings as errors | +| `wextra` | OFF | Enable additional compilation warnings | [Unity builds][unity-build] may be faster for the first build (at the cost of much more memory) since they concatenate sources into fewer translation units. Non-unity builds may be faster for incremental builds, and can be helpful for detecting `#include` omissions. +### Verifying headers + +The regular build only compiles `.cpp` files, so a header is only ever checked +through whatever translation unit happens to include it. A header that forgets +an `#include` is not caught as long as every `.cpp` that uses it includes its +missing dependency first. The `verify_headers` option (ON by default) adds a +`verify-headers` target that compiles every header on its own, which fails if a +header is not self-contained: + +```bash +cmake --build . --target verify-headers +``` + +The per-header objects are excluded from the `all` target, so a normal build +never compiles them; they are built only through `verify-headers`. The generated +translation units do appear in `compile_commands.json`, so clang-tidy (and +clangd and IDEs) can lint each header on its own. Pass `-Dverify_headers=OFF` to +omit them entirely. + ## Troubleshooting ### Conan diff --git a/bin/pre-commit/clang_tidy_check.py b/bin/pre-commit/clang_tidy_check.py index f134660671..d074c56acf 100755 --- a/bin/pre-commit/clang_tidy_check.py +++ b/bin/pre-commit/clang_tidy_check.py @@ -1,21 +1,22 @@ #!/usr/bin/env python3 -"""Pre-commit hook that runs clang-tidy on changed files using run-clang-tidy.""" +"""Pre-commit hook that runs clang-tidy on changed files using run-clang-tidy. + +The set of files is chosen by pre-commit (see .pre-commit-config.yaml), which +filters to C/C++ sources and excludes `.ipp` fragments. Headers are linted +directly: the `verify_headers` build option (ON by default) compiles every +`.h`/`.hpp` on its own, so each header is the main file of its own +compile_commands.json entry and run-clang-tidy can analyse it just like a +`.cpp`. +""" from __future__ import annotations -import json import os -import re import shutil import subprocess import sys -from collections import defaultdict from pathlib import Path -HEADER_EXTENSIONS = {".h", ".hpp", ".ipp"} -SOURCE_EXTENSIONS = {".cpp"} -INCLUDE_RE = re.compile(r"^\s*#\s*include\s*[<\"]([^>\"]+)[>\"]") - def find_run_clang_tidy() -> str | None: for candidate in ("run-clang-tidy-21", "run-clang-tidy"): @@ -32,150 +33,11 @@ def find_build_dir(repo_root: Path) -> Path | None: return None -def build_include_graph(build_dir: Path, repo_root: Path) -> tuple[dict, set]: - """ - Scan all files reachable from compile_commands.json and build an inverted include graph. - - Returns: - inverted: header_path -> set of files that include it - source_files: set of all TU paths from compile_commands.json - """ - with open(build_dir / "compile_commands.json") as f: - db = json.load(f) - - source_files = {Path(e["file"]).resolve() for e in db} - include_roots = [repo_root / "include", repo_root / "src"] - inverted: dict[Path, set[Path]] = defaultdict(set) - - to_scan: set[Path] = set(source_files) - scanned: set[Path] = set() - - while to_scan: - file = to_scan.pop() - if file in scanned or not file.exists(): - continue - scanned.add(file) - - content = file.read_text() - - for line in content.splitlines(): - m = INCLUDE_RE.match(line) - if not m: - continue - for root in include_roots: - candidate = (root / m.group(1)).resolve() - if candidate.exists(): - inverted[candidate].add(file) - if candidate not in scanned: - to_scan.add(candidate) - break - - return inverted, source_files - - -def find_tus_for_headers( - headers: list[Path], - inverted: dict[Path, set[Path]], - source_files: set[Path], -) -> set[Path]: - """ - For each header, pick one TU that transitively includes it. - Prefers a TU whose stem matches the header's stem, otherwise picks the first found. - """ - result: set[Path] = set() - - for header in headers: - preferred: Path | None = None - visited: set[Path] = {header} - stack: list[Path] = [header] - - while stack: - h = stack.pop() - for inc in inverted.get(h, ()): - if inc in source_files: - if inc.stem == header.stem: - preferred = inc - break - if preferred is None: - preferred = inc - if inc not in visited: - visited.add(inc) - stack.append(inc) - if preferred is not None and preferred.stem == header.stem: - break - - if preferred is not None: - result.add(preferred) - - return result - - -def resolve_files( - input_files: list[str], build_dir: Path, repo_root: Path -) -> list[str]: - """ - Split input into source files and headers. Source files are passed through; - headers are resolved to the TUs that transitively include them. - """ - sources: list[Path] = [] - headers: list[Path] = [] - - for f in input_files: - p = Path(f).resolve() - if p.suffix in SOURCE_EXTENSIONS: - sources.append(p) - elif p.suffix in HEADER_EXTENSIONS: - headers.append(p) - - if not headers: - return [str(p) for p in sources] - - print( - f"Resolving {len(headers)} header(s) to compilation units...", file=sys.stderr - ) - inverted, source_files = build_include_graph(build_dir, repo_root) - tus = find_tus_for_headers(headers, inverted, source_files) - - if not tus: - print( - "Warning: no compilation units found that include the modified headers; " - "skipping clang-tidy for headers.", - file=sys.stderr, - ) - - return sorted({str(p) for p in (*sources, *tus)}) - - -def staged_files(repo_root: Path) -> list[str]: - result = subprocess.run( - ["git", "diff", "--staged", "--name-only", "--diff-filter=d"], - capture_output=True, - text=True, - cwd=repo_root, - ) - if result.returncode != 0: - print( - "clang-tidy check failed: 'git diff --staged' command failed.", - file=sys.stderr, - ) - if result.stderr: - print(result.stderr, file=sys.stderr) - sys.exit(result.returncode or 1) - return [str(repo_root / p) for p in result.stdout.splitlines() if p] - - def main(): if not os.environ.get("TIDY"): return 0 - repo_root = Path( - subprocess.check_output( - ["git", "rev-parse", "--show-toplevel"], - cwd=Path(__file__).parent, - text=True, - ).strip() - ) - files = staged_files(repo_root) + files = sys.argv[1:] if not files: return 0 @@ -188,6 +50,13 @@ def main(): ) return 1 + repo_root = Path( + subprocess.check_output( + ["git", "rev-parse", "--show-toplevel"], + cwd=Path(__file__).parent, + text=True, + ).strip() + ) build_dir = find_build_dir(repo_root) if not build_dir: print( @@ -197,13 +66,9 @@ def main(): ) return 1 - tidy_files = resolve_files(files, build_dir, repo_root) - if not tidy_files: - return 0 - result = subprocess.run( [run_clang_tidy, "-quiet", "-p", str(build_dir), "-fix", "-allow-no-checks"] - + tidy_files + + files ) return result.returncode diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 4d4a800d9a..3e49267715 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -293,4 +293,13 @@ if(xrpld) PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk ) endif() + + # The xrpld headers are not built with add_module, so verify them against + # the executable's own compile environment. + if(verify_headers) + verify_target_headers(xrpld "${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld") + if(tests) + verify_target_headers(xrpld "${CMAKE_CURRENT_SOURCE_DIR}/src/test") + endif() + endif() endif() diff --git a/cmake/XrplSettings.cmake b/cmake/XrplSettings.cmake index 44a727a994..757a596096 100644 --- a/cmake/XrplSettings.cmake +++ b/cmake/XrplSettings.cmake @@ -30,6 +30,23 @@ if(tests) endif() endif() +# Enabled by default so every header is compiled on its own as the main file of +# its own compile_commands.json entry - this is what lets clang-tidy (and clangd +# and IDEs) analyse a header's own includes directly. The per-header objects are +# EXCLUDE_FROM_ALL (see cmake/verify_headers.cmake) and the aggregate target +# below is not part of `all`, so a normal `cmake --build` never compiles them. +option( + verify_headers + "Compile every header on its own to verify it is self-contained." + ON +) +if(verify_headers) + # Aggregate target that builds every per-module header-verification library + # created by add_module (see cmake/verify_headers.cmake). Build it with: + # cmake --build . --target verify-headers + add_custom_target(verify-headers) +endif() + option(unity "Creates a build using UNITY support in cmake." OFF) if(unity) if(NOT is_ci) diff --git a/cmake/add_module.cmake b/cmake/add_module.cmake index 316d6c627b..b72d1077bb 100644 --- a/cmake/add_module.cmake +++ b/cmake/add_module.cmake @@ -1,4 +1,5 @@ include(isolate_headers) +include(verify_headers) # Create an OBJECT library target named # @@ -37,4 +38,20 @@ function(add_module parent name) "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}" PRIVATE ) + # protocol_autogen contains generated headers that are deliberately exempt + # from clang-tidy (see ExcludeHeaderFilterRegex in .clang-tidy), so we do not + # verify them either. + if( + verify_headers + AND NOT "${parent}/${name}" STREQUAL "xrpl/protocol_autogen" + ) + verify_target_headers( + ${target} + "${CMAKE_CURRENT_SOURCE_DIR}/include/${parent}/${name}" + ) + verify_target_headers( + ${target} + "${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}" + ) + endif() endfunction() diff --git a/cmake/verify_headers.cmake b/cmake/verify_headers.cmake new file mode 100644 index 0000000000..2c36869441 --- /dev/null +++ b/cmake/verify_headers.cmake @@ -0,0 +1,84 @@ +# Our normal build only ever compiles `.cpp` files, so a header is only ever +# checked through whatever translation unit happens to include it. A header that +# is missing an `#include` is never caught as long as every `.cpp` that uses it +# includes its missing dependency first. To check a header on its own we compile +# it directly as a translation unit. +# +# Compiling the header itself - rather than a `.cpp` wrapper that includes it - +# gives two checks at once: +# * the compiler fails if the header is not self-contained, i.e. it uses a +# declaration that is not available (directly or transitively); and +# * the header is the *main file* of its `compile_commands.json` entry, so +# clang-tidy's misc-include-cleaner analyses (and can --fix) the header's own +# includes - flagging a dependency that is only available transitively, which +# a plain compile cannot catch. A wrapper would be the main file instead, and +# include-cleaner never looks inside the headers a main file includes. +# +# The objects are never linked anywhere; we build them only for these checks. + +# Verify that the headers under headers_dir compile on their own, using the +# compile environment of an existing target so each header is compiled exactly as +# that target compiles it. This works for both add_module libraries and the xrpld +# and test binaries: a library's isolated public and private include directories +# and a binary's `-I src` both live in its INCLUDE_DIRECTORIES, and the modules or +# libraries it links live in its LINK_LIBRARIES. We copy those usage requirements +# through generator expressions (rather than linking ${target}, which is +# impossible for an executable), evaluated at generation time so they capture +# requirements the caller adds after this runs. The verify library is created +# once; call this repeatedly to add more header directories. +# +# verify_target_headers(target headers_dir) +function(verify_target_headers target headers_dir) + set(verify ${target}.verify) + if(NOT TARGET ${verify}) + add_library(${verify} OBJECT EXCLUDE_FROM_ALL) + # A unity build would concatenate the headers into a single translation + # unit, where a header missing an include could be satisfied by one that + # precedes it in the blob - exactly the bug we want to catch. + set_target_properties(${verify} PROPERTIES UNITY_BUILD OFF) + target_include_directories( + ${verify} + PRIVATE $ + ) + target_compile_definitions( + ${verify} + PRIVATE $ + ) + target_compile_options( + ${verify} + PRIVATE $ + ) + target_link_libraries( + ${verify} + PRIVATE $ + ) + add_dependencies(verify-headers ${verify}) + endif() + _verify_add_headers(${verify} "${headers_dir}") +endfunction() + +# Add every .h/.hpp under dir to target as a directly-compiled C++ translation +# unit. .ipp files are inline-implementation fragments included by their owning +# header (often after a class declaration), so they are not self-contained on +# their own and are verified transitively when that header is verified. +function(_verify_add_headers target dir) + file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${dir}/*.h" "${dir}/*.hpp") + if(NOT headers) + return() + endif() + # `-xc++` forces the header to be compiled as a C++ translation unit; a lone + # `.h` is otherwise treated as a header to precompile. `#pragma once` is + # harmless (and warns) when the header is the main file, so silence it. + # Compiled on its own, a header legitimately defines constants and static or + # template functions that nothing in this single translation unit uses (they + # exist for the files that include it), so the resulting unused-entity + # warnings are expected and must not fail the build under -Werror. + set_source_files_properties( + ${headers} + PROPERTIES + LANGUAGE CXX + COMPILE_OPTIONS + "-xc++;-Wno-pragma-once-outside-header;-Wno-unused-const-variable;-Wno-unused-function" + ) + target_sources(${target} PRIVATE ${headers}) +endfunction() diff --git a/include/xrpl/basics/Buffer.h b/include/xrpl/basics/Buffer.h index 59968a4fa4..c0ae8ef56e 100644 --- a/include/xrpl/basics/Buffer.h +++ b/include/xrpl/basics/Buffer.h @@ -6,6 +6,7 @@ #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/CompressionAlgorithms.h b/include/xrpl/basics/CompressionAlgorithms.h index e24c490337..a5ec8645b6 100644 --- a/include/xrpl/basics/CompressionAlgorithms.h +++ b/include/xrpl/basics/CompressionAlgorithms.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/basics/DecayingSample.h b/include/xrpl/basics/DecayingSample.h index 910c8f9e14..86a8baa62e 100644 --- a/include/xrpl/basics/DecayingSample.h +++ b/include/xrpl/basics/DecayingSample.h @@ -2,6 +2,7 @@ #include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/FileUtilities.h b/include/xrpl/basics/FileUtilities.h index 8cf7e4893f..c7a427b8a9 100644 --- a/include/xrpl/basics/FileUtilities.h +++ b/include/xrpl/basics/FileUtilities.h @@ -3,7 +3,9 @@ #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/IntrusivePointer.h b/include/xrpl/basics/IntrusivePointer.h index d66c340d3f..c23d6afb85 100644 --- a/include/xrpl/basics/IntrusivePointer.h +++ b/include/xrpl/basics/IntrusivePointer.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include diff --git a/include/xrpl/basics/IntrusiveRefCounts.h b/include/xrpl/basics/IntrusiveRefCounts.h index 0b00f1d5b1..5eb1422541 100644 --- a/include/xrpl/basics/IntrusiveRefCounts.h +++ b/include/xrpl/basics/IntrusiveRefCounts.h @@ -3,6 +3,7 @@ #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/basics/Log.h b/include/xrpl/basics/Log.h index 0699cdd3d9..4e3437fe71 100644 --- a/include/xrpl/basics/Log.h +++ b/include/xrpl/basics/Log.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include @@ -11,7 +10,9 @@ #include #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index cee0c45355..073da12f89 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -2,7 +2,9 @@ #include +#include #include +#include #include #include #include @@ -11,7 +13,9 @@ #include #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/RangeSet.h b/include/xrpl/basics/RangeSet.h index e1cee8b6c4..2ed543b376 100644 --- a/include/xrpl/basics/RangeSet.h +++ b/include/xrpl/basics/RangeSet.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/basics/Resolver.h b/include/xrpl/basics/Resolver.h index 3b6a950247..d48958b76d 100644 --- a/include/xrpl/basics/Resolver.h +++ b/include/xrpl/basics/Resolver.h @@ -3,6 +3,7 @@ #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/basics/ResolverAsio.h b/include/xrpl/basics/ResolverAsio.h index 2764777327..0b78b9747c 100644 --- a/include/xrpl/basics/ResolverAsio.h +++ b/include/xrpl/basics/ResolverAsio.h @@ -5,6 +5,8 @@ #include +#include + namespace xrpl { class ResolverAsio : public Resolver diff --git a/include/xrpl/basics/SHAMapHash.h b/include/xrpl/basics/SHAMapHash.h index 76d9d4fa3d..3c3d525022 100644 --- a/include/xrpl/basics/SHAMapHash.h +++ b/include/xrpl/basics/SHAMapHash.h @@ -3,7 +3,9 @@ #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/SharedWeakCachePointer.h b/include/xrpl/basics/SharedWeakCachePointer.h index c2c3239eea..a143647a1e 100644 --- a/include/xrpl/basics/SharedWeakCachePointer.h +++ b/include/xrpl/basics/SharedWeakCachePointer.h @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include diff --git a/include/xrpl/basics/SlabAllocator.h b/include/xrpl/basics/SlabAllocator.h index 0172b1ade2..8e741991f6 100644 --- a/include/xrpl/basics/SlabAllocator.h +++ b/include/xrpl/basics/SlabAllocator.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #if BOOST_OS_LINUX diff --git a/include/xrpl/basics/StringUtilities.h b/include/xrpl/basics/StringUtilities.h index 1d3434b7ed..97df43d68f 100644 --- a/include/xrpl/basics/StringUtilities.h +++ b/include/xrpl/basics/StringUtilities.h @@ -1,18 +1,19 @@ #pragma once #include -#include #include #include #include #include +#include #include #include #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/TaggedCache.h b/include/xrpl/basics/TaggedCache.h index 973fcd828a..71ebfc57a4 100644 --- a/include/xrpl/basics/TaggedCache.h +++ b/include/xrpl/basics/TaggedCache.h @@ -1,17 +1,24 @@ #pragma once -#include -#include -#include +#include +#include // IWYU pragma: keep #include #include #include -#include +#include +#include +#include +#include +#include #include +#include #include +#include #include +#include #include +#include #include #include #include diff --git a/include/xrpl/basics/TaggedCache.ipp b/include/xrpl/basics/TaggedCache.ipp index 7e812ce4c7..ffcd533216 100644 --- a/include/xrpl/basics/TaggedCache.ipp +++ b/include/xrpl/basics/TaggedCache.ipp @@ -1,6 +1,7 @@ #pragma once #include +#include // IWYU pragma: keep #include namespace xrpl { diff --git a/include/xrpl/basics/UnorderedContainers.h b/include/xrpl/basics/UnorderedContainers.h index 5a417d5045..e0700c4055 100644 --- a/include/xrpl/basics/UnorderedContainers.h +++ b/include/xrpl/basics/UnorderedContainers.h @@ -2,12 +2,14 @@ #include #include -#include #include #include +#include +#include #include #include +#include /** * Use hash_* containers for keys that do not need a cryptographically secure diff --git a/include/xrpl/basics/base64.h b/include/xrpl/basics/base64.h index 660958ce14..24fd660e65 100644 --- a/include/xrpl/basics/base64.h +++ b/include/xrpl/basics/base64.h @@ -34,6 +34,7 @@ #pragma once +#include #include #include #include diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index 93520ff699..e6ca1993f9 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -18,8 +19,17 @@ #include #include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/basics/chrono.h b/include/xrpl/basics/chrono.h index 5d6de06248..61246fc699 100644 --- a/include/xrpl/basics/chrono.h +++ b/include/xrpl/basics/chrono.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/hardened_hash.h b/include/xrpl/basics/hardened_hash.h index b8ea1e0f3f..5a855736b3 100644 --- a/include/xrpl/basics/hardened_hash.h +++ b/include/xrpl/basics/hardened_hash.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/include/xrpl/basics/join.h b/include/xrpl/basics/join.h index c214212473..492e4f3122 100644 --- a/include/xrpl/basics/join.h +++ b/include/xrpl/basics/join.h @@ -1,7 +1,9 @@ #pragma once +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/basics/make_SSLContext.h b/include/xrpl/basics/make_SSLContext.h index 46f6a15e84..45ac637c36 100644 --- a/include/xrpl/basics/make_SSLContext.h +++ b/include/xrpl/basics/make_SSLContext.h @@ -2,6 +2,7 @@ #include +#include #include namespace xrpl { diff --git a/include/xrpl/basics/partitioned_unordered_map.h b/include/xrpl/basics/partitioned_unordered_map.h index c51cedf2dd..c2750a5769 100644 --- a/include/xrpl/basics/partitioned_unordered_map.h +++ b/include/xrpl/basics/partitioned_unordered_map.h @@ -3,7 +3,10 @@ #include #include +#include #include +#include +#include #include #include #include diff --git a/include/xrpl/basics/random.h b/include/xrpl/basics/random.h index 0b298e12d9..cceaa6f029 100644 --- a/include/xrpl/basics/random.h +++ b/include/xrpl/basics/random.h @@ -3,7 +3,6 @@ #include #include -#include #include #include #include diff --git a/include/xrpl/basics/safe_cast.h b/include/xrpl/basics/safe_cast.h index f71edc47ad..714146e089 100644 --- a/include/xrpl/basics/safe_cast.h +++ b/include/xrpl/basics/safe_cast.h @@ -1,7 +1,5 @@ #pragma once -#include - #include namespace xrpl { diff --git a/include/xrpl/basics/strHex.h b/include/xrpl/basics/strHex.h index 9cae234f06..1366515bd3 100644 --- a/include/xrpl/basics/strHex.h +++ b/include/xrpl/basics/strHex.h @@ -3,6 +3,9 @@ #include #include +#include +#include + namespace xrpl { template diff --git a/include/xrpl/basics/tagged_integer.h b/include/xrpl/basics/tagged_integer.h index ddcde479f3..8fbd2a274b 100644 --- a/include/xrpl/basics/tagged_integer.h +++ b/include/xrpl/basics/tagged_integer.h @@ -7,6 +7,7 @@ #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/beast/asio/io_latency_probe.h b/include/xrpl/beast/asio/io_latency_probe.h index 5e1b098dcb..f67ff4a692 100644 --- a/include/xrpl/beast/asio/io_latency_probe.h +++ b/include/xrpl/beast/asio/io_latency_probe.h @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/include/xrpl/beast/container/aged_container_utility.h b/include/xrpl/beast/container/aged_container_utility.h index 879672e9cf..7cda863fab 100644 --- a/include/xrpl/beast/container/aged_container_utility.h +++ b/include/xrpl/beast/container/aged_container_utility.h @@ -3,6 +3,7 @@ #include #include +#include #include namespace beast { diff --git a/include/xrpl/beast/container/aged_map.h b/include/xrpl/beast/container/aged_map.h index c1f6943451..20daab70a4 100644 --- a/include/xrpl/beast/container/aged_map.h +++ b/include/xrpl/beast/container/aged_map.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace beast { diff --git a/include/xrpl/beast/container/aged_multimap.h b/include/xrpl/beast/container/aged_multimap.h index 65efd1bbf9..f6133ced1c 100644 --- a/include/xrpl/beast/container/aged_multimap.h +++ b/include/xrpl/beast/container/aged_multimap.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace beast { diff --git a/include/xrpl/beast/container/aged_unordered_map.h b/include/xrpl/beast/container/aged_unordered_map.h index a2189e2409..d6ea6e97bd 100644 --- a/include/xrpl/beast/container/aged_unordered_map.h +++ b/include/xrpl/beast/container/aged_unordered_map.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace beast { diff --git a/include/xrpl/beast/container/aged_unordered_multimap.h b/include/xrpl/beast/container/aged_unordered_multimap.h index f1348ed39f..3b72be98b7 100644 --- a/include/xrpl/beast/container/aged_unordered_multimap.h +++ b/include/xrpl/beast/container/aged_unordered_multimap.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace beast { diff --git a/include/xrpl/beast/container/detail/aged_ordered_container.h b/include/xrpl/beast/container/detail/aged_ordered_container.h index 4cb2246a22..0533a51f00 100644 --- a/include/xrpl/beast/container/detail/aged_ordered_container.h +++ b/include/xrpl/beast/container/detail/aged_ordered_container.h @@ -11,9 +11,14 @@ #include #include +#include +#include +#include #include #include #include +#include +#include #include #include @@ -1247,12 +1252,7 @@ AgedOrderedContainer::AgedOrd template AgedOrderedContainer::AgedOrderedContainer( AgedOrderedContainer const& other) - : config_(other.config_) -#if BOOST_VERSION >= 108000 - , cont_(other.cont_.get_comp()) -#else - , cont_(other.cont_.comp()) -#endif + : config_(other.config_), cont_(other.cont_.get_comp()) { insert(other.cbegin(), other.cend()); } @@ -1261,12 +1261,7 @@ template ::AgedOrderedContainer( AgedOrderedContainer const& other, Allocator const& alloc) - : config_(other.config_, alloc) -#if BOOST_VERSION >= 108000 - , cont_(other.cont_.get_comp()) -#else - , cont_(other.cont_.comp()) -#endif + : config_(other.config_, alloc), cont_(other.cont_.get_comp()) { insert(other.cbegin(), other.cend()); } @@ -1283,13 +1278,7 @@ template ::AgedOrderedContainer( AgedOrderedContainer&& other, // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) Allocator const& alloc) - : config_(std::move(other.config_), alloc) -#if BOOST_VERSION >= 108000 - , cont_(std::move(other.cont_.get_comp())) -#else - , cont_(std::move(other.cont_.comp())) -#endif - + : config_(std::move(other.config_), alloc), cont_(std::move(other.cont_.get_comp())) { insert(other.cbegin(), other.cend()); other.clear(); diff --git a/include/xrpl/beast/container/detail/aged_unordered_container.h b/include/xrpl/beast/container/detail/aged_unordered_container.h index 3bad12d9e5..782f36cd52 100644 --- a/include/xrpl/beast/container/detail/aged_unordered_container.h +++ b/include/xrpl/beast/container/detail/aged_unordered_container.h @@ -10,13 +10,19 @@ #include #include +#include #include +#include +#include #include #include #include #include +#include +#include #include #include +#include /* diff --git a/include/xrpl/beast/core/CurrentThreadName.h b/include/xrpl/beast/core/CurrentThreadName.h index 6175d99b16..3cdfe4c678 100644 --- a/include/xrpl/beast/core/CurrentThreadName.h +++ b/include/xrpl/beast/core/CurrentThreadName.h @@ -6,6 +6,7 @@ #include +#include #include #include diff --git a/include/xrpl/beast/core/LexicalCast.h b/include/xrpl/beast/core/LexicalCast.h index 18e63c9c10..8faf90f53d 100644 --- a/include/xrpl/beast/core/LexicalCast.h +++ b/include/xrpl/beast/core/LexicalCast.h @@ -5,11 +5,12 @@ #include #include -#include +#include #include -#include #include #include +#include +#include #include #include diff --git a/include/xrpl/beast/core/List.h b/include/xrpl/beast/core/List.h index 1c3827ae1c..1eeeaa87d1 100644 --- a/include/xrpl/beast/core/List.h +++ b/include/xrpl/beast/core/List.h @@ -1,6 +1,8 @@ #pragma once +#include #include +#include namespace beast { diff --git a/include/xrpl/beast/core/LockFreeStack.h b/include/xrpl/beast/core/LockFreeStack.h index d4ad45cf5c..19225a4343 100644 --- a/include/xrpl/beast/core/LockFreeStack.h +++ b/include/xrpl/beast/core/LockFreeStack.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -58,7 +59,7 @@ public: return result; } - NodePtr + [[nodiscard]] NodePtr node() const { return node_; diff --git a/include/xrpl/beast/hash/hash_append.h b/include/xrpl/beast/hash/hash_append.h index 83cff4bdea..0b36d4c983 100644 --- a/include/xrpl/beast/hash/hash_append.h +++ b/include/xrpl/beast/hash/hash_append.h @@ -5,8 +5,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/include/xrpl/beast/insight/Collector.h b/include/xrpl/beast/insight/Collector.h index 2e73d60400..3f83e329d4 100644 --- a/include/xrpl/beast/insight/Collector.h +++ b/include/xrpl/beast/insight/Collector.h @@ -4,8 +4,10 @@ #include #include #include +#include #include +#include #include namespace beast::insight { diff --git a/include/xrpl/beast/insight/Insight.h b/include/xrpl/beast/insight/Insight.h deleted file mode 100644 index bf3743cfd8..0000000000 --- a/include/xrpl/beast/insight/Insight.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/include/xrpl/beast/insight/NullCollector.h b/include/xrpl/beast/insight/NullCollector.h index b865526ade..67903420fa 100644 --- a/include/xrpl/beast/insight/NullCollector.h +++ b/include/xrpl/beast/insight/NullCollector.h @@ -2,6 +2,8 @@ #include +#include + namespace beast::insight { /** A Collector which does not collect metrics. */ diff --git a/include/xrpl/beast/insight/StatsDCollector.h b/include/xrpl/beast/insight/StatsDCollector.h index ad436dc626..9a438c48f1 100644 --- a/include/xrpl/beast/insight/StatsDCollector.h +++ b/include/xrpl/beast/insight/StatsDCollector.h @@ -4,6 +4,9 @@ #include #include +#include +#include + namespace beast::insight { /** A Collector that reports metrics to a StatsD server. diff --git a/include/xrpl/beast/net/IPAddress.h b/include/xrpl/beast/net/IPAddress.h index 67deaaa787..f4327b7b8a 100644 --- a/include/xrpl/beast/net/IPAddress.h +++ b/include/xrpl/beast/net/IPAddress.h @@ -9,6 +9,7 @@ #include #include +#include #include //------------------------------------------------------------------------------ diff --git a/include/xrpl/beast/net/IPAddressV4.h b/include/xrpl/beast/net/IPAddressV4.h index dbe5a6095f..9367fbe1eb 100644 --- a/include/xrpl/beast/net/IPAddressV4.h +++ b/include/xrpl/beast/net/IPAddressV4.h @@ -1,7 +1,5 @@ #pragma once -#include - #include namespace beast::IP { diff --git a/include/xrpl/beast/net/IPAddressV6.h b/include/xrpl/beast/net/IPAddressV6.h index 10f806417d..1bfa079990 100644 --- a/include/xrpl/beast/net/IPAddressV6.h +++ b/include/xrpl/beast/net/IPAddressV6.h @@ -1,7 +1,5 @@ #pragma once -#include - #include namespace beast::IP { diff --git a/include/xrpl/beast/net/IPEndpoint.h b/include/xrpl/beast/net/IPEndpoint.h index fec6e1556f..0b661108f2 100644 --- a/include/xrpl/beast/net/IPEndpoint.h +++ b/include/xrpl/beast/net/IPEndpoint.h @@ -3,8 +3,13 @@ #include #include #include +#include +#include +#include #include +#include +#include #include #include diff --git a/include/xrpl/beast/rfc2616.h b/include/xrpl/beast/rfc2616.h index e810733210..7c681ab140 100644 --- a/include/xrpl/beast/rfc2616.h +++ b/include/xrpl/beast/rfc2616.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/beast/test/yield_to.h b/include/xrpl/beast/test/yield_to.h index 84d7d8846d..1a34ec436e 100644 --- a/include/xrpl/beast/test/yield_to.h +++ b/include/xrpl/beast/test/yield_to.h @@ -11,6 +11,8 @@ #include #include +#include +#include #include #include #include diff --git a/include/xrpl/beast/unit_test.h b/include/xrpl/beast/unit_test.h index 51ac96cacb..b4d53b2b1c 100644 --- a/include/xrpl/beast/unit_test.h +++ b/include/xrpl/beast/unit_test.h @@ -1,15 +1,6 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #ifndef BEAST_EXPECT #define BEAST_EXPECT_S1(x) #x diff --git a/include/xrpl/beast/unit_test/match.h b/include/xrpl/beast/unit_test/match.h index da466ab228..5faeaa1100 100644 --- a/include/xrpl/beast/unit_test/match.h +++ b/include/xrpl/beast/unit_test/match.h @@ -7,6 +7,7 @@ #include #include +#include namespace beast::unit_test { diff --git a/include/xrpl/beast/unit_test/recorder.h b/include/xrpl/beast/unit_test/recorder.h index 2ed88d4a46..1b7347dc2e 100644 --- a/include/xrpl/beast/unit_test/recorder.h +++ b/include/xrpl/beast/unit_test/recorder.h @@ -6,6 +6,10 @@ #include #include +#include + +#include +#include namespace beast::unit_test { diff --git a/include/xrpl/beast/unit_test/reporter.h b/include/xrpl/beast/unit_test/reporter.h index ff990dece5..a903d9f8c2 100644 --- a/include/xrpl/beast/unit_test/reporter.h +++ b/include/xrpl/beast/unit_test/reporter.h @@ -5,18 +5,21 @@ #pragma once #include -#include +#include +#include #include #include #include #include +#include #include #include #include #include #include +#include namespace beast::unit_test { diff --git a/include/xrpl/beast/unit_test/results.h b/include/xrpl/beast/unit_test/results.h index 02aa9730d1..718d764c9f 100644 --- a/include/xrpl/beast/unit_test/results.h +++ b/include/xrpl/beast/unit_test/results.h @@ -6,6 +6,7 @@ #include +#include #include #include #include diff --git a/include/xrpl/beast/unit_test/suite.h b/include/xrpl/beast/unit_test/suite.h index fded866da0..487663fcc5 100644 --- a/include/xrpl/beast/unit_test/suite.h +++ b/include/xrpl/beast/unit_test/suite.h @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include #include @@ -634,7 +636,7 @@ Suite::run(Runner& r) #define BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Class, Module, Library, Priority) #else -#include +#include // IWYU pragma: keep #define BEAST_DEFINE_TESTSUITE(Class, Module, Library) \ BEAST_DEFINE_TESTSUITE_INSERT(Class, Module, Library, false, 0) #define BEAST_DEFINE_TESTSUITE_MANUAL(Class, Module, Library) \ diff --git a/include/xrpl/beast/unit_test/suite_info.h b/include/xrpl/beast/unit_test/suite_info.h index c09a0c2257..bda10ae7e3 100644 --- a/include/xrpl/beast/unit_test/suite_info.h +++ b/include/xrpl/beast/unit_test/suite_info.h @@ -4,9 +4,9 @@ #pragma once -#include #include #include +#include #include namespace beast::unit_test { diff --git a/include/xrpl/beast/unit_test/suite_list.h b/include/xrpl/beast/unit_test/suite_list.h index 748f994602..cf9fb9c5b1 100644 --- a/include/xrpl/beast/unit_test/suite_list.h +++ b/include/xrpl/beast/unit_test/suite_list.h @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/include/xrpl/beast/unit_test/thread.h b/include/xrpl/beast/unit_test/thread.h index 7ae093eb85..0de039cb89 100644 --- a/include/xrpl/beast/unit_test/thread.h +++ b/include/xrpl/beast/unit_test/thread.h @@ -6,7 +6,9 @@ #include +#include #include +#include #include #include diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index 1262a64179..ac08b1384b 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -3,7 +3,10 @@ #include #include +#include #include +#include +#include namespace beast { diff --git a/include/xrpl/beast/utility/PropertyStream.h b/include/xrpl/beast/utility/PropertyStream.h index 62de019edd..3fb6df53d9 100644 --- a/include/xrpl/beast/utility/PropertyStream.h +++ b/include/xrpl/beast/utility/PropertyStream.h @@ -3,8 +3,10 @@ #include #include +#include #include #include +#include namespace beast { diff --git a/include/xrpl/beast/utility/WrappedSink.h b/include/xrpl/beast/utility/WrappedSink.h index 22d75927fe..a24ad595db 100644 --- a/include/xrpl/beast/utility/WrappedSink.h +++ b/include/xrpl/beast/utility/WrappedSink.h @@ -2,6 +2,7 @@ #include +#include #include namespace beast { diff --git a/include/xrpl/beast/utility/rngfill.h b/include/xrpl/beast/utility/rngfill.h index 2ea84a7a3d..0fc3ffe0d0 100644 --- a/include/xrpl/beast/utility/rngfill.h +++ b/include/xrpl/beast/utility/rngfill.h @@ -1,7 +1,5 @@ #pragma once -#include - #include #include #include diff --git a/include/xrpl/conditions/Condition.h b/include/xrpl/conditions/Condition.h index 66d1d24736..3c798663d7 100644 --- a/include/xrpl/conditions/Condition.h +++ b/include/xrpl/conditions/Condition.h @@ -4,8 +4,12 @@ #include #include +#include #include +#include #include +#include +#include namespace xrpl::cryptoconditions { diff --git a/include/xrpl/conditions/Fulfillment.h b/include/xrpl/conditions/Fulfillment.h index fd8cd7d31e..a3001b2620 100644 --- a/include/xrpl/conditions/Fulfillment.h +++ b/include/xrpl/conditions/Fulfillment.h @@ -4,6 +4,11 @@ #include #include +#include +#include +#include +#include + namespace xrpl::cryptoconditions { struct Fulfillment diff --git a/include/xrpl/conditions/detail/PreimageSha256.h b/include/xrpl/conditions/detail/PreimageSha256.h index c592ea37ee..0973a52e4a 100644 --- a/include/xrpl/conditions/detail/PreimageSha256.h +++ b/include/xrpl/conditions/detail/PreimageSha256.h @@ -7,7 +7,11 @@ #include #include +#include +#include #include +#include +#include namespace xrpl::cryptoconditions { diff --git a/include/xrpl/conditions/detail/utils.h b/include/xrpl/conditions/detail/utils.h index 87f2265034..bf16bfb42b 100644 --- a/include/xrpl/conditions/detail/utils.h +++ b/include/xrpl/conditions/detail/utils.h @@ -6,7 +6,10 @@ #include +#include +#include #include +#include // A collection of functions to decode binary blobs // encoded with X.690 Distinguished Encoding Rules. diff --git a/include/xrpl/config/BasicConfig.h b/include/xrpl/config/BasicConfig.h index 858bf8bf2e..5680b51fe7 100644 --- a/include/xrpl/config/BasicConfig.h +++ b/include/xrpl/config/BasicConfig.h @@ -6,9 +6,13 @@ #include #include +#include #include +#include +#include #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/core/ClosureCounter.h b/include/xrpl/core/ClosureCounter.h index fb13047f40..ed15db032e 100644 --- a/include/xrpl/core/ClosureCounter.h +++ b/include/xrpl/core/ClosureCounter.h @@ -1,11 +1,14 @@ #pragma once #include +#include #include +#include #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/core/HashRouter.h b/include/xrpl/core/HashRouter.h index c8b34d8e93..ef8f24d43c 100644 --- a/include/xrpl/core/HashRouter.h +++ b/include/xrpl/core/HashRouter.h @@ -4,10 +4,16 @@ #include #include #include +#include #include +#include +#include +#include #include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/core/Job.h b/include/xrpl/core/Job.h index 6af32eb2d8..e16d7412bf 100644 --- a/include/xrpl/core/Job.h +++ b/include/xrpl/core/Job.h @@ -2,9 +2,14 @@ #include #include +#include #include +#include +#include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/core/JobQueue.h b/include/xrpl/core/JobQueue.h index fc15e9a064..14170a39be 100644 --- a/include/xrpl/core/JobQueue.h +++ b/include/xrpl/core/JobQueue.h @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -12,10 +11,27 @@ // `boost/context/pooled_fixedsize_stack.hpp`, whose `.malloc()` / `.free()` // member calls on `boost::pool` collide with MSVC's `_CRTDBG_MAP_ALLOC` macros // in Debug builds (see cmake/XrplCompiler.cmake). +#include +#include +#include +#include +#include +#include + #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include namespace xrpl { @@ -112,7 +128,7 @@ public: resume(); /** Returns true if the Coro is still runnable (has not returned). */ - bool + [[nodiscard]] bool runnable() const; /** Once called, the Coro allows early exit without an assert. */ @@ -384,7 +400,7 @@ private: } // namespace xrpl -#include +#include // IWYU pragma: keep namespace xrpl { diff --git a/include/xrpl/core/JobTypeData.h b/include/xrpl/core/JobTypeData.h index 4e9f95dc04..d53440e1ca 100644 --- a/include/xrpl/core/JobTypeData.h +++ b/include/xrpl/core/JobTypeData.h @@ -2,7 +2,10 @@ #include #include +#include +#include #include +#include #include diff --git a/include/xrpl/core/JobTypeInfo.h b/include/xrpl/core/JobTypeInfo.h index 430e80b388..b5db0dbaab 100644 --- a/include/xrpl/core/JobTypeInfo.h +++ b/include/xrpl/core/JobTypeInfo.h @@ -2,6 +2,10 @@ #include +#include +#include +#include + namespace xrpl { /** Holds all the 'static' information about a job, which does not change */ diff --git a/include/xrpl/core/JobTypes.h b/include/xrpl/core/JobTypes.h index fb5c7988cb..f338b19f6c 100644 --- a/include/xrpl/core/JobTypes.h +++ b/include/xrpl/core/JobTypes.h @@ -1,10 +1,14 @@ #pragma once +#include #include #include +#include #include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/core/LoadMonitor.h b/include/xrpl/core/LoadMonitor.h index 32a813baa7..f1a8eb6c56 100644 --- a/include/xrpl/core/LoadMonitor.h +++ b/include/xrpl/core/LoadMonitor.h @@ -5,6 +5,7 @@ #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/core/PeerReservationTable.h b/include/xrpl/core/PeerReservationTable.h index a9ab894124..e6f6dd622e 100644 --- a/include/xrpl/core/PeerReservationTable.h +++ b/include/xrpl/core/PeerReservationTable.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff --git a/include/xrpl/core/PerfLog.h b/include/xrpl/core/PerfLog.h index ca0d9333a4..f09665e291 100644 --- a/include/xrpl/core/PerfLog.h +++ b/include/xrpl/core/PerfLog.h @@ -1,6 +1,7 @@ #pragma once -#include +#include +#include #include #include diff --git a/include/xrpl/core/ServiceRegistry.h b/include/xrpl/core/ServiceRegistry.h index 1d0c9e38f4..50bf2d7c10 100644 --- a/include/xrpl/core/ServiceRegistry.h +++ b/include/xrpl/core/ServiceRegistry.h @@ -1,11 +1,17 @@ #pragma once #include +#include #include #include +#include +#include #include +#include +#include + namespace xrpl { // Forward declarations diff --git a/include/xrpl/core/StartUpType.h b/include/xrpl/core/StartUpType.h index 46359ad7b6..6d05149618 100644 --- a/include/xrpl/core/StartUpType.h +++ b/include/xrpl/core/StartUpType.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include namespace xrpl { diff --git a/include/xrpl/core/detail/semaphore.h b/include/xrpl/core/detail/semaphore.h index 7bc83f86f5..e40463e322 100644 --- a/include/xrpl/core/detail/semaphore.h +++ b/include/xrpl/core/detail/semaphore.h @@ -29,6 +29,7 @@ #pragma once #include +#include #include namespace xrpl { diff --git a/include/xrpl/crypto/RFC1751.h b/include/xrpl/crypto/RFC1751.h index 19b636b9dc..278f3c207b 100644 --- a/include/xrpl/crypto/RFC1751.h +++ b/include/xrpl/crypto/RFC1751.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/include/xrpl/crypto/csprng.h b/include/xrpl/crypto/csprng.h index e386d9d11e..cdc6a723c8 100644 --- a/include/xrpl/crypto/csprng.h +++ b/include/xrpl/crypto/csprng.h @@ -1,5 +1,8 @@ #pragma once +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/json/JsonPropertyStream.h b/include/xrpl/json/JsonPropertyStream.h index 47317b9ddb..405a61cd34 100644 --- a/include/xrpl/json/JsonPropertyStream.h +++ b/include/xrpl/json/JsonPropertyStream.h @@ -3,6 +3,9 @@ #include #include +#include +#include + namespace xrpl { /** A PropertyStream::Sink which produces a json::Value of type ValueType::Object. */ diff --git a/include/xrpl/json/Writer.h b/include/xrpl/json/Writer.h index 87e3e99c7e..024876a43c 100644 --- a/include/xrpl/json/Writer.h +++ b/include/xrpl/json/Writer.h @@ -1,11 +1,13 @@ #pragma once -#include #include #include #include +#include #include +#include +#include namespace json { diff --git a/include/xrpl/json/detail/json_assert.h b/include/xrpl/json/detail/json_assert.h index 8e33f45b65..f501e42aa4 100644 --- a/include/xrpl/json/detail/json_assert.h +++ b/include/xrpl/json/detail/json_assert.h @@ -1,8 +1,5 @@ #pragma once -#include -#include - #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) \ xrpl::Throw(message); diff --git a/include/xrpl/json/json_reader.h b/include/xrpl/json/json_reader.h index 9251183281..c1535bfb55 100644 --- a/include/xrpl/json/json_reader.h +++ b/include/xrpl/json/json_reader.h @@ -5,7 +5,10 @@ #include +#include +#include #include +#include namespace json { diff --git a/include/xrpl/json/json_writer.h b/include/xrpl/json/json_writer.h index afc99fe8c9..4bc15b71da 100644 --- a/include/xrpl/json/json_writer.h +++ b/include/xrpl/json/json_writer.h @@ -3,7 +3,10 @@ #include #include +#include #include +#include +#include #include namespace json { diff --git a/include/xrpl/ledger/AcceptedLedgerTx.h b/include/xrpl/ledger/AcceptedLedgerTx.h index 0a1592f6e1..f59b8a074d 100644 --- a/include/xrpl/ledger/AcceptedLedgerTx.h +++ b/include/xrpl/ledger/AcceptedLedgerTx.h @@ -1,13 +1,23 @@ #pragma once +#include #include +#include #include #include +#include +#include #include +#include +#include #include #include +#include +#include +#include + namespace xrpl { /** diff --git a/include/xrpl/ledger/AmendmentTable.h b/include/xrpl/ledger/AmendmentTable.h index 8ed3cb81ff..6598be5a5c 100644 --- a/include/xrpl/ledger/AmendmentTable.h +++ b/include/xrpl/ledger/AmendmentTable.h @@ -1,14 +1,37 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include +#include +#include +#include +#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/ledger/ApplyView.h b/include/xrpl/ledger/ApplyView.h index 362eae0f79..3bf5d479d1 100644 --- a/include/xrpl/ledger/ApplyView.h +++ b/include/xrpl/ledger/ApplyView.h @@ -1,9 +1,22 @@ #pragma once +#include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/ledger/ApplyViewImpl.h b/include/xrpl/ledger/ApplyViewImpl.h index 1245568630..9a3734a8ca 100644 --- a/include/xrpl/ledger/ApplyViewImpl.h +++ b/include/xrpl/ledger/ApplyViewImpl.h @@ -1,9 +1,20 @@ #pragma once +#include +#include +#include #include +#include #include #include +#include +#include #include +#include + +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/ledger/BookDirs.h b/include/xrpl/ledger/BookDirs.h index 36798934da..dc4361136d 100644 --- a/include/xrpl/ledger/BookDirs.h +++ b/include/xrpl/ledger/BookDirs.h @@ -1,6 +1,13 @@ #pragma once +#include #include +#include +#include + +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/ledger/CachedView.h b/include/xrpl/ledger/CachedView.h index 462db48ee3..f83c3e1297 100644 --- a/include/xrpl/ledger/CachedView.h +++ b/include/xrpl/ledger/CachedView.h @@ -1,11 +1,20 @@ #pragma once +#include #include #include #include +#include +#include +#include +#include +#include +#include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/ledger/CanonicalTXSet.h b/include/xrpl/ledger/CanonicalTXSet.h index 4dffadd52f..f8349dfab6 100644 --- a/include/xrpl/ledger/CanonicalTXSet.h +++ b/include/xrpl/ledger/CanonicalTXSet.h @@ -1,10 +1,16 @@ #pragma once #include +#include +#include #include #include #include +#include +#include +#include + namespace xrpl { /** Holds transactions which were deferred to the next pass of consensus. diff --git a/include/xrpl/ledger/Dir.h b/include/xrpl/ledger/Dir.h index d305e21938..05df887d8b 100644 --- a/include/xrpl/ledger/Dir.h +++ b/include/xrpl/ledger/Dir.h @@ -1,7 +1,15 @@ #pragma once +#include #include -#include +#include +#include +#include + +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/ledger/Ledger.h b/include/xrpl/ledger/Ledger.h index 5f7d79c61d..3453389a5e 100644 --- a/include/xrpl/ledger/Ledger.h +++ b/include/xrpl/ledger/Ledger.h @@ -1,16 +1,32 @@ #pragma once #include +#include +#include +#include #include #include -#include +#include #include -#include +#include +#include +#include #include #include +#include +#include #include -#include +#include +#include #include +#include + +#include +#include +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/ledger/LedgerTiming.h b/include/xrpl/ledger/LedgerTiming.h index 508403d760..a97e229046 100644 --- a/include/xrpl/ledger/LedgerTiming.h +++ b/include/xrpl/ledger/LedgerTiming.h @@ -1,9 +1,10 @@ #pragma once -#include -#include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index d145473516..de81787906 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -1,15 +1,26 @@ #pragma once +#include +#include #include #include #include -#include +#include +#include +#include +#include +#include +#include #include #include #include +#include #include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/ledger/PaymentSandbox.h b/include/xrpl/ledger/PaymentSandbox.h index 1cd89d9388..0117a962ff 100644 --- a/include/xrpl/ledger/PaymentSandbox.h +++ b/include/xrpl/ledger/PaymentSandbox.h @@ -1,11 +1,19 @@ #pragma once +#include #include -#include +#include #include #include +#include +#include +#include +#include +#include #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/ledger/RawView.h b/include/xrpl/ledger/RawView.h index cf61c3e814..ac2674226f 100644 --- a/include/xrpl/ledger/RawView.h +++ b/include/xrpl/ledger/RawView.h @@ -3,6 +3,9 @@ #include #include #include +#include + +#include namespace xrpl { diff --git a/include/xrpl/ledger/ReadView.h b/include/xrpl/ledger/ReadView.h index f4ee7e6fd2..8bbd3e06cb 100644 --- a/include/xrpl/ledger/ReadView.h +++ b/include/xrpl/ledger/ReadView.h @@ -1,21 +1,28 @@ #pragma once +#include #include #include +#include #include +#include #include -#include -#include +#include +#include #include +#include #include #include #include #include +#include #include #include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/ledger/Sandbox.h b/include/xrpl/ledger/Sandbox.h index dc80df5ba2..ca8838631f 100644 --- a/include/xrpl/ledger/Sandbox.h +++ b/include/xrpl/ledger/Sandbox.h @@ -1,6 +1,8 @@ #pragma once +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/ledger/View.h b/include/xrpl/ledger/View.h index 255413e459..c89764df1d 100644 --- a/include/xrpl/ledger/View.h +++ b/include/xrpl/ledger/View.h @@ -1,13 +1,22 @@ #pragma once +#include +#include #include #include #include +#include +#include +#include +#include #include #include +#include +#include #include #include #include +#include #include #include diff --git a/include/xrpl/ledger/detail/ApplyStateTable.h b/include/xrpl/ledger/detail/ApplyStateTable.h index f40e3d0d1c..752c87d588 100644 --- a/include/xrpl/ledger/detail/ApplyStateTable.h +++ b/include/xrpl/ledger/detail/ApplyStateTable.h @@ -1,13 +1,26 @@ #pragma once +#include +#include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include +#include +#include +#include +#include +#include + namespace xrpl::detail { // Helper class that buffers modifications diff --git a/include/xrpl/ledger/detail/ApplyViewBase.h b/include/xrpl/ledger/detail/ApplyViewBase.h index d6493c46a8..b5b01de277 100644 --- a/include/xrpl/ledger/detail/ApplyViewBase.h +++ b/include/xrpl/ledger/detail/ApplyViewBase.h @@ -1,10 +1,20 @@ #pragma once +#include #include +#include #include #include +#include +#include +#include +#include +#include #include +#include +#include + namespace xrpl::detail { class ApplyViewBase : public ApplyView, public RawView diff --git a/include/xrpl/ledger/detail/RawStateTable.h b/include/xrpl/ledger/detail/RawStateTable.h index d2567e34f1..cfa528d355 100644 --- a/include/xrpl/ledger/detail/RawStateTable.h +++ b/include/xrpl/ledger/detail/RawStateTable.h @@ -1,12 +1,20 @@ #pragma once +#include +#include #include #include +#include +#include #include #include +#include +#include #include +#include +#include #include namespace xrpl::detail { diff --git a/include/xrpl/ledger/detail/ReadViewFwdRange.h b/include/xrpl/ledger/detail/ReadViewFwdRange.h index c548ccb101..82d8b59c6a 100644 --- a/include/xrpl/ledger/detail/ReadViewFwdRange.h +++ b/include/xrpl/ledger/detail/ReadViewFwdRange.h @@ -1,8 +1,10 @@ #pragma once #include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/AMMHelpers.h b/include/xrpl/ledger/helpers/AMMHelpers.h index de8bb9d3f7..c6a2053010 100644 --- a/include/xrpl/ledger/helpers/AMMHelpers.h +++ b/include/xrpl/ledger/helpers/AMMHelpers.h @@ -2,22 +2,36 @@ #include #include +#include #include +#include +#include #include #include -#include #include #include +#include #include +#include #include #include #include +#include #include #include #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/AccountRootHelpers.h b/include/xrpl/ledger/helpers/AccountRootHelpers.h index cf6082d533..d0cfc175a3 100644 --- a/include/xrpl/ledger/helpers/AccountRootHelpers.h +++ b/include/xrpl/ledger/helpers/AccountRootHelpers.h @@ -1,13 +1,18 @@ #pragma once +#include #include #include #include +#include #include #include +#include #include #include +#include +#include #include #include #include diff --git a/include/xrpl/ledger/helpers/CredentialHelpers.h b/include/xrpl/ledger/helpers/CredentialHelpers.h index d6b797ce34..8e78a00923 100644 --- a/include/xrpl/ledger/helpers/CredentialHelpers.h +++ b/include/xrpl/ledger/helpers/CredentialHelpers.h @@ -1,15 +1,22 @@ #pragma once -#include +#include #include +#include #include #include #include #include #include +#include #include +#include #include +#include +#include +#include + namespace xrpl { namespace credentials { diff --git a/include/xrpl/ledger/helpers/DelegateHelpers.h b/include/xrpl/ledger/helpers/DelegateHelpers.h index a517eefdaa..3c277cb4f7 100644 --- a/include/xrpl/ledger/helpers/DelegateHelpers.h +++ b/include/xrpl/ledger/helpers/DelegateHelpers.h @@ -4,6 +4,9 @@ #include #include #include +#include + +#include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/DirectoryHelpers.h b/include/xrpl/ledger/helpers/DirectoryHelpers.h index a0be52df99..76a5f3bdad 100644 --- a/include/xrpl/ledger/helpers/DirectoryHelpers.h +++ b/include/xrpl/ledger/helpers/DirectoryHelpers.h @@ -1,12 +1,16 @@ #pragma once +#include #include #include #include +#include #include +#include +#include #include -#include +#include #include #include #include diff --git a/include/xrpl/ledger/helpers/EscrowHelpers.h b/include/xrpl/ledger/helpers/EscrowHelpers.h index dc7c479c42..001dc9cb25 100644 --- a/include/xrpl/ledger/helpers/EscrowHelpers.h +++ b/include/xrpl/ledger/helpers/EscrowHelpers.h @@ -1,15 +1,28 @@ #pragma once #include +#include #include -#include #include #include #include +#include +#include +#include #include #include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include + +#include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/LendingHelpers.h b/include/xrpl/ledger/helpers/LendingHelpers.h index 8de945233b..c21e5bf0ce 100644 --- a/include/xrpl/ledger/helpers/LendingHelpers.h +++ b/include/xrpl/ledger/helpers/LendingHelpers.h @@ -1,11 +1,28 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include // IWYU pragma: keep +#include +#include +#include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/MPTokenHelpers.h b/include/xrpl/ledger/helpers/MPTokenHelpers.h index b7f87337cf..a725871231 100644 --- a/include/xrpl/ledger/helpers/MPTokenHelpers.h +++ b/include/xrpl/ledger/helpers/MPTokenHelpers.h @@ -4,11 +4,17 @@ #include #include #include +#include +#include #include #include #include +#include #include +#include +#include +#include #include #include diff --git a/include/xrpl/ledger/helpers/NFTokenHelpers.h b/include/xrpl/ledger/helpers/NFTokenHelpers.h index 362cfe5a8c..1c4d395fbe 100644 --- a/include/xrpl/ledger/helpers/NFTokenHelpers.h +++ b/include/xrpl/ledger/helpers/NFTokenHelpers.h @@ -1,13 +1,25 @@ #pragma once -#include +#include #include +#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include +#include +#include +#include #include namespace xrpl::nft { diff --git a/include/xrpl/ledger/helpers/PaymentChannelHelpers.h b/include/xrpl/ledger/helpers/PaymentChannelHelpers.h index 3c08ee9f32..6e8cd17f7f 100644 --- a/include/xrpl/ledger/helpers/PaymentChannelHelpers.h +++ b/include/xrpl/ledger/helpers/PaymentChannelHelpers.h @@ -1,12 +1,13 @@ #pragma once +#include #include #include +#include +#include #include -#include #include -#include #include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h b/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h index 695a4950f0..12681257aa 100644 --- a/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h +++ b/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h @@ -1,6 +1,10 @@ #pragma once -#include +#include +#include +#include +#include +#include namespace xrpl::permissioned_dex { diff --git a/include/xrpl/ledger/helpers/RippleStateHelpers.h b/include/xrpl/ledger/helpers/RippleStateHelpers.h index 3aaaa541fd..ab09b931cc 100644 --- a/include/xrpl/ledger/helpers/RippleStateHelpers.h +++ b/include/xrpl/ledger/helpers/RippleStateHelpers.h @@ -1,14 +1,21 @@ #pragma once +#include #include #include #include #include +#include #include #include #include #include #include +#include +#include + +#include +#include //------------------------------------------------------------------------------ // diff --git a/include/xrpl/ledger/helpers/TokenHelpers.h b/include/xrpl/ledger/helpers/TokenHelpers.h index c8a67f776a..32f785a0d6 100644 --- a/include/xrpl/ledger/helpers/TokenHelpers.h +++ b/include/xrpl/ledger/helpers/TokenHelpers.h @@ -1,15 +1,22 @@ #pragma once +#include #include #include #include +#include #include +#include #include #include #include #include +#include +#include +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/net/AutoSocket.h b/include/xrpl/net/AutoSocket.h index 16ed0d6ca9..72eaed7439 100644 --- a/include/xrpl/net/AutoSocket.h +++ b/include/xrpl/net/AutoSocket.h @@ -2,12 +2,20 @@ #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include + // Socket wrapper that supports both SSL and non-SSL connections. // Generally, handle it as you would an SSL connection. // To force a non-SSL connection, just don't call async_handshake. diff --git a/include/xrpl/net/HTTPClient.h b/include/xrpl/net/HTTPClient.h index 456f769922..7ed9b35b9b 100644 --- a/include/xrpl/net/HTTPClient.h +++ b/include/xrpl/net/HTTPClient.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/net/HTTPClientSSLContext.h b/include/xrpl/net/HTTPClientSSLContext.h index ca1983f141..4192455ec9 100644 --- a/include/xrpl/net/HTTPClientSSLContext.h +++ b/include/xrpl/net/HTTPClientSSLContext.h @@ -10,6 +10,14 @@ #include #include +#include +#include + +#include +#include +#include +#include + namespace xrpl { class HTTPClientSSLContext diff --git a/include/xrpl/net/RegisterSSLCerts.h b/include/xrpl/net/RegisterSSLCerts.h index e313b1cb06..5cc9934638 100644 --- a/include/xrpl/net/RegisterSSLCerts.h +++ b/include/xrpl/net/RegisterSSLCerts.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include diff --git a/include/xrpl/nodestore/Backend.h b/include/xrpl/nodestore/Backend.h index 0061890237..29c4a8b526 100644 --- a/include/xrpl/nodestore/Backend.h +++ b/include/xrpl/nodestore/Backend.h @@ -1,8 +1,17 @@ #pragma once +#include +#include +#include #include +#include #include +#include +#include +#include +#include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/Database.h b/include/xrpl/nodestore/Database.h index 68c5dcefb6..49002ee301 100644 --- a/include/xrpl/nodestore/Database.h +++ b/include/xrpl/nodestore/Database.h @@ -1,13 +1,25 @@ #pragma once -#include -#include +#include +#include // IWYU pragma: keep +#include +#include +#include +#include #include #include #include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include namespace xrpl { class Section; diff --git a/include/xrpl/nodestore/DatabaseRotating.h b/include/xrpl/nodestore/DatabaseRotating.h index a7deed294a..69eb31261d 100644 --- a/include/xrpl/nodestore/DatabaseRotating.h +++ b/include/xrpl/nodestore/DatabaseRotating.h @@ -1,6 +1,13 @@ #pragma once +#include +#include #include +#include + +#include +#include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/DummyScheduler.h b/include/xrpl/nodestore/DummyScheduler.h index 472684ff13..f626115786 100644 --- a/include/xrpl/nodestore/DummyScheduler.h +++ b/include/xrpl/nodestore/DummyScheduler.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/Factory.h b/include/xrpl/nodestore/Factory.h index 3e6ba76a08..e79ae3e05d 100644 --- a/include/xrpl/nodestore/Factory.h +++ b/include/xrpl/nodestore/Factory.h @@ -4,7 +4,11 @@ #include #include -#include +#include + +#include +#include +#include namespace xrpl { class Section; diff --git a/include/xrpl/nodestore/Manager.h b/include/xrpl/nodestore/Manager.h index 1c4e5b63cf..f813412846 100644 --- a/include/xrpl/nodestore/Manager.h +++ b/include/xrpl/nodestore/Manager.h @@ -1,7 +1,14 @@ #pragma once -#include +#include +#include +#include #include +#include + +#include +#include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/NodeObject.h b/include/xrpl/nodestore/NodeObject.h index 04ba391b2b..3f3b75d5f8 100644 --- a/include/xrpl/nodestore/NodeObject.h +++ b/include/xrpl/nodestore/NodeObject.h @@ -4,6 +4,10 @@ #include #include +#include +#include +#include + // VFALCO NOTE Intentionally not in the NodeStore namespace namespace xrpl { diff --git a/include/xrpl/nodestore/Types.h b/include/xrpl/nodestore/Types.h index 21c01e9111..eaee82c99e 100644 --- a/include/xrpl/nodestore/Types.h +++ b/include/xrpl/nodestore/Types.h @@ -2,6 +2,7 @@ #include +#include #include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/detail/BatchWriter.h b/include/xrpl/nodestore/detail/BatchWriter.h index b0383838dc..7fa23bcb3e 100644 --- a/include/xrpl/nodestore/detail/BatchWriter.h +++ b/include/xrpl/nodestore/detail/BatchWriter.h @@ -1,10 +1,12 @@ #pragma once +#include #include #include #include #include +#include #include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/detail/DatabaseNodeImp.h b/include/xrpl/nodestore/detail/DatabaseNodeImp.h index 38b8763f31..6f2fca682f 100644 --- a/include/xrpl/nodestore/detail/DatabaseNodeImp.h +++ b/include/xrpl/nodestore/detail/DatabaseNodeImp.h @@ -1,10 +1,26 @@ #pragma once +#include #include +#include #include +#include +#include +#include #include #include +#include #include +#include +#include + +#include +#include +#include +#include +#include +#include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h index 1ba9435a5f..6343275c76 100644 --- a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h +++ b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h @@ -1,8 +1,19 @@ #pragma once +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/detail/DecodedBlob.h b/include/xrpl/nodestore/detail/DecodedBlob.h index 90a7b6c9cb..b2d5fc9c26 100644 --- a/include/xrpl/nodestore/detail/DecodedBlob.h +++ b/include/xrpl/nodestore/detail/DecodedBlob.h @@ -2,6 +2,8 @@ #include +#include + namespace xrpl::NodeStore { /** Parsed key/value blob into NodeObject components. diff --git a/include/xrpl/nodestore/detail/EncodedBlob.h b/include/xrpl/nodestore/detail/EncodedBlob.h index 343e1720a0..3982ab1b95 100644 --- a/include/xrpl/nodestore/detail/EncodedBlob.h +++ b/include/xrpl/nodestore/detail/EncodedBlob.h @@ -7,7 +7,10 @@ #include #include +#include #include +#include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/detail/ManagerImp.h b/include/xrpl/nodestore/detail/ManagerImp.h index 98aec6459b..fc84b0aa57 100644 --- a/include/xrpl/nodestore/detail/ManagerImp.h +++ b/include/xrpl/nodestore/detail/ManagerImp.h @@ -1,6 +1,17 @@ #pragma once +#include +#include +#include +#include #include +#include + +#include +#include +#include +#include +#include namespace xrpl::NodeStore { diff --git a/include/xrpl/nodestore/detail/codec.h b/include/xrpl/nodestore/detail/codec.h index 49238fa34a..56e1fbcf73 100644 --- a/include/xrpl/nodestore/detail/codec.h +++ b/include/xrpl/nodestore/detail/codec.h @@ -1,6 +1,10 @@ #pragma once // Disable lz4 deprecation warning due to incompatibility with clang attributes +#include +#include +#include +#include #define LZ4_DISABLE_DEPRECATE_WARNINGS #include diff --git a/include/xrpl/nodestore/detail/varint.h b/include/xrpl/nodestore/detail/varint.h index 0c49274d70..21a13bd6de 100644 --- a/include/xrpl/nodestore/detail/varint.h +++ b/include/xrpl/nodestore/detail/varint.h @@ -2,6 +2,7 @@ #include +#include #include #include diff --git a/include/xrpl/proto/org/xrpl/rpc/v1/README.md b/include/xrpl/proto/org/xrpl/rpc/v1/README.md index e8566ec179..d0ff14cd13 100644 --- a/include/xrpl/proto/org/xrpl/rpc/v1/README.md +++ b/include/xrpl/proto/org/xrpl/rpc/v1/README.md @@ -70,9 +70,9 @@ into helper functions (see Tx.cpp or AccountTx.cpp for an example). #### Testing When modifying an existing gRPC method, be sure to test that modification in the -corresponding, existing unit test. When creating a new gRPC method, implement a class that -derives from GRPCTestClientBase, and use the newly created class to call the new -method. See the class `GrpcTxClient` in the file Tx_test.cpp for an example. +corresponding, existing unit test. When creating a new gRPC method, create a +client stub with `XRPLedgerAPIService::NewStub` and `grpc::CreateChannel`, and +use it to call the new method. See `GRPCServerTLS_test.cpp` for an example. The gRPC tests are paired with their JSON counterpart, and the tests should mirror the JSON test as much as possible. diff --git a/include/xrpl/protocol/AMMCore.h b/include/xrpl/protocol/AMMCore.h index a83c8bfa84..c4fccd029a 100644 --- a/include/xrpl/protocol/AMMCore.h +++ b/include/xrpl/protocol/AMMCore.h @@ -3,9 +3,14 @@ #include #include #include +#include #include #include +#include +#include +#include + namespace xrpl { constexpr std::uint16_t kTradingFeeThreshold = 1000; // 1% diff --git a/include/xrpl/protocol/AccountID.h b/include/xrpl/protocol/AccountID.h index 4938812ffa..a7d49246ca 100644 --- a/include/xrpl/protocol/AccountID.h +++ b/include/xrpl/protocol/AccountID.h @@ -3,13 +3,17 @@ #include // VFALCO Uncomment when the header issues are resolved // #include -#include #include +#include +#include #include +#include #include #include +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/AmountConversions.h b/include/xrpl/protocol/AmountConversions.h index a5f7ec310f..66ada68d6f 100644 --- a/include/xrpl/protocol/AmountConversions.h +++ b/include/xrpl/protocol/AmountConversions.h @@ -1,10 +1,20 @@ #pragma once +#include +#include +#include +#include #include +#include +#include +#include #include #include #include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index 10b7571641..c3292e6074 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/include/xrpl/protocol/Asset.h b/include/xrpl/protocol/Asset.h index ec9d8db02f..2bf24b19fe 100644 --- a/include/xrpl/protocol/Asset.h +++ b/include/xrpl/protocol/Asset.h @@ -2,10 +2,19 @@ #include #include +#include +#include +#include #include #include #include -#include +#include + +#include +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/Batch.h b/include/xrpl/protocol/Batch.h index 4e021442d6..1e4f811fa9 100644 --- a/include/xrpl/protocol/Batch.h +++ b/include/xrpl/protocol/Batch.h @@ -1,10 +1,13 @@ #pragma once +#include #include #include -#include #include +#include +#include + namespace xrpl { inline void diff --git a/include/xrpl/protocol/Book.h b/include/xrpl/protocol/Book.h index 01dc40075b..476bdba35a 100644 --- a/include/xrpl/protocol/Book.h +++ b/include/xrpl/protocol/Book.h @@ -2,10 +2,21 @@ #include #include +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include + namespace xrpl { /** Specifies an order book. diff --git a/include/xrpl/protocol/BuildInfo.h b/include/xrpl/protocol/BuildInfo.h index 47a27339a8..a60c37e714 100644 --- a/include/xrpl/protocol/BuildInfo.h +++ b/include/xrpl/protocol/BuildInfo.h @@ -2,6 +2,7 @@ #include #include +#include /** Versioning information for this build. */ // VFALCO The namespace is deprecated diff --git a/include/xrpl/protocol/ConfidentialTransfer.h b/include/xrpl/protocol/ConfidentialTransfer.h index 5b1bcbf606..325117eed4 100644 --- a/include/xrpl/protocol/ConfidentialTransfer.h +++ b/include/xrpl/protocol/ConfidentialTransfer.h @@ -1,22 +1,21 @@ #pragma once +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include // IWYU pragma: keep #include -#include #include -#include +#include #include -#include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/ErrorCodes.h b/include/xrpl/protocol/ErrorCodes.h index f5e67fd572..38b8bc6d76 100644 --- a/include/xrpl/protocol/ErrorCodes.h +++ b/include/xrpl/protocol/ErrorCodes.h @@ -1,7 +1,8 @@ #pragma once #include -#include + +#include namespace xrpl { diff --git a/include/xrpl/protocol/Feature.h b/include/xrpl/protocol/Feature.h index 5de8ca64a9..927fde542a 100644 --- a/include/xrpl/protocol/Feature.h +++ b/include/xrpl/protocol/Feature.h @@ -1,10 +1,12 @@ #pragma once #include +#include #include #include +#include #include #include #include diff --git a/include/xrpl/protocol/Fees.h b/include/xrpl/protocol/Fees.h index 14bcc068bf..4e79204f4c 100644 --- a/include/xrpl/protocol/Fees.h +++ b/include/xrpl/protocol/Fees.h @@ -2,6 +2,9 @@ #include +#include +#include + namespace xrpl { // Deprecated constant for backwards compatibility with pre-XRPFees amendment. diff --git a/include/xrpl/protocol/IOUAmount.h b/include/xrpl/protocol/IOUAmount.h index b057f1c245..186ce054f1 100644 --- a/include/xrpl/protocol/IOUAmount.h +++ b/include/xrpl/protocol/IOUAmount.h @@ -6,6 +6,7 @@ #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/Indexes.h b/include/xrpl/protocol/Indexes.h index 75a2335f6f..053a66787f 100644 --- a/include/xrpl/protocol/Indexes.h +++ b/include/xrpl/protocol/Indexes.h @@ -1,18 +1,25 @@ #pragma once +#include #include +#include +#include +#include +#include #include +#include #include #include #include -#include #include -#include #include #include +#include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/InnerObjectFormats.h b/include/xrpl/protocol/InnerObjectFormats.h index 9d07a21d1c..c8312c3701 100644 --- a/include/xrpl/protocol/InnerObjectFormats.h +++ b/include/xrpl/protocol/InnerObjectFormats.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/Issue.h b/include/xrpl/protocol/Issue.h index c8022698d3..3d556e83eb 100644 --- a/include/xrpl/protocol/Issue.h +++ b/include/xrpl/protocol/Issue.h @@ -1,9 +1,13 @@ #pragma once -#include #include +#include #include +#include +#include +#include + namespace xrpl { /** A currency issued by an account. diff --git a/include/xrpl/protocol/KnownFormats.h b/include/xrpl/protocol/KnownFormats.h index 6e21d4bc3a..c31e28c37d 100644 --- a/include/xrpl/protocol/KnownFormats.h +++ b/include/xrpl/protocol/KnownFormats.h @@ -7,7 +7,11 @@ #include #include +#include #include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/LedgerFormats.h b/include/xrpl/protocol/LedgerFormats.h index 70afd12f34..5b8a8cc2c5 100644 --- a/include/xrpl/protocol/LedgerFormats.h +++ b/include/xrpl/protocol/LedgerFormats.h @@ -3,9 +3,12 @@ // NOLINTBEGIN(readability-identifier-naming) #include +#include +#include #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/LedgerHeader.h b/include/xrpl/protocol/LedgerHeader.h index f05b11d1eb..df8f314c5f 100644 --- a/include/xrpl/protocol/LedgerHeader.h +++ b/include/xrpl/protocol/LedgerHeader.h @@ -3,10 +3,13 @@ #include #include #include +#include #include #include #include +#include + namespace xrpl { /** Information about the notional ledger backing the view. */ diff --git a/include/xrpl/protocol/MPTAmount.h b/include/xrpl/protocol/MPTAmount.h index 6ea36fc294..329d83610e 100644 --- a/include/xrpl/protocol/MPTAmount.h +++ b/include/xrpl/protocol/MPTAmount.h @@ -2,13 +2,15 @@ #include #include -#include #include #include #include #include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/MPTIssue.h b/include/xrpl/protocol/MPTIssue.h index f55029f50d..0c495aa57f 100644 --- a/include/xrpl/protocol/MPTIssue.h +++ b/include/xrpl/protocol/MPTIssue.h @@ -1,8 +1,18 @@ #pragma once +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include + namespace xrpl { /* Adapt MPTID to provide the same interface as Issue. Enables using static diff --git a/include/xrpl/protocol/PathAsset.h b/include/xrpl/protocol/PathAsset.h index b51dc52b47..ebf6fb68a4 100644 --- a/include/xrpl/protocol/PathAsset.h +++ b/include/xrpl/protocol/PathAsset.h @@ -1,7 +1,14 @@ #pragma once +#include #include #include +#include + +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/Permissions.h b/include/xrpl/protocol/Permissions.h index c6f464082d..703a0939c9 100644 --- a/include/xrpl/protocol/Permissions.h +++ b/include/xrpl/protocol/Permissions.h @@ -1,9 +1,12 @@ #pragma once +#include #include -#include +#include #include +#include +#include #include #include #include diff --git a/include/xrpl/protocol/Protocol.h b/include/xrpl/protocol/Protocol.h index ba6347dfa7..f802cfe058 100644 --- a/include/xrpl/protocol/Protocol.h +++ b/include/xrpl/protocol/Protocol.h @@ -1,7 +1,9 @@ #pragma once #include +#include #include +#include #include #include diff --git a/include/xrpl/protocol/PublicKey.h b/include/xrpl/protocol/PublicKey.h index 20693160d3..13db17fc6e 100644 --- a/include/xrpl/protocol/PublicKey.h +++ b/include/xrpl/protocol/PublicKey.h @@ -1,8 +1,15 @@ #pragma once #include +#include +#include +#include #include +#include +#include #include +#include +#include #include #include #include @@ -11,8 +18,11 @@ #include #include #include +#include #include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/Quality.h b/include/xrpl/protocol/Quality.h index e261025cb8..6bb2033dc0 100644 --- a/include/xrpl/protocol/Quality.h +++ b/include/xrpl/protocol/Quality.h @@ -1,11 +1,13 @@ #pragma once +#include +#include #include -#include #include -#include #include +#include +#include #include #include #include diff --git a/include/xrpl/protocol/QualityFunction.h b/include/xrpl/protocol/QualityFunction.h index 96d30735b8..7830519deb 100644 --- a/include/xrpl/protocol/QualityFunction.h +++ b/include/xrpl/protocol/QualityFunction.h @@ -1,9 +1,15 @@ #pragma once #include +#include +#include #include #include +#include +#include +#include + namespace xrpl { /** Average quality of a path as a function of `out`: q(out) = m * out + b, diff --git a/include/xrpl/protocol/Rate.h b/include/xrpl/protocol/Rate.h index 504b17ed80..b8b04c8fb9 100644 --- a/include/xrpl/protocol/Rate.h +++ b/include/xrpl/protocol/Rate.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include diff --git a/include/xrpl/protocol/Rules.h b/include/xrpl/protocol/Rules.h index 47b20756db..da2031650f 100644 --- a/include/xrpl/protocol/Rules.h +++ b/include/xrpl/protocol/Rules.h @@ -4,7 +4,10 @@ #include #include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/SField.h b/include/xrpl/protocol/SField.h index 34fb66ce00..d97bcb0a1d 100644 --- a/include/xrpl/protocol/SField.h +++ b/include/xrpl/protocol/SField.h @@ -2,10 +2,11 @@ #include #include -#include #include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/SOTemplate.h b/include/xrpl/protocol/SOTemplate.h index 72e0573d29..682a7c655e 100644 --- a/include/xrpl/protocol/SOTemplate.h +++ b/include/xrpl/protocol/SOTemplate.h @@ -3,9 +3,11 @@ #include #include +#include #include #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/STAccount.h b/include/xrpl/protocol/STAccount.h index 65f404d58d..17d3affc57 100644 --- a/include/xrpl/protocol/STAccount.h +++ b/include/xrpl/protocol/STAccount.h @@ -1,9 +1,13 @@ #pragma once +#include #include #include +#include #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index 1a5b442d8b..5e53a85129 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -1,14 +1,20 @@ #pragma once #include -#include #include +#include +#include #include +#include #include +#include +#include #include +#include #include #include #include +#include #include #include #include @@ -16,6 +22,14 @@ #include #include +#include +#include +#include +#include +#include +#include +#include + namespace xrpl { // Internal form: diff --git a/include/xrpl/protocol/STArray.h b/include/xrpl/protocol/STArray.h index 61753c52dc..ed39e65026 100644 --- a/include/xrpl/protocol/STArray.h +++ b/include/xrpl/protocol/STArray.h @@ -1,7 +1,18 @@ #pragma once #include +#include +#include +#include #include +#include + +#include +#include +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STBase.h b/include/xrpl/protocol/STBase.h index 6633253d3b..341c80edd7 100644 --- a/include/xrpl/protocol/STBase.h +++ b/include/xrpl/protocol/STBase.h @@ -1,9 +1,12 @@ #pragma once #include +#include #include #include +#include +#include #include #include #include diff --git a/include/xrpl/protocol/STBitString.h b/include/xrpl/protocol/STBitString.h index 0267eac22d..4f25eccca6 100644 --- a/include/xrpl/protocol/STBitString.h +++ b/include/xrpl/protocol/STBitString.h @@ -1,8 +1,15 @@ #pragma once #include +#include #include +#include +#include #include +#include + +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STBlob.h b/include/xrpl/protocol/STBlob.h index 0667c54e30..ab6175f5e3 100644 --- a/include/xrpl/protocol/STBlob.h +++ b/include/xrpl/protocol/STBlob.h @@ -3,10 +3,14 @@ #include #include #include -#include +#include #include +#include +#include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STCurrency.h b/include/xrpl/protocol/STCurrency.h index 55d1ab1e74..18642b20cf 100644 --- a/include/xrpl/protocol/STCurrency.h +++ b/include/xrpl/protocol/STCurrency.h @@ -1,11 +1,15 @@ #pragma once -#include +#include #include #include #include #include +#include +#include +#include + namespace xrpl { class STCurrency final : public STBase diff --git a/include/xrpl/protocol/STExchange.h b/include/xrpl/protocol/STExchange.h index c733df37cf..a9c1f57bd8 100644 --- a/include/xrpl/protocol/STExchange.h +++ b/include/xrpl/protocol/STExchange.h @@ -1,14 +1,15 @@ #pragma once -#include #include #include #include #include +#include #include #include #include +#include #include #include #include diff --git a/include/xrpl/protocol/STInteger.h b/include/xrpl/protocol/STInteger.h index 52e0f7a365..1c7ac98f3e 100644 --- a/include/xrpl/protocol/STInteger.h +++ b/include/xrpl/protocol/STInteger.h @@ -1,7 +1,15 @@ #pragma once #include +#include +#include +#include #include +#include + +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STIssue.h b/include/xrpl/protocol/STIssue.h index f5e1f61168..8ff579553f 100644 --- a/include/xrpl/protocol/STIssue.h +++ b/include/xrpl/protocol/STIssue.h @@ -1,11 +1,20 @@ #pragma once #include +#include +#include #include +#include +#include #include #include #include +#include +#include +#include +#include + namespace xrpl { class STIssue final : public STBase, CountedObject diff --git a/include/xrpl/protocol/STLedgerEntry.h b/include/xrpl/protocol/STLedgerEntry.h index aa87411ae6..a5f449f99c 100644 --- a/include/xrpl/protocol/STLedgerEntry.h +++ b/include/xrpl/protocol/STLedgerEntry.h @@ -1,7 +1,19 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STNumber.h b/include/xrpl/protocol/STNumber.h index 8594a292f4..7efb63ac5e 100644 --- a/include/xrpl/protocol/STNumber.h +++ b/include/xrpl/protocol/STNumber.h @@ -2,10 +2,17 @@ #include #include +#include +#include +#include #include #include +#include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index 044e48ce62..c254a37aaf 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -1,27 +1,39 @@ #pragma once +#include #include +#include #include -#include +#include #include #include +#include +#include #include +#include #include #include #include +#include #include #include #include #include +#include #include #include #include +#include +#include +#include #include #include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STParsedJSON.h b/include/xrpl/protocol/STParsedJSON.h index 2557ab055b..1eeecc8b9e 100644 --- a/include/xrpl/protocol/STParsedJSON.h +++ b/include/xrpl/protocol/STParsedJSON.h @@ -1,8 +1,11 @@ #pragma once -#include +#include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STPathSet.h b/include/xrpl/protocol/STPathSet.h index 1508dcb727..f6b0fde7da 100644 --- a/include/xrpl/protocol/STPathSet.h +++ b/include/xrpl/protocol/STPathSet.h @@ -3,14 +3,17 @@ #include #include #include -#include +#include #include #include #include +#include #include #include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STTakesAsset.h b/include/xrpl/protocol/STTakesAsset.h index bf75ffccf7..70bafd0e91 100644 --- a/include/xrpl/protocol/STTakesAsset.h +++ b/include/xrpl/protocol/STTakesAsset.h @@ -3,6 +3,8 @@ #include #include +#include + namespace xrpl { /** Intermediate class for any STBase-derived class to store an Asset. diff --git a/include/xrpl/protocol/STTx.h b/include/xrpl/protocol/STTx.h index e78fce27a1..b36207bf61 100644 --- a/include/xrpl/protocol/STTx.h +++ b/include/xrpl/protocol/STTx.h @@ -1,18 +1,30 @@ #pragma once -#include +#include +#include +#include +#include +#include #include #include +#include +#include #include #include #include +#include #include #include +#include +#include #include #include +#include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STValidation.h b/include/xrpl/protocol/STValidation.h index 91ce88b441..67a6594419 100644 --- a/include/xrpl/protocol/STValidation.h +++ b/include/xrpl/protocol/STValidation.h @@ -1,15 +1,30 @@ #pragma once +#include +#include #include +#include +#include +#include +#include #include +#include #include +#include +#include +#include #include #include -#include +#include +#include +#include +#include #include #include #include +#include +#include namespace xrpl { @@ -72,35 +87,35 @@ public: F&& f); // Hash of the validated ledger - uint256 + [[nodiscard]] uint256 getLedgerHash() const; // Hash of consensus transaction set used to generate ledger - uint256 + [[nodiscard]] uint256 getConsensusHash() const; - NetClock::time_point + [[nodiscard]] NetClock::time_point getSignTime() const; - NetClock::time_point + [[nodiscard]] NetClock::time_point getSeenTime() const noexcept; - PublicKey const& + [[nodiscard]] PublicKey const& getSignerPublic() const noexcept; - NodeID const& + [[nodiscard]] NodeID const& getNodeID() const noexcept; - bool + [[nodiscard]] bool isValid() const noexcept; - bool + [[nodiscard]] bool isFull() const noexcept; - bool + [[nodiscard]] bool isTrusted() const noexcept; - uint256 + [[nodiscard]] uint256 getSigningHash() const; void @@ -112,13 +127,13 @@ public: void setSeen(NetClock::time_point s); - Blob + [[nodiscard]] Blob getSerialized() const; - Blob + [[nodiscard]] Blob getSignature() const; - std::string + [[nodiscard]] std::string render() const { std::stringstream ss; diff --git a/include/xrpl/protocol/STVector256.h b/include/xrpl/protocol/STVector256.h index 5c454b6be0..46a1abc713 100644 --- a/include/xrpl/protocol/STVector256.h +++ b/include/xrpl/protocol/STVector256.h @@ -1,9 +1,15 @@ #pragma once #include +#include +#include +#include #include -#include -#include +#include + +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/STXChainBridge.h b/include/xrpl/protocol/STXChainBridge.h index 292ffe2767..24d64ef02b 100644 --- a/include/xrpl/protocol/STXChainBridge.h +++ b/include/xrpl/protocol/STXChainBridge.h @@ -1,9 +1,19 @@ #pragma once #include +#include +#include +#include +#include #include #include #include +#include + +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/SecretKey.h b/include/xrpl/protocol/SecretKey.h index 712b095f81..8a0d917ab4 100644 --- a/include/xrpl/protocol/SecretKey.h +++ b/include/xrpl/protocol/SecretKey.h @@ -2,14 +2,18 @@ #include #include +#include #include #include #include #include #include +#include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/Seed.h b/include/xrpl/protocol/Seed.h index 0b93b84516..a669f52079 100644 --- a/include/xrpl/protocol/Seed.h +++ b/include/xrpl/protocol/Seed.h @@ -5,7 +5,10 @@ #include #include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/Serializer.h b/include/xrpl/protocol/Serializer.h index ffe9afabe8..1d0453d6aa 100644 --- a/include/xrpl/protocol/Serializer.h +++ b/include/xrpl/protocol/Serializer.h @@ -6,13 +6,14 @@ #include #include #include -#include #include #include #include #include #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/Sign.h b/include/xrpl/protocol/Sign.h index 0b5b5d7239..18f085352d 100644 --- a/include/xrpl/protocol/Sign.h +++ b/include/xrpl/protocol/Sign.h @@ -1,9 +1,13 @@ #pragma once +#include #include +#include #include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/SystemParameters.h b/include/xrpl/protocol/SystemParameters.h index 1cc35a0f31..b31dd0cd42 100644 --- a/include/xrpl/protocol/SystemParameters.h +++ b/include/xrpl/protocol/SystemParameters.h @@ -1,9 +1,12 @@ #pragma once +#include #include #include +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index 4ee084e714..b29cb11e15 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -8,7 +8,9 @@ #include #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/protocol/TxFormats.h b/include/xrpl/protocol/TxFormats.h index 77ab069feb..36eb6d0889 100644 --- a/include/xrpl/protocol/TxFormats.h +++ b/include/xrpl/protocol/TxFormats.h @@ -1,7 +1,9 @@ #pragma once #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/TxMeta.h b/include/xrpl/protocol/TxMeta.h index 6895350e9f..813f1b1615 100644 --- a/include/xrpl/protocol/TxMeta.h +++ b/include/xrpl/protocol/TxMeta.h @@ -1,12 +1,21 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/protocol/UintTypes.h b/include/xrpl/protocol/UintTypes.h index b38c544096..1a3cb96691 100644 --- a/include/xrpl/protocol/UintTypes.h +++ b/include/xrpl/protocol/UintTypes.h @@ -1,9 +1,11 @@ #pragma once -#include #include #include -#include + +#include +#include +#include namespace xrpl { namespace detail { diff --git a/include/xrpl/protocol/Units.h b/include/xrpl/protocol/Units.h index 39f745e84e..8b418704d6 100644 --- a/include/xrpl/protocol/Units.h +++ b/include/xrpl/protocol/Units.h @@ -3,14 +3,18 @@ #include #include #include +#include #include #include #include +#include #include #include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/XChainAttestations.h b/include/xrpl/protocol/XChainAttestations.h index 1aec5fe549..8f1c7a4ce3 100644 --- a/include/xrpl/protocol/XChainAttestations.h +++ b/include/xrpl/protocol/XChainAttestations.h @@ -1,20 +1,20 @@ #pragma once #include +#include #include -#include #include #include -#include +#include #include #include -#include #include #include #include -#include +#include +#include #include #include diff --git a/include/xrpl/protocol/XRPAmount.h b/include/xrpl/protocol/XRPAmount.h index f09ddc337a..3190980ecb 100644 --- a/include/xrpl/protocol/XRPAmount.h +++ b/include/xrpl/protocol/XRPAmount.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -10,7 +11,11 @@ #include #include +#include +#include #include +#include +#include #include #include diff --git a/include/xrpl/protocol/detail/STVar.h b/include/xrpl/protocol/detail/STVar.h index 71077d4b33..6853166174 100644 --- a/include/xrpl/protocol/detail/STVar.h +++ b/include/xrpl/protocol/detail/STVar.h @@ -5,6 +5,7 @@ #include #include +#include #include namespace xrpl::detail { diff --git a/include/xrpl/protocol/detail/b58_utils.h b/include/xrpl/protocol/detail/b58_utils.h index e800dbda06..f7aa4e74b4 100644 --- a/include/xrpl/protocol/detail/b58_utils.h +++ b/include/xrpl/protocol/detail/b58_utils.h @@ -1,12 +1,14 @@ #pragma once -#include #include #include #include #include +#include +#include +#include #include #include #include diff --git a/include/xrpl/protocol/detail/token_errors.h b/include/xrpl/protocol/detail/token_errors.h index 97db9288f9..99a04596bb 100644 --- a/include/xrpl/protocol/detail/token_errors.h +++ b/include/xrpl/protocol/detail/token_errors.h @@ -1,6 +1,8 @@ #pragma once +#include #include +#include namespace xrpl { enum class TokenCodecErrc { diff --git a/include/xrpl/protocol/digest.h b/include/xrpl/protocol/digest.h index 721ce60767..c1e70cada2 100644 --- a/include/xrpl/protocol/digest.h +++ b/include/xrpl/protocol/digest.h @@ -6,6 +6,9 @@ #include #include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/protocol/json_get_or_throw.h b/include/xrpl/protocol/json_get_or_throw.h index 9399f25827..7c7d9afe6c 100644 --- a/include/xrpl/protocol/json_get_or_throw.h +++ b/include/xrpl/protocol/json_get_or_throw.h @@ -7,8 +7,12 @@ #include #include +#include #include #include +#include +#include +#include namespace json { struct JsonMissingKeyError : std::exception diff --git a/include/xrpl/protocol/messages.h b/include/xrpl/protocol/messages.h index e6654cc183..dcbe8649c0 100644 --- a/include/xrpl/protocol/messages.h +++ b/include/xrpl/protocol/messages.h @@ -10,5 +10,3 @@ #ifdef TYPE_BOOL #undef TYPE_BOOL #endif - -#include diff --git a/include/xrpl/protocol/serialize.h b/include/xrpl/protocol/serialize.h index 5b84a28b5d..e758b57d49 100644 --- a/include/xrpl/protocol/serialize.h +++ b/include/xrpl/protocol/serialize.h @@ -1,9 +1,12 @@ #pragma once +#include #include #include #include +#include + namespace xrpl { /** Serialize an object to a blob. */ diff --git a/include/xrpl/protocol/st.h b/include/xrpl/protocol/st.h deleted file mode 100644 index 61571196f2..0000000000 --- a/include/xrpl/protocol/st.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/include/xrpl/protocol/tokens.h b/include/xrpl/protocol/tokens.h index 67cb25c7fb..bce7e7b5d6 100644 --- a/include/xrpl/protocol/tokens.h +++ b/include/xrpl/protocol/tokens.h @@ -1,14 +1,15 @@ #pragma once -#include #include +#include #include #include #include #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/rdb/DatabaseCon.h b/include/xrpl/rdb/DatabaseCon.h index 08376f0e71..90aed04337 100644 --- a/include/xrpl/rdb/DatabaseCon.h +++ b/include/xrpl/rdb/DatabaseCon.h @@ -1,16 +1,24 @@ #pragma once +#include #include #include #include -#include #include #include +#include + +#include +#include +#include +#include +#include #include -#include #include +#include +#include namespace soci { class session; diff --git a/include/xrpl/rdb/RelationalDatabase.h b/include/xrpl/rdb/RelationalDatabase.h index a38d6a997f..91c282ff16 100644 --- a/include/xrpl/rdb/RelationalDatabase.h +++ b/include/xrpl/rdb/RelationalDatabase.h @@ -1,18 +1,34 @@ #pragma once +#include +#include #include +#include #include #include +#include #include #include #include +#include #include #include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace xrpl { class Transaction; diff --git a/include/xrpl/rdb/SociDB.h b/include/xrpl/rdb/SociDB.h index e87aa2a182..0f427bd18b 100644 --- a/include/xrpl/rdb/SociDB.h +++ b/include/xrpl/rdb/SociDB.h @@ -8,6 +8,10 @@ This module requires the @ref beast_sqlite external module. */ +#include +#include + +#include #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated" @@ -17,7 +21,6 @@ #include #define SOCI_USE_BOOST -#include #include #include diff --git a/include/xrpl/resource/Charge.h b/include/xrpl/resource/Charge.h index 3fd8b02e83..394d641e6c 100644 --- a/include/xrpl/resource/Charge.h +++ b/include/xrpl/resource/Charge.h @@ -1,5 +1,7 @@ #pragma once +#include +#include #include namespace xrpl::Resource { diff --git a/include/xrpl/resource/Consumer.h b/include/xrpl/resource/Consumer.h index 14935bb3f1..18207832ac 100644 --- a/include/xrpl/resource/Consumer.h +++ b/include/xrpl/resource/Consumer.h @@ -1,10 +1,13 @@ #pragma once -#include +#include #include #include #include +#include +#include + namespace xrpl::Resource { struct Entry; diff --git a/include/xrpl/resource/ResourceManager.h b/include/xrpl/resource/ResourceManager.h index 42b2a47126..13e0d09343 100644 --- a/include/xrpl/resource/ResourceManager.h +++ b/include/xrpl/resource/ResourceManager.h @@ -10,6 +10,10 @@ #include +#include +#include +#include + namespace xrpl::Resource { /** Tracks load and resource consumption. */ diff --git a/include/xrpl/resource/Types.h b/include/xrpl/resource/Types.h deleted file mode 100644 index fb71cffe37..0000000000 --- a/include/xrpl/resource/Types.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -namespace xrpl { -namespace Resource { - -struct Key; -struct Entry; - -} // namespace Resource -} // namespace xrpl diff --git a/include/xrpl/resource/detail/Entry.h b/include/xrpl/resource/detail/Entry.h index 361c8409c8..6f44ac2c29 100644 --- a/include/xrpl/resource/detail/Entry.h +++ b/include/xrpl/resource/detail/Entry.h @@ -3,10 +3,15 @@ #include #include #include -#include +#include #include #include +#include +#include +#include +#include + namespace xrpl::Resource { using clock_type = beast::AbstractClock; diff --git a/include/xrpl/resource/detail/Import.h b/include/xrpl/resource/detail/Import.h index 6e2a7b9e7c..a3df6fd73b 100644 --- a/include/xrpl/resource/detail/Import.h +++ b/include/xrpl/resource/detail/Import.h @@ -3,6 +3,8 @@ #include #include +#include + namespace xrpl::Resource { /** A set of imported consumer data from a gossip origin. */ diff --git a/include/xrpl/resource/detail/Key.h b/include/xrpl/resource/detail/Key.h index 7d24b33955..a0f11422a7 100644 --- a/include/xrpl/resource/detail/Key.h +++ b/include/xrpl/resource/detail/Key.h @@ -1,9 +1,10 @@ #pragma once +#include #include -#include #include +#include #include namespace xrpl::Resource { diff --git a/include/xrpl/resource/detail/Logic.h b/include/xrpl/resource/detail/Logic.h index b11ac100f5..6b1c5e7397 100644 --- a/include/xrpl/resource/detail/Logic.h +++ b/include/xrpl/resource/detail/Logic.h @@ -4,16 +4,25 @@ #include #include #include -#include +#include +#include +#include +#include #include #include #include #include +#include +#include +#include #include #include #include #include +#include +#include +#include namespace xrpl::Resource { diff --git a/include/xrpl/server/InfoSub.h b/include/xrpl/server/InfoSub.h index f316885fd6..d708a456c4 100644 --- a/include/xrpl/server/InfoSub.h +++ b/include/xrpl/server/InfoSub.h @@ -1,13 +1,22 @@ #pragma once #include +#include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include + namespace xrpl { // Operations that clients may wish to perform against the network diff --git a/include/xrpl/server/LoadFeeTrack.h b/include/xrpl/server/LoadFeeTrack.h index aa32e70ac8..a19ca063d5 100644 --- a/include/xrpl/server/LoadFeeTrack.h +++ b/include/xrpl/server/LoadFeeTrack.h @@ -7,6 +7,7 @@ #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/server/Manifest.h b/include/xrpl/server/Manifest.h index eed1c14dae..eb625d220a 100644 --- a/include/xrpl/server/Manifest.h +++ b/include/xrpl/server/Manifest.h @@ -1,14 +1,22 @@ #pragma once +#include +#include #include +#include #include #include #include +#include +#include +#include #include #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/server/NetworkOPs.h b/include/xrpl/server/NetworkOPs.h index 785d808935..ed2dbbb220 100644 --- a/include/xrpl/server/NetworkOPs.h +++ b/include/xrpl/server/NetworkOPs.h @@ -1,16 +1,24 @@ #pragma once -#include +#include +#include #include +#include +#include +#include #include #include -#include #include -#include #include +#include +#include +#include #include +#include +#include +#include namespace xrpl { @@ -25,6 +33,7 @@ class Transaction; class ValidatorKeys; class CanonicalTXSet; class RCLCxPeerPos; +class SHAMap; // This is the primary interface into the "client" portion of the program. // Code that wants to do normal operations on the network such as diff --git a/include/xrpl/server/Port.h b/include/xrpl/server/Port.h index fd773c78fc..c48a2546c1 100644 --- a/include/xrpl/server/Port.h +++ b/include/xrpl/server/Port.h @@ -1,7 +1,5 @@ #pragma once -#include - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/include/xrpl/server/Server.h b/include/xrpl/server/Server.h index 4d97fe9877..956a414be8 100644 --- a/include/xrpl/server/Server.h +++ b/include/xrpl/server/Server.h @@ -1,12 +1,12 @@ #pragma once #include -#include -#include #include #include +#include + namespace xrpl { /** Create the HTTP server using the specified handler. */ diff --git a/include/xrpl/server/Session.h b/include/xrpl/server/Session.h index 151e57e7f2..266570862a 100644 --- a/include/xrpl/server/Session.h +++ b/include/xrpl/server/Session.h @@ -2,16 +2,16 @@ #include #include +#include +#include #include #include #include -#include +#include #include -#include #include -#include namespace xrpl { diff --git a/include/xrpl/server/SimpleWriter.h b/include/xrpl/server/SimpleWriter.h index dfb0b165e8..996403eafb 100644 --- a/include/xrpl/server/SimpleWriter.h +++ b/include/xrpl/server/SimpleWriter.h @@ -7,7 +7,10 @@ #include #include -#include +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/server/State.h b/include/xrpl/server/State.h index c3cc4f609c..8590f6e18f 100644 --- a/include/xrpl/server/State.h +++ b/include/xrpl/server/State.h @@ -2,10 +2,12 @@ #include #include -#include +#include #include +#include + namespace xrpl { struct SavedState diff --git a/include/xrpl/server/Vacuum.h b/include/xrpl/server/Vacuum.h index 5f80eced87..7930265e76 100644 --- a/include/xrpl/server/Vacuum.h +++ b/include/xrpl/server/Vacuum.h @@ -1,5 +1,6 @@ #pragma once +#include #include namespace xrpl { diff --git a/include/xrpl/server/WSSession.h b/include/xrpl/server/WSSession.h index b2fa52c859..0087f9f50f 100644 --- a/include/xrpl/server/WSSession.h +++ b/include/xrpl/server/WSSession.h @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -11,7 +10,9 @@ #include #include +#include #include +#include #include #include #include diff --git a/include/xrpl/server/Wallet.h b/include/xrpl/server/Wallet.h index c15014b1ef..eea44db200 100644 --- a/include/xrpl/server/Wallet.h +++ b/include/xrpl/server/Wallet.h @@ -1,9 +1,21 @@ #pragma once +#include +#include +#include +#include #include +#include +#include #include #include +#include +#include +#include +#include +#include + namespace xrpl { /** diff --git a/include/xrpl/server/Writer.h b/include/xrpl/server/Writer.h index 05fea863be..fe9d9519e1 100644 --- a/include/xrpl/server/Writer.h +++ b/include/xrpl/server/Writer.h @@ -2,6 +2,7 @@ #include +#include #include #include diff --git a/include/xrpl/server/detail/BaseHTTPPeer.h b/include/xrpl/server/detail/BaseHTTPPeer.h index d26817bc45..f096d3c5a9 100644 --- a/include/xrpl/server/detail/BaseHTTPPeer.h +++ b/include/xrpl/server/detail/BaseHTTPPeer.h @@ -2,8 +2,12 @@ #include #include -#include +#include +#include +#include +#include #include +#include #include #include @@ -20,9 +24,12 @@ #include #include +#include +#include #include #include #include +#include #include #include @@ -392,7 +399,7 @@ BaseHTTPPeer::write(void const* buf, std::size_t bytes) if ([&] { std::scoped_lock const lock(mutex_); wq_.emplace_back(buf, bytes); - return wq_.size() == 1 && wq2_.size() == 0; + return wq_.size() == 1 && wq2_.empty(); }()) { if (!strand_.running_in_this_thread()) diff --git a/include/xrpl/server/detail/BasePeer.h b/include/xrpl/server/detail/BasePeer.h index edde28981c..5301a2f018 100644 --- a/include/xrpl/server/detail/BasePeer.h +++ b/include/xrpl/server/detail/BasePeer.h @@ -1,7 +1,7 @@ #pragma once +#include #include -#include #include #include #include @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/server/detail/BaseWSPeer.h b/include/xrpl/server/detail/BaseWSPeer.h index 13225dcba1..1b6a9faca3 100644 --- a/include/xrpl/server/detail/BaseWSPeer.h +++ b/include/xrpl/server/detail/BaseWSPeer.h @@ -1,10 +1,13 @@ #pragma once #include +#include #include #include #include #include +#include +#include #include #include #include @@ -16,8 +19,13 @@ #include #include +#include #include +#include #include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/server/detail/Door.h b/include/xrpl/server/detail/Door.h index 79d36cae0c..09b0adc5f2 100644 --- a/include/xrpl/server/detail/Door.h +++ b/include/xrpl/server/detail/Door.h @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include #include @@ -19,6 +21,9 @@ #include #include +#include +#include + #if !BOOST_OS_WINDOWS #include diff --git a/include/xrpl/server/detail/JSONRPCUtil.h b/include/xrpl/server/detail/JSONRPCUtil.h index b2e87f5332..1c157708c2 100644 --- a/include/xrpl/server/detail/JSONRPCUtil.h +++ b/include/xrpl/server/detail/JSONRPCUtil.h @@ -2,7 +2,8 @@ #include #include -#include + +#include namespace xrpl { diff --git a/include/xrpl/server/detail/LowestLayer.h b/include/xrpl/server/detail/LowestLayer.h index d28510d1a5..4daf91cd4c 100644 --- a/include/xrpl/server/detail/LowestLayer.h +++ b/include/xrpl/server/detail/LowestLayer.h @@ -1,23 +1,14 @@ #pragma once -#if BOOST_VERSION >= 107000 #include -#else -#include -#endif namespace xrpl { -// Before boost 1.70, get_lowest_layer required an explicit template parameter template decltype(auto) getLowestLayer(T& t) noexcept { -#if BOOST_VERSION >= 107000 return boost::beast::get_lowest_layer(t); -#else - return t.lowest_layer(); -#endif } } // namespace xrpl diff --git a/include/xrpl/server/detail/PlainHTTPPeer.h b/include/xrpl/server/detail/PlainHTTPPeer.h index 791ab91acf..b89272fe9e 100644 --- a/include/xrpl/server/detail/PlainHTTPPeer.h +++ b/include/xrpl/server/detail/PlainHTTPPeer.h @@ -1,12 +1,17 @@ #pragma once #include +#include +#include +#include #include #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/server/detail/PlainWSPeer.h b/include/xrpl/server/detail/PlainWSPeer.h index 593973a3ed..279e256f51 100644 --- a/include/xrpl/server/detail/PlainWSPeer.h +++ b/include/xrpl/server/detail/PlainWSPeer.h @@ -1,10 +1,14 @@ #pragma once +#include +#include #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/server/detail/SSLHTTPPeer.h b/include/xrpl/server/detail/SSLHTTPPeer.h index f3b047150f..ea2108b917 100644 --- a/include/xrpl/server/detail/SSLHTTPPeer.h +++ b/include/xrpl/server/detail/SSLHTTPPeer.h @@ -1,5 +1,9 @@ #pragma once +#include +#include +#include +#include #include #include @@ -9,7 +13,9 @@ #include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/server/detail/SSLWSPeer.h b/include/xrpl/server/detail/SSLWSPeer.h index cb03d5a796..fe522e3c9a 100644 --- a/include/xrpl/server/detail/SSLWSPeer.h +++ b/include/xrpl/server/detail/SSLWSPeer.h @@ -1,7 +1,9 @@ #pragma once -#include +#include +#include #include +#include #include #include @@ -9,8 +11,11 @@ #include #include #include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/server/detail/ServerImpl.h b/include/xrpl/server/detail/ServerImpl.h index 48ffa26cfe..df2bba0284 100644 --- a/include/xrpl/server/detail/ServerImpl.h +++ b/include/xrpl/server/detail/ServerImpl.h @@ -1,7 +1,8 @@ #pragma once -#include -#include +#include +#include +#include #include #include @@ -11,9 +12,15 @@ #include #include +#include +#include #include #include +#include +#include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/server/detail/Spawn.h b/include/xrpl/server/detail/Spawn.h index 2560a2718b..1ba32c2f0b 100644 --- a/include/xrpl/server/detail/Spawn.h +++ b/include/xrpl/server/detail/Spawn.h @@ -6,6 +6,7 @@ #include #include +#include #include namespace xrpl::util { diff --git a/include/xrpl/server/detail/io_list.h b/include/xrpl/server/detail/io_list.h index 4daa23fb7e..0153bd3457 100644 --- a/include/xrpl/server/detail/io_list.h +++ b/include/xrpl/server/detail/io_list.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/shamap/Family.h b/include/xrpl/shamap/Family.h index b9dd85443a..c5bf953bfd 100644 --- a/include/xrpl/shamap/Family.h +++ b/include/xrpl/shamap/Family.h @@ -1,11 +1,13 @@ #pragma once +#include #include #include #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/shamap/FullBelowCache.h b/include/xrpl/shamap/FullBelowCache.h index e9fd04ac58..dc597278df 100644 --- a/include/xrpl/shamap/FullBelowCache.h +++ b/include/xrpl/shamap/FullBelowCache.h @@ -4,9 +4,13 @@ #include #include #include +#include #include #include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/shamap/SHAMap.h b/include/xrpl/shamap/SHAMap.h index 3d08318cf6..d49e323b3f 100644 --- a/include/xrpl/shamap/SHAMap.h +++ b/include/xrpl/shamap/SHAMap.h @@ -1,11 +1,14 @@ #pragma once +#include #include -#include +#include +#include +#include #include #include -#include #include +#include #include #include #include @@ -14,8 +17,20 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h index e388d205d1..ee81107f61 100644 --- a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h +++ b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h @@ -1,10 +1,17 @@ #pragma once #include +#include +#include #include +#include #include #include #include +#include + +#include +#include namespace xrpl { diff --git a/include/xrpl/shamap/SHAMapInnerNode.h b/include/xrpl/shamap/SHAMapInnerNode.h index cafb498218..0fb4e24077 100644 --- a/include/xrpl/shamap/SHAMapInnerNode.h +++ b/include/xrpl/shamap/SHAMapInnerNode.h @@ -1,7 +1,11 @@ #pragma once -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/include/xrpl/shamap/SHAMapItem.h b/include/xrpl/shamap/SHAMapItem.h index 41558197bf..846f0bab4e 100644 --- a/include/xrpl/shamap/SHAMapItem.h +++ b/include/xrpl/shamap/SHAMapItem.h @@ -5,10 +5,18 @@ #include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include + namespace xrpl { // an item stored in a SHAMap diff --git a/include/xrpl/shamap/SHAMapLeafNode.h b/include/xrpl/shamap/SHAMapLeafNode.h index af5ed29702..112c243131 100644 --- a/include/xrpl/shamap/SHAMapLeafNode.h +++ b/include/xrpl/shamap/SHAMapLeafNode.h @@ -1,9 +1,12 @@ #pragma once +#include #include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/shamap/SHAMapMissingNode.h b/include/xrpl/shamap/SHAMapMissingNode.h index 0bc072463e..3168d0eff1 100644 --- a/include/xrpl/shamap/SHAMapMissingNode.h +++ b/include/xrpl/shamap/SHAMapMissingNode.h @@ -1,9 +1,9 @@ #pragma once +#include #include -#include +#include -#include #include #include #include diff --git a/include/xrpl/shamap/SHAMapNodeID.h b/include/xrpl/shamap/SHAMapNodeID.h index 248c9cb80b..b812c10ca9 100644 --- a/include/xrpl/shamap/SHAMapNodeID.h +++ b/include/xrpl/shamap/SHAMapNodeID.h @@ -3,7 +3,9 @@ #include #include +#include #include +#include #include #include #include diff --git a/include/xrpl/shamap/SHAMapSyncFilter.h b/include/xrpl/shamap/SHAMapSyncFilter.h index 4104220a3f..b6ce175915 100644 --- a/include/xrpl/shamap/SHAMapSyncFilter.h +++ b/include/xrpl/shamap/SHAMapSyncFilter.h @@ -1,7 +1,10 @@ #pragma once +#include +#include #include +#include #include /** Callback for filtering SHAMap during sync. */ diff --git a/include/xrpl/shamap/SHAMapTreeNode.h b/include/xrpl/shamap/SHAMapTreeNode.h index 5cca2ea41a..1eebbaa17f 100644 --- a/include/xrpl/shamap/SHAMapTreeNode.h +++ b/include/xrpl/shamap/SHAMapTreeNode.h @@ -3,8 +3,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/include/xrpl/shamap/SHAMapTxLeafNode.h b/include/xrpl/shamap/SHAMapTxLeafNode.h index 49f4f90906..86186434f8 100644 --- a/include/xrpl/shamap/SHAMapTxLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxLeafNode.h @@ -1,10 +1,17 @@ #pragma once #include +#include +#include #include +#include #include #include #include +#include + +#include +#include namespace xrpl { diff --git a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h index 3f4163ac41..9e4573d45b 100644 --- a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h @@ -1,10 +1,17 @@ #pragma once #include +#include +#include #include +#include #include #include #include +#include + +#include +#include namespace xrpl { diff --git a/include/xrpl/shamap/TreeNodeCache.h b/include/xrpl/shamap/TreeNodeCache.h index 2d5782c7e9..bff03a76e2 100644 --- a/include/xrpl/shamap/TreeNodeCache.h +++ b/include/xrpl/shamap/TreeNodeCache.h @@ -2,6 +2,7 @@ #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/shamap/detail/TaggedPointer.h b/include/xrpl/shamap/detail/TaggedPointer.h index 5eb3863de0..79f3464d5b 100644 --- a/include/xrpl/shamap/detail/TaggedPointer.h +++ b/include/xrpl/shamap/detail/TaggedPointer.h @@ -1,11 +1,14 @@ #pragma once -#include +#include #include -#include +#include #include #include +#include +#include +#include // IWYU pragma: keep namespace xrpl { diff --git a/include/xrpl/tx/ApplyContext.h b/include/xrpl/tx/ApplyContext.h index c98b3f82c5..ca778387cd 100644 --- a/include/xrpl/tx/ApplyContext.h +++ b/include/xrpl/tx/ApplyContext.h @@ -1,12 +1,23 @@ #pragma once +#include #include +#include #include +#include #include +#include +#include +#include #include +#include +#include #include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/tx/SignerEntries.h b/include/xrpl/tx/SignerEntries.h index af0c9b9d28..c8481f6062 100644 --- a/include/xrpl/tx/SignerEntries.h +++ b/include/xrpl/tx/SignerEntries.h @@ -1,13 +1,15 @@ #pragma once +#include #include // beast::Journal -#include // temMALFORMED -#include // AccountID -#include // NotTEC +#include +#include // temMALFORMED +#include #include #include #include +#include namespace xrpl { diff --git a/include/xrpl/tx/Transactor.h b/include/xrpl/tx/Transactor.h index 2b50cfa6e7..bc5e8c80e7 100644 --- a/include/xrpl/tx/Transactor.h +++ b/include/xrpl/tx/Transactor.h @@ -1,14 +1,30 @@ #pragma once +#include +#include #include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include #include +#include #include +#include +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/apply.h b/include/xrpl/tx/apply.h index 49b30fea02..55d365c31b 100644 --- a/include/xrpl/tx/apply.h +++ b/include/xrpl/tx/apply.h @@ -1,10 +1,14 @@ #pragma once +#include #include -#include +#include +#include +#include #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/applySteps.h b/include/xrpl/tx/applySteps.h index 897cf500d6..3298e49192 100644 --- a/include/xrpl/tx/applySteps.h +++ b/include/xrpl/tx/applySteps.h @@ -1,7 +1,19 @@ #pragma once +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/tx/invariants/AMMInvariant.h b/include/xrpl/tx/invariants/AMMInvariant.h index 4b56370774..29d962fb79 100644 --- a/include/xrpl/tx/invariants/AMMInvariant.h +++ b/include/xrpl/tx/invariants/AMMInvariant.h @@ -2,9 +2,12 @@ #include #include +#include #include +#include #include #include +#include #include diff --git a/include/xrpl/tx/invariants/DirectoryInvariant.h b/include/xrpl/tx/invariants/DirectoryInvariant.h index 96643ea465..d18ac539cc 100644 --- a/include/xrpl/tx/invariants/DirectoryInvariant.h +++ b/include/xrpl/tx/invariants/DirectoryInvariant.h @@ -1,8 +1,10 @@ #pragma once +#include #include #include #include +#include #include #include #include diff --git a/include/xrpl/tx/invariants/FreezeInvariant.h b/include/xrpl/tx/invariants/FreezeInvariant.h index a76eb66497..4b3e9beec4 100644 --- a/include/xrpl/tx/invariants/FreezeInvariant.h +++ b/include/xrpl/tx/invariants/FreezeInvariant.h @@ -2,10 +2,13 @@ #include #include +#include #include #include +#include #include #include +#include #include #include diff --git a/include/xrpl/tx/invariants/InvariantCheck.h b/include/xrpl/tx/invariants/InvariantCheck.h index ba91cba064..d19f34635d 100644 --- a/include/xrpl/tx/invariants/InvariantCheck.h +++ b/include/xrpl/tx/invariants/InvariantCheck.h @@ -1,10 +1,11 @@ #pragma once -#include #include #include +#include #include #include +#include #include #include #include @@ -17,7 +18,11 @@ #include #include +#include +#include #include +#include +#include namespace xrpl { diff --git a/include/xrpl/tx/invariants/InvariantCheckPrivilege.h b/include/xrpl/tx/invariants/InvariantCheckPrivilege.h index e55419dfc1..b2f1c62a54 100644 --- a/include/xrpl/tx/invariants/InvariantCheckPrivilege.h +++ b/include/xrpl/tx/invariants/InvariantCheckPrivilege.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include diff --git a/include/xrpl/tx/invariants/LoanBrokerInvariant.h b/include/xrpl/tx/invariants/LoanBrokerInvariant.h index 684bbff423..979f57de35 100644 --- a/include/xrpl/tx/invariants/LoanBrokerInvariant.h +++ b/include/xrpl/tx/invariants/LoanBrokerInvariant.h @@ -3,8 +3,10 @@ #include #include #include +#include #include #include +#include #include #include diff --git a/include/xrpl/tx/invariants/LoanInvariant.h b/include/xrpl/tx/invariants/LoanInvariant.h index 3f408d169a..0648881423 100644 --- a/include/xrpl/tx/invariants/LoanInvariant.h +++ b/include/xrpl/tx/invariants/LoanInvariant.h @@ -2,9 +2,12 @@ #include #include +#include #include #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/invariants/MPTInvariant.h b/include/xrpl/tx/invariants/MPTInvariant.h index aa90f1b8ef..1d39fd13d8 100644 --- a/include/xrpl/tx/invariants/MPTInvariant.h +++ b/include/xrpl/tx/invariants/MPTInvariant.h @@ -1,13 +1,21 @@ #pragma once +#include +#include #include #include +#include #include #include #include +#include +#include +#include #include +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/invariants/NFTInvariant.h b/include/xrpl/tx/invariants/NFTInvariant.h index 698df05247..11bdf5a569 100644 --- a/include/xrpl/tx/invariants/NFTInvariant.h +++ b/include/xrpl/tx/invariants/NFTInvariant.h @@ -1,10 +1,11 @@ #pragma once -#include #include #include +#include #include #include +#include #include diff --git a/include/xrpl/tx/invariants/PermissionedDEXInvariant.h b/include/xrpl/tx/invariants/PermissionedDEXInvariant.h index 2ec22ded88..2763b80a94 100644 --- a/include/xrpl/tx/invariants/PermissionedDEXInvariant.h +++ b/include/xrpl/tx/invariants/PermissionedDEXInvariant.h @@ -1,10 +1,13 @@ #pragma once +#include #include #include #include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/tx/invariants/PermissionedDomainInvariant.h b/include/xrpl/tx/invariants/PermissionedDomainInvariant.h index 19edcc0b39..fae7c24d25 100644 --- a/include/xrpl/tx/invariants/PermissionedDomainInvariant.h +++ b/include/xrpl/tx/invariants/PermissionedDomainInvariant.h @@ -2,9 +2,12 @@ #include #include +#include #include #include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/invariants/VaultInvariant.h b/include/xrpl/tx/invariants/VaultInvariant.h index 2a9ffc8282..bc8246b234 100644 --- a/include/xrpl/tx/invariants/VaultInvariant.h +++ b/include/xrpl/tx/invariants/VaultInvariant.h @@ -3,13 +3,18 @@ #include #include #include +#include #include #include +#include #include +#include +#include #include #include #include +#include #include #include #include diff --git a/include/xrpl/tx/paths/AMMLiquidity.h b/include/xrpl/tx/paths/AMMLiquidity.h index 9abe37f868..bf62155b61 100644 --- a/include/xrpl/tx/paths/AMMLiquidity.h +++ b/include/xrpl/tx/paths/AMMLiquidity.h @@ -1,13 +1,17 @@ #pragma once -#include +#include +#include #include -#include -#include +#include #include #include +#include #include +#include +#include + namespace xrpl { template diff --git a/include/xrpl/tx/paths/AMMOffer.h b/include/xrpl/tx/paths/AMMOffer.h index 21c45c36a3..40a9cf40b3 100644 --- a/include/xrpl/tx/paths/AMMOffer.h +++ b/include/xrpl/tx/paths/AMMOffer.h @@ -1,12 +1,18 @@ #pragma once +#include +#include #include -#include #include +#include #include #include #include +#include +#include +#include + namespace xrpl { template diff --git a/include/xrpl/tx/paths/BookTip.h b/include/xrpl/tx/paths/BookTip.h index c4bdb0415c..bad007ca5b 100644 --- a/include/xrpl/tx/paths/BookTip.h +++ b/include/xrpl/tx/paths/BookTip.h @@ -1,8 +1,11 @@ #pragma once -#include -#include +#include +#include +#include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/tx/paths/Flow.h b/include/xrpl/tx/paths/Flow.h index c746249866..f73b9a3440 100644 --- a/include/xrpl/tx/paths/Flow.h +++ b/include/xrpl/tx/paths/Flow.h @@ -1,9 +1,16 @@ #pragma once +#include +#include +#include #include +#include +#include #include #include +#include + namespace xrpl { namespace path::detail { diff --git a/include/xrpl/tx/paths/Offer.h b/include/xrpl/tx/paths/Offer.h index 2dab5bcebf..164a933ba1 100644 --- a/include/xrpl/tx/paths/Offer.h +++ b/include/xrpl/tx/paths/Offer.h @@ -1,16 +1,26 @@ #pragma once #include +#include #include -#include +#include +#include +#include #include +#include #include +#include #include #include #include #include +#include +#include +#include +#include #include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/paths/OfferStream.h b/include/xrpl/tx/paths/OfferStream.h index 69409b9ef7..98c58876c9 100644 --- a/include/xrpl/tx/paths/OfferStream.h +++ b/include/xrpl/tx/paths/OfferStream.h @@ -1,15 +1,20 @@ #pragma once #include +#include #include #include -#include +#include +#include #include #include #include #include +#include +#include + namespace xrpl { template diff --git a/include/xrpl/tx/paths/RippleCalc.h b/include/xrpl/tx/paths/RippleCalc.h index c747787820..62c966d384 100644 --- a/include/xrpl/tx/paths/RippleCalc.h +++ b/include/xrpl/tx/paths/RippleCalc.h @@ -1,12 +1,17 @@ #pragma once +#include #include #include +#include #include +#include #include #include +#include + namespace xrpl { class Config; namespace path { diff --git a/include/xrpl/tx/paths/detail/EitherAmount.h b/include/xrpl/tx/paths/detail/EitherAmount.h index ffd90751b8..68ad90d2d4 100644 --- a/include/xrpl/tx/paths/detail/EitherAmount.h +++ b/include/xrpl/tx/paths/detail/EitherAmount.h @@ -1,10 +1,15 @@ #pragma once +#include #include #include -#include +#include // IWYU pragma: keep #include +#include +#include +#include + namespace xrpl { struct EitherAmount diff --git a/include/xrpl/tx/paths/detail/FlowDebugInfo.h b/include/xrpl/tx/paths/detail/FlowDebugInfo.h index 1ccfba34ce..48066840f5 100644 --- a/include/xrpl/tx/paths/detail/FlowDebugInfo.h +++ b/include/xrpl/tx/paths/detail/FlowDebugInfo.h @@ -1,14 +1,22 @@ #pragma once -#include +#include +#include #include +#include +#include #include +#include #include #include -#include +#include #include +#include +#include +#include +#include namespace xrpl::path::detail { // Track performance information of a single payment diff --git a/include/xrpl/tx/paths/detail/StepChecks.h b/include/xrpl/tx/paths/detail/StepChecks.h index 4955c4f8e6..f62613e95c 100644 --- a/include/xrpl/tx/paths/detail/StepChecks.h +++ b/include/xrpl/tx/paths/detail/StepChecks.h @@ -2,9 +2,15 @@ #include #include +#include #include #include #include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/paths/detail/Steps.h b/include/xrpl/tx/paths/detail/Steps.h index 9909c4bdcd..7eb6b938a5 100644 --- a/include/xrpl/tx/paths/detail/Steps.h +++ b/include/xrpl/tx/paths/detail/Steps.h @@ -1,16 +1,30 @@ #pragma once -#include #include +#include +#include +#include +#include #include #include #include +#include #include +#include #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include namespace xrpl { class PaymentSandbox; diff --git a/include/xrpl/tx/paths/detail/StrandFlow.h b/include/xrpl/tx/paths/detail/StrandFlow.h index 4d988a4c7e..fe657b2100 100644 --- a/include/xrpl/tx/paths/detail/StrandFlow.h +++ b/include/xrpl/tx/paths/detail/StrandFlow.h @@ -1,12 +1,21 @@ #pragma once #include -#include +#include +#include +#include +#include #include #include -#include +#include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -17,8 +26,16 @@ #include #include +#include +#include #include +#include #include +#include +#include +#include +#include +#include namespace xrpl { diff --git a/include/xrpl/tx/transactors/account/AccountDelete.h b/include/xrpl/tx/transactors/account/AccountDelete.h index 16661a4b7c..e69d948bb8 100644 --- a/include/xrpl/tx/transactors/account/AccountDelete.h +++ b/include/xrpl/tx/transactors/account/AccountDelete.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/account/AccountSet.h b/include/xrpl/tx/transactors/account/AccountSet.h index 91b38e7968..4326621f3d 100644 --- a/include/xrpl/tx/transactors/account/AccountSet.h +++ b/include/xrpl/tx/transactors/account/AccountSet.h @@ -1,8 +1,16 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class AccountSet : public Transactor diff --git a/include/xrpl/tx/transactors/account/SetRegularKey.h b/include/xrpl/tx/transactors/account/SetRegularKey.h index 6ff9c5aa52..90e4cd96cd 100644 --- a/include/xrpl/tx/transactors/account/SetRegularKey.h +++ b/include/xrpl/tx/transactors/account/SetRegularKey.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/account/SignerListSet.h b/include/xrpl/tx/transactors/account/SignerListSet.h index 46e3191323..da2274a1de 100644 --- a/include/xrpl/tx/transactors/account/SignerListSet.h +++ b/include/xrpl/tx/transactors/account/SignerListSet.h @@ -1,11 +1,20 @@ #pragma once +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include #include #include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/bridge/XChainBridge.h b/include/xrpl/tx/transactors/bridge/XChainBridge.h index 58a546de2f..24f49eb340 100644 --- a/include/xrpl/tx/transactors/bridge/XChainBridge.h +++ b/include/xrpl/tx/transactors/bridge/XChainBridge.h @@ -1,8 +1,17 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + namespace xrpl { constexpr size_t kXbridgeMaxAccountCreateClaims = 128; diff --git a/include/xrpl/tx/transactors/check/CheckCancel.h b/include/xrpl/tx/transactors/check/CheckCancel.h index b8e8b6c52d..b54d1e6c84 100644 --- a/include/xrpl/tx/transactors/check/CheckCancel.h +++ b/include/xrpl/tx/transactors/check/CheckCancel.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/check/CheckCash.h b/include/xrpl/tx/transactors/check/CheckCash.h index 7d4e615cfd..4656f941f4 100644 --- a/include/xrpl/tx/transactors/check/CheckCash.h +++ b/include/xrpl/tx/transactors/check/CheckCash.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/check/CheckCreate.h b/include/xrpl/tx/transactors/check/CheckCreate.h index 178fe4707c..50a1f076e0 100644 --- a/include/xrpl/tx/transactors/check/CheckCreate.h +++ b/include/xrpl/tx/transactors/check/CheckCreate.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/credentials/CredentialAccept.h b/include/xrpl/tx/transactors/credentials/CredentialAccept.h index 8630ac3f7f..b9dfa684e7 100644 --- a/include/xrpl/tx/transactors/credentials/CredentialAccept.h +++ b/include/xrpl/tx/transactors/credentials/CredentialAccept.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class CredentialAccept : public Transactor diff --git a/include/xrpl/tx/transactors/credentials/CredentialCreate.h b/include/xrpl/tx/transactors/credentials/CredentialCreate.h index 91b5e829d3..ce9f9305be 100644 --- a/include/xrpl/tx/transactors/credentials/CredentialCreate.h +++ b/include/xrpl/tx/transactors/credentials/CredentialCreate.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class CredentialCreate : public Transactor diff --git a/include/xrpl/tx/transactors/credentials/CredentialDelete.h b/include/xrpl/tx/transactors/credentials/CredentialDelete.h index 70fe5cb3d0..2f151a9fa0 100644 --- a/include/xrpl/tx/transactors/credentials/CredentialDelete.h +++ b/include/xrpl/tx/transactors/credentials/CredentialDelete.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class CredentialDelete : public Transactor diff --git a/include/xrpl/tx/transactors/delegate/DelegateSet.h b/include/xrpl/tx/transactors/delegate/DelegateSet.h index a55524ecff..b7141276de 100644 --- a/include/xrpl/tx/transactors/delegate/DelegateSet.h +++ b/include/xrpl/tx/transactors/delegate/DelegateSet.h @@ -1,5 +1,13 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/dex/AMMBid.h b/include/xrpl/tx/transactors/dex/AMMBid.h index dfa50d06ba..fa257696e8 100644 --- a/include/xrpl/tx/transactors/dex/AMMBid.h +++ b/include/xrpl/tx/transactors/dex/AMMBid.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/dex/AMMClawback.h b/include/xrpl/tx/transactors/dex/AMMClawback.h index 6f31480490..54eb3c9f27 100644 --- a/include/xrpl/tx/transactors/dex/AMMClawback.h +++ b/include/xrpl/tx/transactors/dex/AMMClawback.h @@ -1,7 +1,20 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include + namespace xrpl { class Sandbox; class AMMClawback : public Transactor diff --git a/include/xrpl/tx/transactors/dex/AMMCreate.h b/include/xrpl/tx/transactors/dex/AMMCreate.h index 64d2a1e3b1..188af8d4ef 100644 --- a/include/xrpl/tx/transactors/dex/AMMCreate.h +++ b/include/xrpl/tx/transactors/dex/AMMCreate.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/dex/AMMDelete.h b/include/xrpl/tx/transactors/dex/AMMDelete.h index d3e8cfeeb4..4a0905fe10 100644 --- a/include/xrpl/tx/transactors/dex/AMMDelete.h +++ b/include/xrpl/tx/transactors/dex/AMMDelete.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/dex/AMMDeposit.h b/include/xrpl/tx/transactors/dex/AMMDeposit.h index 453046ddad..b87db19b2d 100644 --- a/include/xrpl/tx/transactors/dex/AMMDeposit.h +++ b/include/xrpl/tx/transactors/dex/AMMDeposit.h @@ -1,7 +1,21 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include + namespace xrpl { class Sandbox; diff --git a/include/xrpl/tx/transactors/dex/AMMVote.h b/include/xrpl/tx/transactors/dex/AMMVote.h index 8defc1369e..10ad284bb3 100644 --- a/include/xrpl/tx/transactors/dex/AMMVote.h +++ b/include/xrpl/tx/transactors/dex/AMMVote.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/dex/AMMWithdraw.h b/include/xrpl/tx/transactors/dex/AMMWithdraw.h index 8b6d39349b..8f6700037d 100644 --- a/include/xrpl/tx/transactors/dex/AMMWithdraw.h +++ b/include/xrpl/tx/transactors/dex/AMMWithdraw.h @@ -1,9 +1,23 @@ #pragma once -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include + namespace xrpl { class Sandbox; diff --git a/include/xrpl/tx/transactors/dex/OfferCancel.h b/include/xrpl/tx/transactors/dex/OfferCancel.h index 2806b6942f..974478475c 100644 --- a/include/xrpl/tx/transactors/dex/OfferCancel.h +++ b/include/xrpl/tx/transactors/dex/OfferCancel.h @@ -1,6 +1,12 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/dex/OfferCreate.h b/include/xrpl/tx/transactors/dex/OfferCreate.h index 7faf613d3a..a3bf7626f9 100644 --- a/include/xrpl/tx/transactors/dex/OfferCreate.h +++ b/include/xrpl/tx/transactors/dex/OfferCreate.h @@ -1,8 +1,28 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include + namespace xrpl { class PaymentSandbox; diff --git a/include/xrpl/tx/transactors/did/DIDDelete.h b/include/xrpl/tx/transactors/did/DIDDelete.h index 94615f51b6..c119b0348e 100644 --- a/include/xrpl/tx/transactors/did/DIDDelete.h +++ b/include/xrpl/tx/transactors/did/DIDDelete.h @@ -1,5 +1,15 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/did/DIDSet.h b/include/xrpl/tx/transactors/did/DIDSet.h index 8c84ea6c9b..481222243b 100644 --- a/include/xrpl/tx/transactors/did/DIDSet.h +++ b/include/xrpl/tx/transactors/did/DIDSet.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/escrow/EscrowCancel.h b/include/xrpl/tx/transactors/escrow/EscrowCancel.h index af09f70202..b52fb2a9fa 100644 --- a/include/xrpl/tx/transactors/escrow/EscrowCancel.h +++ b/include/xrpl/tx/transactors/escrow/EscrowCancel.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/escrow/EscrowCreate.h b/include/xrpl/tx/transactors/escrow/EscrowCreate.h index 8800e97b80..b8e22aa24e 100644 --- a/include/xrpl/tx/transactors/escrow/EscrowCreate.h +++ b/include/xrpl/tx/transactors/escrow/EscrowCreate.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/escrow/EscrowFinish.h b/include/xrpl/tx/transactors/escrow/EscrowFinish.h index 061fa0527c..07459bf959 100644 --- a/include/xrpl/tx/transactors/escrow/EscrowFinish.h +++ b/include/xrpl/tx/transactors/escrow/EscrowFinish.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h b/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h index 81ea97ce7e..cd72a01bc3 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h b/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h index 43b932726b..03ed295766 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h b/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h index a757ac51bf..1132211e58 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h b/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h index 0ce5f29387..7a9a529510 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerSet.h b/include/xrpl/tx/transactors/lending/LoanBrokerSet.h index 75175e2dd6..e7137c9311 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerSet.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerSet.h @@ -1,7 +1,17 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class LoanBrokerSet : public Transactor diff --git a/include/xrpl/tx/transactors/lending/LoanDelete.h b/include/xrpl/tx/transactors/lending/LoanDelete.h index 9e8c3c172a..604388a2bd 100644 --- a/include/xrpl/tx/transactors/lending/LoanDelete.h +++ b/include/xrpl/tx/transactors/lending/LoanDelete.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/lending/LoanManage.h b/include/xrpl/tx/transactors/lending/LoanManage.h index d2344c0ec0..c8a5584131 100644 --- a/include/xrpl/tx/transactors/lending/LoanManage.h +++ b/include/xrpl/tx/transactors/lending/LoanManage.h @@ -1,7 +1,18 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class LoanManage : public Transactor diff --git a/include/xrpl/tx/transactors/lending/LoanPay.h b/include/xrpl/tx/transactors/lending/LoanPay.h index 9be9695c64..599bea6ae6 100644 --- a/include/xrpl/tx/transactors/lending/LoanPay.h +++ b/include/xrpl/tx/transactors/lending/LoanPay.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class LoanPay : public Transactor diff --git a/include/xrpl/tx/transactors/lending/LoanSet.h b/include/xrpl/tx/transactors/lending/LoanSet.h index d277629e44..fab489e3db 100644 --- a/include/xrpl/tx/transactors/lending/LoanSet.h +++ b/include/xrpl/tx/transactors/lending/LoanSet.h @@ -1,8 +1,19 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + namespace xrpl { class LoanSet : public Transactor diff --git a/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h b/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h index c5cd10fa6a..28037ae3b9 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h +++ b/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h @@ -1,5 +1,15 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/nft/NFTokenBurn.h b/include/xrpl/tx/transactors/nft/NFTokenBurn.h index 849d09cb7e..a9640e3a9e 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenBurn.h +++ b/include/xrpl/tx/transactors/nft/NFTokenBurn.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h b/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h index a74a1c3e59..35c9067f63 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h +++ b/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h b/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h index c874381dd0..f11ac5c373 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h +++ b/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class NFTokenCreateOffer : public Transactor diff --git a/include/xrpl/tx/transactors/nft/NFTokenMint.h b/include/xrpl/tx/transactors/nft/NFTokenMint.h index 9267e8e801..9d5874fa60 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenMint.h +++ b/include/xrpl/tx/transactors/nft/NFTokenMint.h @@ -1,9 +1,19 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include +#include + namespace xrpl { class NFTokenMint : public Transactor diff --git a/include/xrpl/tx/transactors/nft/NFTokenModify.h b/include/xrpl/tx/transactors/nft/NFTokenModify.h index 0d18e4a6d4..970914bbfe 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenModify.h +++ b/include/xrpl/tx/transactors/nft/NFTokenModify.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/oracle/OracleDelete.h b/include/xrpl/tx/transactors/oracle/OracleDelete.h index c16d5fb2a9..f9e9230527 100644 --- a/include/xrpl/tx/transactors/oracle/OracleDelete.h +++ b/include/xrpl/tx/transactors/oracle/OracleDelete.h @@ -1,5 +1,14 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/oracle/OracleSet.h b/include/xrpl/tx/transactors/oracle/OracleSet.h index 831c11b8c4..e95970923b 100644 --- a/include/xrpl/tx/transactors/oracle/OracleSet.h +++ b/include/xrpl/tx/transactors/oracle/OracleSet.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/payment/DepositPreauth.h b/include/xrpl/tx/transactors/payment/DepositPreauth.h index 742b1ef3f7..b9b42ddac6 100644 --- a/include/xrpl/tx/transactors/payment/DepositPreauth.h +++ b/include/xrpl/tx/transactors/payment/DepositPreauth.h @@ -1,5 +1,14 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/payment/Payment.h b/include/xrpl/tx/transactors/payment/Payment.h index dd792aa1c2..1356a368e9 100644 --- a/include/xrpl/tx/transactors/payment/Payment.h +++ b/include/xrpl/tx/transactors/payment/Payment.h @@ -1,7 +1,19 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include + namespace xrpl { class Payment : public Transactor diff --git a/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h b/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h index e13fea6d6c..85df2a02e7 100644 --- a/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h +++ b/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class PaymentChannelClaim : public Transactor diff --git a/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h b/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h index 56e984cd57..f0c9da6349 100644 --- a/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h +++ b/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h b/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h index 272076ff20..377fbe9cf2 100644 --- a/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h +++ b/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h index 88883fb86f..5a07262a3b 100644 --- a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h +++ b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h index 4afa8cef5a..38de800284 100644 --- a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h +++ b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/system/Batch.h b/include/xrpl/tx/transactors/system/Batch.h index 927a5b27cd..6540005877 100644 --- a/include/xrpl/tx/transactors/system/Batch.h +++ b/include/xrpl/tx/transactors/system/Batch.h @@ -1,7 +1,18 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + namespace xrpl { class Batch : public Transactor diff --git a/include/xrpl/tx/transactors/system/Change.h b/include/xrpl/tx/transactors/system/Change.h index 339723ae8e..b25208f075 100644 --- a/include/xrpl/tx/transactors/system/Change.h +++ b/include/xrpl/tx/transactors/system/Change.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/system/LedgerStateFix.h b/include/xrpl/tx/transactors/system/LedgerStateFix.h index 973f89faa9..dd91f6f367 100644 --- a/include/xrpl/tx/transactors/system/LedgerStateFix.h +++ b/include/xrpl/tx/transactors/system/LedgerStateFix.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class LedgerStateFix : public Transactor diff --git a/include/xrpl/tx/transactors/system/TicketCreate.h b/include/xrpl/tx/transactors/system/TicketCreate.h index 5783faa6d1..2a1036c732 100644 --- a/include/xrpl/tx/transactors/system/TicketCreate.h +++ b/include/xrpl/tx/transactors/system/TicketCreate.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class TicketCreate : public Transactor diff --git a/include/xrpl/tx/transactors/token/Clawback.h b/include/xrpl/tx/transactors/token/Clawback.h index ed90776e59..5eaa32fe48 100644 --- a/include/xrpl/tx/transactors/token/Clawback.h +++ b/include/xrpl/tx/transactors/token/Clawback.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h b/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h index ff6f76e8ea..21d95326c9 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { /** diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h b/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h index 2e2591844f..6de2ce141f 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { /** diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h b/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h index cb4b6295a0..e2ee844560 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { /** diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h b/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h index 585c273e12..7c348d36a5 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { /** diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h b/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h index 72599ab987..aecf1ea5e2 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { /** diff --git a/include/xrpl/tx/transactors/token/MPTokenAuthorize.h b/include/xrpl/tx/transactors/token/MPTokenAuthorize.h index e30d123e52..b9fd48abe3 100644 --- a/include/xrpl/tx/transactors/token/MPTokenAuthorize.h +++ b/include/xrpl/tx/transactors/token/MPTokenAuthorize.h @@ -1,7 +1,19 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + namespace xrpl { struct MPTAuthorizeArgs diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h index d946587e32..045911c7ae 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h @@ -1,9 +1,22 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include +#include #include +#include namespace xrpl { diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h index 21032e7337..743e5a9502 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h index 428c573e2f..52f155e8fe 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class MPTokenIssuanceSet : public Transactor diff --git a/include/xrpl/tx/transactors/token/TrustSet.h b/include/xrpl/tx/transactors/token/TrustSet.h index d719f06326..fbf50f56ee 100644 --- a/include/xrpl/tx/transactors/token/TrustSet.h +++ b/include/xrpl/tx/transactors/token/TrustSet.h @@ -1,8 +1,18 @@ #pragma once -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + namespace xrpl { class TrustSet : public Transactor diff --git a/include/xrpl/tx/transactors/vault/VaultClawback.h b/include/xrpl/tx/transactors/vault/VaultClawback.h index 2ff97abca2..ba0eb9f320 100644 --- a/include/xrpl/tx/transactors/vault/VaultClawback.h +++ b/include/xrpl/tx/transactors/vault/VaultClawback.h @@ -1,8 +1,18 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include namespace xrpl { diff --git a/include/xrpl/tx/transactors/vault/VaultCreate.h b/include/xrpl/tx/transactors/vault/VaultCreate.h index 9b11f97957..f946a22c3a 100644 --- a/include/xrpl/tx/transactors/vault/VaultCreate.h +++ b/include/xrpl/tx/transactors/vault/VaultCreate.h @@ -1,7 +1,16 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include +#include + namespace xrpl { class VaultCreate : public Transactor diff --git a/include/xrpl/tx/transactors/vault/VaultDelete.h b/include/xrpl/tx/transactors/vault/VaultDelete.h index b8bb3c4096..ca73b1a685 100644 --- a/include/xrpl/tx/transactors/vault/VaultDelete.h +++ b/include/xrpl/tx/transactors/vault/VaultDelete.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/vault/VaultDeposit.h b/include/xrpl/tx/transactors/vault/VaultDeposit.h index 523b3f2e53..d49f504243 100644 --- a/include/xrpl/tx/transactors/vault/VaultDeposit.h +++ b/include/xrpl/tx/transactors/vault/VaultDeposit.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/vault/VaultSet.h b/include/xrpl/tx/transactors/vault/VaultSet.h index 5c362d5db4..835ed69610 100644 --- a/include/xrpl/tx/transactors/vault/VaultSet.h +++ b/include/xrpl/tx/transactors/vault/VaultSet.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/include/xrpl/tx/transactors/vault/VaultWithdraw.h b/include/xrpl/tx/transactors/vault/VaultWithdraw.h index 7bbe06187d..22ad39d26d 100644 --- a/include/xrpl/tx/transactors/vault/VaultWithdraw.h +++ b/include/xrpl/tx/transactors/vault/VaultWithdraw.h @@ -1,5 +1,12 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/src/libxrpl/core/detail/JobQueue.cpp b/src/libxrpl/core/detail/JobQueue.cpp index 5c07bf68cc..ffb91db72d 100644 --- a/src/libxrpl/core/detail/JobQueue.cpp +++ b/src/libxrpl/core/detail/JobQueue.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libxrpl/json/json_value.cpp b/src/libxrpl/json/json_value.cpp index 93875f497a..074a88428c 100644 --- a/src/libxrpl/json/json_value.cpp +++ b/src/libxrpl/json/json_value.cpp @@ -1,9 +1,11 @@ #include #include +#include // IWYU pragma: keep #include #include #include +#include // IWYU pragma: keep #include #include diff --git a/src/libxrpl/net/RegisterSSLCerts.cpp b/src/libxrpl/net/RegisterSSLCerts.cpp index ff59b5971e..2f005554a0 100644 --- a/src/libxrpl/net/RegisterSSLCerts.cpp +++ b/src/libxrpl/net/RegisterSSLCerts.cpp @@ -6,6 +6,8 @@ #include #if BOOST_OS_WINDOWS +#include + #include #include diff --git a/src/libxrpl/protocol/AMMCore.cpp b/src/libxrpl/protocol/AMMCore.cpp index e58ab29257..52b7fe82c2 100644 --- a/src/libxrpl/protocol/AMMCore.cpp +++ b/src/libxrpl/protocol/AMMCore.cpp @@ -12,6 +12,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/protocol/ConfidentialTransfer.cpp b/src/libxrpl/protocol/ConfidentialTransfer.cpp index 0baff1e33a..fe8a08c2ef 100644 --- a/src/libxrpl/protocol/ConfidentialTransfer.cpp +++ b/src/libxrpl/protocol/ConfidentialTransfer.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libxrpl/protocol/Permissions.cpp b/src/libxrpl/protocol/Permissions.cpp index 80aa1b1f4e..2f3e25f823 100644 --- a/src/libxrpl/protocol/Permissions.cpp +++ b/src/libxrpl/protocol/Permissions.cpp @@ -3,6 +3,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/protocol/STNumber.cpp b/src/libxrpl/protocol/STNumber.cpp index 8ef7b9760f..fcc0077f6b 100644 --- a/src/libxrpl/protocol/STNumber.cpp +++ b/src/libxrpl/protocol/STNumber.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/server/State.cpp b/src/libxrpl/server/State.cpp index d9793f53d0..ce17505ee6 100644 --- a/src/libxrpl/server/State.cpp +++ b/src/libxrpl/server/State.cpp @@ -7,6 +7,7 @@ #include // IWYU pragma: keep +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/server/Wallet.cpp b/src/libxrpl/server/Wallet.cpp index f3ae9dc925..f3a7ff76ba 100644 --- a/src/libxrpl/server/Wallet.cpp +++ b/src/libxrpl/server/Wallet.cpp @@ -19,7 +19,9 @@ #include #include // IWYU pragma: keep +#include // IWYU pragma: keep #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp b/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp index 544a3af2dc..fcb53e7c8f 100644 --- a/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp +++ b/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp @@ -8,6 +8,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp index ed5a22e3db..a915bb60d1 100644 --- a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp index 1948f3803d..259b9d7864 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp @@ -5,6 +5,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/libxrpl/tx/transactors/system/Batch.cpp b/src/libxrpl/tx/transactors/system/Batch.cpp index 16d27f98d9..ba54c14b1e 100644 --- a/src/libxrpl/tx/transactors/system/Batch.cpp +++ b/src/libxrpl/tx/transactors/system/Batch.cpp @@ -10,6 +10,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/test/app/FlowMPT_test.cpp b/src/test/app/FlowMPT_test.cpp index 2e224a7eb1..39d722da65 100644 --- a/src/test/app/FlowMPT_test.cpp +++ b/src/test/app/FlowMPT_test.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index da98c03380..bac1d8b61f 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/src/test/app/MultiSign_test.cpp b/src/test/app/MultiSign_test.cpp index 8fb1eb31ab..5f02f1b079 100644 --- a/src/test/app/MultiSign_test.cpp +++ b/src/test/app/MultiSign_test.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/src/test/app/OfferMPT_test.cpp b/src/test/app/OfferMPT_test.cpp index 9958515c5f..800b14877a 100644 --- a/src/test/app/OfferMPT_test.cpp +++ b/src/test/app/OfferMPT_test.cpp @@ -12,11 +12,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include diff --git a/src/test/app/PayStrand_test.cpp b/src/test/app/PayStrand_test.cpp index 1f9290de63..11a0e5bab0 100644 --- a/src/test/app/PayStrand_test.cpp +++ b/src/test/app/PayStrand_test.cpp @@ -8,6 +8,7 @@ #include #include #include // IWYU pragma: keep +#include #include #include #include diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index 7a149b2f64..c219bd8737 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/src/test/basics/hardened_hash_test.cpp b/src/test/basics/hardened_hash_test.cpp index 885ba9d60b..8b10967932 100644 --- a/src/test/basics/hardened_hash_test.cpp +++ b/src/test/basics/hardened_hash_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/src/test/beast/IPEndpointCommon.h b/src/test/beast/IPEndpointCommon.h index 0ff0da35be..45d036476c 100644 --- a/src/test/beast/IPEndpointCommon.h +++ b/src/test/beast/IPEndpointCommon.h @@ -1,8 +1,12 @@ #pragma once #include +#include +#include #include +#include + namespace beast::IP { inline Endpoint diff --git a/src/test/beast/aged_associative_container_test.cpp b/src/test/beast/aged_associative_container_test.cpp index 413194491a..3dbaf74040 100644 --- a/src/test/beast/aged_associative_container_test.cpp +++ b/src/test/beast/aged_associative_container_test.cpp @@ -1,12 +1,12 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep #include #include #include @@ -18,9 +18,9 @@ #include #include #include -#include +#include // IWYU pragma: keep #include -#include +#include // IWYU pragma: keep #ifndef BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR #ifdef _MSC_VER diff --git a/src/test/core/SociDB_test.cpp b/src/test/core/SociDB_test.cpp index 57ff19fec5..d37569d6cd 100644 --- a/src/test/core/SociDB_test.cpp +++ b/src/test/core/SociDB_test.cpp @@ -11,6 +11,7 @@ #include #include // IWYU pragma: keep +#include // IWYU pragma: keep #include #include #include diff --git a/src/test/csf.h b/src/test/csf.h deleted file mode 100644 index d2ddbb460d..0000000000 --- a/src/test/csf.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/src/test/csf/BasicNetwork.h b/src/test/csf/BasicNetwork.h index 418cdcf289..4b88592128 100644 --- a/src/test/csf/BasicNetwork.h +++ b/src/test/csf/BasicNetwork.h @@ -3,6 +3,8 @@ #include #include +#include + namespace xrpl::test::csf { /** Peer to peer network simulator. diff --git a/src/test/csf/CollectorRef.h b/src/test/csf/CollectorRef.h index 23baa020b8..5bc55c7515 100644 --- a/src/test/csf/CollectorRef.h +++ b/src/test/csf/CollectorRef.h @@ -1,7 +1,14 @@ #pragma once +#include #include +#include +#include #include +#include + +#include +#include namespace xrpl::test::csf { diff --git a/src/test/csf/Digraph.h b/src/test/csf/Digraph.h index 20e45faa5b..82ed713561 100644 --- a/src/test/csf/Digraph.h +++ b/src/test/csf/Digraph.h @@ -4,10 +4,11 @@ #include #include +#include #include #include -#include -#include +#include +#include namespace xrpl { namespace detail { diff --git a/src/test/csf/Histogram.h b/src/test/csf/Histogram.h index 84f1cc7b72..60cb9a132e 100644 --- a/src/test/csf/Histogram.h +++ b/src/test/csf/Histogram.h @@ -1,9 +1,9 @@ #pragma once -#include #include -#include #include +#include +#include #include namespace xrpl::test::csf { diff --git a/src/test/csf/Peer.h b/src/test/csf/Peer.h index 3e9eed1c52..9d29704172 100644 --- a/src/test/csf/Peer.h +++ b/src/test/csf/Peer.h @@ -2,7 +2,9 @@ #include #include +#include #include +#include #include #include #include @@ -10,15 +12,31 @@ #include #include +#include +#include #include +#include +#include +#include +#include +#include #include -#include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include namespace xrpl::test::csf { diff --git a/src/test/csf/PeerGroup.h b/src/test/csf/PeerGroup.h index 01bba82c98..e5efecac34 100644 --- a/src/test/csf/PeerGroup.h +++ b/src/test/csf/PeerGroup.h @@ -1,9 +1,18 @@ #pragma once #include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl::test::csf { diff --git a/src/test/csf/Scheduler.h b/src/test/csf/Scheduler.h index e7cbe27036..3fc187e1e7 100644 --- a/src/test/csf/Scheduler.h +++ b/src/test/csf/Scheduler.h @@ -6,6 +6,7 @@ #include #include +#include #include #include diff --git a/src/test/csf/Sim.h b/src/test/csf/Sim.h index b5b7f5f9c2..d2a63f6507 100644 --- a/src/test/csf/Sim.h +++ b/src/test/csf/Sim.h @@ -2,16 +2,22 @@ #include #include -#include #include #include #include #include #include +#include +#include + +#include +#include #include #include #include +#include +#include namespace xrpl::test::csf { diff --git a/src/test/csf/TrustGraph.h b/src/test/csf/TrustGraph.h index 202d17a6d5..a10e318706 100644 --- a/src/test/csf/TrustGraph.h +++ b/src/test/csf/TrustGraph.h @@ -1,13 +1,11 @@ #pragma once #include -#include #include -#include -#include -#include +#include +#include #include namespace xrpl::test::csf { diff --git a/src/test/csf/Tx.h b/src/test/csf/Tx.h index 5a0f6a9bae..f871909f48 100644 --- a/src/test/csf/Tx.h +++ b/src/test/csf/Tx.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/src/test/csf/Validation.h b/src/test/csf/Validation.h index 81f14efa18..73b6784534 100644 --- a/src/test/csf/Validation.h +++ b/src/test/csf/Validation.h @@ -2,10 +2,12 @@ #include +#include #include -#include +#include #include +#include #include namespace xrpl::test::csf { diff --git a/src/test/csf/collectors.h b/src/test/csf/collectors.h index 6dcbd65a1e..1100f6c690 100644 --- a/src/test/csf/collectors.h +++ b/src/test/csf/collectors.h @@ -2,14 +2,24 @@ #include #include +#include +#include #include #include +#include +#include #include +#include +#include +#include +#include #include #include #include +#include +#include namespace xrpl::test::csf { diff --git a/src/test/csf/events.h b/src/test/csf/events.h index ea163d3a80..dfedd2627a 100644 --- a/src/test/csf/events.h +++ b/src/test/csf/events.h @@ -1,12 +1,9 @@ #pragma once -#include #include #include #include -#include - namespace xrpl::test::csf { // Events are emitted by peers at a variety of points during the simulation. @@ -77,7 +74,7 @@ struct SubmitTx struct StartRound { //! The preferred ledger for the start of consensus - Ledger::ID bestLedger; + Ledger::ID bestLedger{}; //! The prior ledger on hand Ledger prevLedger; diff --git a/src/test/csf/ledgers.h b/src/test/csf/ledgers.h index 25672de133..dc5ec5277c 100644 --- a/src/test/csf/ledgers.h +++ b/src/test/csf/ledgers.h @@ -2,7 +2,6 @@ #include -#include #include #include #include @@ -11,8 +10,15 @@ #include +#include +#include +#include #include #include +#include +#include +#include +#include namespace xrpl::test::csf { diff --git a/src/test/csf/random.h b/src/test/csf/random.h index c506397d88..9fc51f1217 100644 --- a/src/test/csf/random.h +++ b/src/test/csf/random.h @@ -1,5 +1,8 @@ #pragma once +#include +#include +#include #include #include diff --git a/src/test/csf/submitters.h b/src/test/csf/submitters.h index a5c494beb0..546681abe0 100644 --- a/src/test/csf/submitters.h +++ b/src/test/csf/submitters.h @@ -1,10 +1,11 @@ #pragma once -#include #include #include #include +#include +#include #include namespace xrpl::test::csf { diff --git a/src/test/csf/timers.h b/src/test/csf/timers.h index 2f2ec4dc93..2f86fe7729 100644 --- a/src/test/csf/timers.h +++ b/src/test/csf/timers.h @@ -4,6 +4,7 @@ #include #include +#include #include namespace xrpl::test::csf { diff --git a/src/test/json/TestOutputSuite.h b/src/test/json/TestOutputSuite.h index e954a043b8..1be2a72c6d 100644 --- a/src/test/json/TestOutputSuite.h +++ b/src/test/json/TestOutputSuite.h @@ -5,8 +5,10 @@ #include #include -namespace xrpl { -namespace test { +#include +#include + +namespace xrpl::test { class TestOutputSuite : public TestSuite { @@ -32,5 +34,4 @@ protected: } }; -} // namespace test -} // namespace xrpl +} // namespace xrpl::test diff --git a/src/test/jtx.h b/src/test/jtx.h deleted file mode 100644 index d4b88b0b9e..0000000000 --- a/src/test/jtx.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -// Convenience header that includes everything - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include diff --git a/src/test/jtx/AMM.h b/src/test/jtx/AMM.h index 99131637bb..605f15f812 100644 --- a/src/test/jtx/AMM.h +++ b/src/test/jtx/AMM.h @@ -6,14 +6,33 @@ #include #include -#include - +#include +#include +#include #include +#include // IWYU pragma: keep +#include +#include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace xrpl::test::jtx { class LPToken diff --git a/src/test/jtx/AMMTest.h b/src/test/jtx/AMMTest.h index a2e6c38db3..971cc5db84 100644 --- a/src/test/jtx/AMMTest.h +++ b/src/test/jtx/AMMTest.h @@ -1,11 +1,23 @@ #pragma once #include +#include #include #include #include #include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/AbstractClient.h b/src/test/jtx/AbstractClient.h index 1eb51f2123..7c7107ca79 100644 --- a/src/test/jtx/AbstractClient.h +++ b/src/test/jtx/AbstractClient.h @@ -2,6 +2,8 @@ #include +#include + namespace xrpl::test { /* Abstract XRPL client interface. diff --git a/src/test/jtx/Account.h b/src/test/jtx/Account.h index b20b4a359a..264a39f08b 100644 --- a/src/test/jtx/Account.h +++ b/src/test/jtx/Account.h @@ -1,12 +1,14 @@ #pragma once #include +#include #include +#include #include -#include #include #include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/CaptureLogs.h b/src/test/jtx/CaptureLogs.h index b5fe302629..38db19219a 100644 --- a/src/test/jtx/CaptureLogs.h +++ b/src/test/jtx/CaptureLogs.h @@ -1,6 +1,12 @@ #pragma once #include +#include + +#include +#include +#include +#include namespace xrpl::test { diff --git a/src/test/jtx/CheckMessageLogs.h b/src/test/jtx/CheckMessageLogs.h index 4bbdec6f06..fc46f41671 100644 --- a/src/test/jtx/CheckMessageLogs.h +++ b/src/test/jtx/CheckMessageLogs.h @@ -1,6 +1,11 @@ #pragma once #include +#include + +#include +#include +#include namespace xrpl::test { diff --git a/src/test/jtx/ConfidentialTransfer.h b/src/test/jtx/ConfidentialTransfer.h index b758683da6..404ddbe31d 100644 --- a/src/test/jtx/ConfidentialTransfer.h +++ b/src/test/jtx/ConfidentialTransfer.h @@ -1,19 +1,8 @@ #pragma once -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include #include @@ -22,21 +11,10 @@ #include #include #include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include #include #include -#include #include diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index aca6074c4a..ba28d19738 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -17,25 +16,39 @@ #include #include +#include #include +#include +#include #include +#include #include -#include -#include +#include +#include +#include #include +#include +#include #include -#include #include +#include #include #include #include +#include -#include +#include +#include +#include +#include #include +#include +#include +#include #include +#include #include -#include -#include +#include #include #include #include diff --git a/src/test/jtx/Env_ss.h b/src/test/jtx/Env_ss.h index ca0825eac7..16e1cdbc82 100644 --- a/src/test/jtx/Env_ss.h +++ b/src/test/jtx/Env_ss.h @@ -1,6 +1,12 @@ #pragma once #include +#include + +#include + +#include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/JTx.h b/src/test/jtx/JTx.h index 121e6cc825..da105e01aa 100644 --- a/src/test/jtx/JTx.h +++ b/src/test/jtx/JTx.h @@ -10,6 +10,9 @@ #include #include +#include +#include +#include #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/Oracle.h b/src/test/jtx/Oracle.h index cf091c6d13..2c296ba705 100644 --- a/src/test/jtx/Oracle.h +++ b/src/test/jtx/Oracle.h @@ -1,8 +1,25 @@ #pragma once -#include +#include +#include +#include +#include +#include -#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace xrpl::test::jtx::oracle { diff --git a/src/test/jtx/PathSet.h b/src/test/jtx/PathSet.h index a391adcb1b..fa3f0d40f9 100644 --- a/src/test/jtx/PathSet.h +++ b/src/test/jtx/PathSet.h @@ -1,10 +1,20 @@ #pragma once -#include +#include +#include -#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include + +#include namespace xrpl::test { diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 34532b17f7..b1643de362 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -1,20 +1,51 @@ #pragma once +#include #include +#include +#include #include +#include +#include #include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include // IWYU pragma: keep +#include +#include +#include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include #include diff --git a/src/test/jtx/TestSuite.h b/src/test/jtx/TestSuite.h index 705adbb620..d40cc6aba6 100644 --- a/src/test/jtx/TestSuite.h +++ b/src/test/jtx/TestSuite.h @@ -1,7 +1,9 @@ #pragma once -#include +#include +#include +#include #include namespace xrpl { diff --git a/src/test/jtx/TrustedPublisherServer.h b/src/test/jtx/TrustedPublisherServer.h index 9a53a32481..008bbe70c3 100644 --- a/src/test/jtx/TrustedPublisherServer.h +++ b/src/test/jtx/TrustedPublisherServer.h @@ -2,11 +2,18 @@ #include +#include #include +#include #include #include +#include +#include #include +#include +#include #include +#include #include #include @@ -19,9 +26,21 @@ #include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include +#include namespace xrpl::test { diff --git a/src/test/jtx/WSClient.h b/src/test/jtx/WSClient.h index 5a22fafe2e..4aa41e072c 100644 --- a/src/test/jtx/WSClient.h +++ b/src/test/jtx/WSClient.h @@ -4,9 +4,14 @@ #include +#include + #include +#include #include #include +#include +#include namespace xrpl::test { diff --git a/src/test/jtx/account_txn_id.h b/src/test/jtx/account_txn_id.h index 89f7368ee6..ffee4123aa 100644 --- a/src/test/jtx/account_txn_id.h +++ b/src/test/jtx/account_txn_id.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/acctdelete.h b/src/test/jtx/acctdelete.h index 5c8a136617..3f8b9f1ed2 100644 --- a/src/test/jtx/acctdelete.h +++ b/src/test/jtx/acctdelete.h @@ -3,7 +3,9 @@ #include #include -#include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/amount.h b/src/test/jtx/amount.h index db281419ef..ce0234b41a 100644 --- a/src/test/jtx/amount.h +++ b/src/test/jtx/amount.h @@ -3,14 +3,26 @@ #include #include +#include #include +#include +#include +#include +#include #include #include +#include #include -#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include diff --git a/src/test/jtx/balance.h b/src/test/jtx/balance.h index 5ea80c77f8..3f39e9f0fb 100644 --- a/src/test/jtx/balance.h +++ b/src/test/jtx/balance.h @@ -1,8 +1,12 @@ #pragma once +#include #include +#include #include +#include + #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/batch.h b/src/test/jtx/batch.h index 4d564f150a..bb1deec1a2 100644 --- a/src/test/jtx/batch.h +++ b/src/test/jtx/batch.h @@ -2,17 +2,21 @@ #include #include +#include #include -#include -#include -#include +#include +#include +#include #include +#include +#include #include #include #include #include +#include /** @brief Helpers for constructing Batch test transactions. */ namespace xrpl::test::jtx::batch { diff --git a/src/test/jtx/check.h b/src/test/jtx/check.h index 7c3dc6aa80..f66d802247 100644 --- a/src/test/jtx/check.h +++ b/src/test/jtx/check.h @@ -1,9 +1,13 @@ #pragma once #include -#include #include +#include +#include +#include +#include + #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/credentials.h b/src/test/jtx/credentials.h index 4bdd716918..8da2f289a1 100644 --- a/src/test/jtx/credentials.h +++ b/src/test/jtx/credentials.h @@ -2,7 +2,18 @@ #include #include -#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include namespace xrpl::test::jtx::credentials { diff --git a/src/test/jtx/delegate.h b/src/test/jtx/delegate.h index ae848603a7..9b64c105ba 100644 --- a/src/test/jtx/delegate.h +++ b/src/test/jtx/delegate.h @@ -2,8 +2,14 @@ #include #include +#include +#include +#include + +#include #include +#include namespace xrpl::test::jtx::delegate { diff --git a/src/test/jtx/delivermin.h b/src/test/jtx/delivermin.h index 0a8fa9f823..29256e37bd 100644 --- a/src/test/jtx/delivermin.h +++ b/src/test/jtx/delivermin.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include diff --git a/src/test/jtx/deposit.h b/src/test/jtx/deposit.h index 0d8e363138..5ba12648e2 100644 --- a/src/test/jtx/deposit.h +++ b/src/test/jtx/deposit.h @@ -1,7 +1,14 @@ #pragma once #include -#include + +#include +#include +#include +#include + +#include +#include /** Deposit preauthorize operations */ namespace xrpl::test::jtx::deposit { diff --git a/src/test/jtx/did.h b/src/test/jtx/did.h index 7662c6556a..30c89fd879 100644 --- a/src/test/jtx/did.h +++ b/src/test/jtx/did.h @@ -2,7 +2,13 @@ #include #include -#include +#include + +#include +#include +#include + +#include /** DID operations. */ namespace xrpl::test::jtx::did { diff --git a/src/test/jtx/directory.h b/src/test/jtx/directory.h index c63640ae1f..13473f949e 100644 --- a/src/test/jtx/directory.h +++ b/src/test/jtx/directory.h @@ -2,11 +2,15 @@ #include +#include +#include #include -#include +#include +#include #include #include +#include #include /** Directory operations. */ diff --git a/src/test/jtx/domain.h b/src/test/jtx/domain.h index b3a0744768..ebcfdb662a 100644 --- a/src/test/jtx/domain.h +++ b/src/test/jtx/domain.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/envconfig.h b/src/test/jtx/envconfig.h index 4c56ec8217..0079605637 100644 --- a/src/test/jtx/envconfig.h +++ b/src/test/jtx/envconfig.h @@ -2,6 +2,11 @@ #include +#include +#include +#include +#include + namespace xrpl::test { extern std::atomic gEnvUseIPv4; diff --git a/src/test/jtx/escrow.h b/src/test/jtx/escrow.h index 58be9b701a..728b2e3643 100644 --- a/src/test/jtx/escrow.h +++ b/src/test/jtx/escrow.h @@ -3,10 +3,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include + +#include +#include /** Escrow operations. */ namespace xrpl::test::jtx::escrow { diff --git a/src/test/jtx/fee.h b/src/test/jtx/fee.h index 048b262e88..ad3002dc75 100644 --- a/src/test/jtx/fee.h +++ b/src/test/jtx/fee.h @@ -1,12 +1,15 @@ #pragma once #include +#include #include #include #include +#include #include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/flags.h b/src/test/jtx/flags.h index 6e0c49b752..83470f9a1b 100644 --- a/src/test/jtx/flags.h +++ b/src/test/jtx/flags.h @@ -1,11 +1,15 @@ #pragma once +#include #include #include +#include #include #include +#include +#include #include namespace xrpl { diff --git a/src/test/jtx/impl/Oracle.cpp b/src/test/jtx/impl/Oracle.cpp index 991c84fc18..cd96ef5c0d 100644 --- a/src/test/jtx/impl/Oracle.cpp +++ b/src/test/jtx/impl/Oracle.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/src/test/jtx/invoice_id.h b/src/test/jtx/invoice_id.h index 2246d54abf..b2f13a1d96 100644 --- a/src/test/jtx/invoice_id.h +++ b/src/test/jtx/invoice_id.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/jtx_json.h b/src/test/jtx/jtx_json.h index d58f0b47ac..b22d4c30e1 100644 --- a/src/test/jtx/jtx_json.h +++ b/src/test/jtx/jtx_json.h @@ -1,9 +1,12 @@ #pragma once #include +#include #include +#include + namespace xrpl::test::jtx { /** Inject raw JSON. */ diff --git a/src/test/jtx/last_ledger_sequence.h b/src/test/jtx/last_ledger_sequence.h index 6170c2e4e1..ff6390298e 100644 --- a/src/test/jtx/last_ledger_sequence.h +++ b/src/test/jtx/last_ledger_sequence.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/ledgerStateFix.h b/src/test/jtx/ledgerStateFix.h index 71f3f76101..dd1ac19f04 100644 --- a/src/test/jtx/ledgerStateFix.h +++ b/src/test/jtx/ledgerStateFix.h @@ -1,7 +1,9 @@ #pragma once #include -#include + +#include +#include /** LedgerStateFix operations. */ namespace xrpl::test::jtx::ledgerStateFix { diff --git a/src/test/jtx/memo.h b/src/test/jtx/memo.h index 9b5c1118ac..cea4923d38 100644 --- a/src/test/jtx/memo.h +++ b/src/test/jtx/memo.h @@ -1,7 +1,9 @@ #pragma once #include +#include +#include #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/mpt.h b/src/test/jtx/mpt.h index d5fba82e08..1a7fe94785 100644 --- a/src/test/jtx/mpt.h +++ b/src/test/jtx/mpt.h @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -9,14 +10,33 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/multisign.h b/src/test/jtx/multisign.h index 3fef2ab446..c90e28537a 100644 --- a/src/test/jtx/multisign.h +++ b/src/test/jtx/multisign.h @@ -1,14 +1,22 @@ #pragma once #include +#include +#include #include -#include #include #include +#include +#include +#include +#include + #include #include #include +#include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/noop.h b/src/test/jtx/noop.h index 095e20f387..c38dfdde25 100644 --- a/src/test/jtx/noop.h +++ b/src/test/jtx/noop.h @@ -1,7 +1,10 @@ #pragma once +#include #include +#include + namespace xrpl::test::jtx { /** The null transaction. */ diff --git a/src/test/jtx/offer.h b/src/test/jtx/offer.h index 9a31904058..f3e7277933 100644 --- a/src/test/jtx/offer.h +++ b/src/test/jtx/offer.h @@ -5,6 +5,8 @@ #include #include +#include + namespace xrpl::test::jtx { /** Create an offer. */ diff --git a/src/test/jtx/owners.h b/src/test/jtx/owners.h index 44fd3762c2..0fb38b407c 100644 --- a/src/test/jtx/owners.h +++ b/src/test/jtx/owners.h @@ -1,10 +1,11 @@ #pragma once +#include #include #include +#include #include -#include #include #include diff --git a/src/test/jtx/paths.h b/src/test/jtx/paths.h index a8a8f7900c..1450985687 100644 --- a/src/test/jtx/paths.h +++ b/src/test/jtx/paths.h @@ -1,8 +1,13 @@ #pragma once +#include #include +#include +#include -#include +#include +#include +#include #include diff --git a/src/test/jtx/pay.h b/src/test/jtx/pay.h index 8f4f3287ae..fa193e7b02 100644 --- a/src/test/jtx/pay.h +++ b/src/test/jtx/pay.h @@ -4,6 +4,7 @@ #include #include +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/permissioned_dex.h b/src/test/jtx/permissioned_dex.h index b0a4d4e2d5..a8afcac2eb 100644 --- a/src/test/jtx/permissioned_dex.h +++ b/src/test/jtx/permissioned_dex.h @@ -3,6 +3,11 @@ #include #include +#include + +#include +#include + namespace xrpl::test::jtx { uint256 diff --git a/src/test/jtx/permissioned_domains.h b/src/test/jtx/permissioned_domains.h index fdd2b0da1d..f4dc080cbf 100644 --- a/src/test/jtx/permissioned_domains.h +++ b/src/test/jtx/permissioned_domains.h @@ -4,6 +4,18 @@ #include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + namespace xrpl::test::jtx::pdomain { // Helpers for PermissionedDomains testing diff --git a/src/test/jtx/prop.h b/src/test/jtx/prop.h index c3ec6bc0fe..e85751e4c9 100644 --- a/src/test/jtx/prop.h +++ b/src/test/jtx/prop.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include #include diff --git a/src/test/jtx/quality.h b/src/test/jtx/quality.h index 75bf930434..c7896fadf9 100644 --- a/src/test/jtx/quality.h +++ b/src/test/jtx/quality.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/require.h b/src/test/jtx/require.h index 91cc75b3f5..19e161b938 100644 --- a/src/test/jtx/require.h +++ b/src/test/jtx/require.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include diff --git a/src/test/jtx/rpc.h b/src/test/jtx/rpc.h index 1f538f9ca5..bc05450909 100644 --- a/src/test/jtx/rpc.h +++ b/src/test/jtx/rpc.h @@ -1,8 +1,13 @@ #pragma once #include +#include -#include +#include +#include + +#include +#include #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/sendmax.h b/src/test/jtx/sendmax.h index 125b10b7d4..1241d76b91 100644 --- a/src/test/jtx/sendmax.h +++ b/src/test/jtx/sendmax.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include diff --git a/src/test/jtx/seq.h b/src/test/jtx/seq.h index de06ac3fbc..956c0a77e8 100644 --- a/src/test/jtx/seq.h +++ b/src/test/jtx/seq.h @@ -1,8 +1,10 @@ #pragma once #include +#include #include +#include #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/sig.h b/src/test/jtx/sig.h index e88785ef15..76f0a34dff 100644 --- a/src/test/jtx/sig.h +++ b/src/test/jtx/sig.h @@ -1,6 +1,11 @@ #pragma once +#include #include +#include +#include + +#include #include diff --git a/src/test/jtx/tag.h b/src/test/jtx/tag.h index 9279e2a13b..77870367a9 100644 --- a/src/test/jtx/tag.h +++ b/src/test/jtx/tag.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/ter.h b/src/test/jtx/ter.h index c410b46a1e..880711dca0 100644 --- a/src/test/jtx/ter.h +++ b/src/test/jtx/ter.h @@ -1,7 +1,11 @@ #pragma once #include +#include +#include + +#include #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/ticket.h b/src/test/jtx/ticket.h index 02f742ee93..1035be7674 100644 --- a/src/test/jtx/ticket.h +++ b/src/test/jtx/ticket.h @@ -2,8 +2,12 @@ #include #include +#include #include +#include +#include + #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/token.h b/src/test/jtx/token.h index 206d170534..97f968fdfc 100644 --- a/src/test/jtx/token.h +++ b/src/test/jtx/token.h @@ -2,11 +2,17 @@ #include #include -#include +#include +#include #include +#include +#include +#include #include +#include +#include namespace xrpl::test::jtx::token { diff --git a/src/test/jtx/trust.h b/src/test/jtx/trust.h index 07fd0f7c4e..034f80fcec 100644 --- a/src/test/jtx/trust.h +++ b/src/test/jtx/trust.h @@ -5,6 +5,9 @@ #include #include +#include +#include + namespace xrpl::test::jtx { /** Modify a trust line. */ diff --git a/src/test/jtx/txflags.h b/src/test/jtx/txflags.h index 975038d26a..7f5b31b2ac 100644 --- a/src/test/jtx/txflags.h +++ b/src/test/jtx/txflags.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include namespace xrpl::test::jtx { diff --git a/src/test/jtx/utility.h b/src/test/jtx/utility.h index c3ed91f672..f1cf3f7ae8 100644 --- a/src/test/jtx/utility.h +++ b/src/test/jtx/utility.h @@ -2,11 +2,13 @@ #include +#include #include -#include +#include #include #include +#include #include namespace xrpl::test::jtx { diff --git a/src/test/jtx/vault.h b/src/test/jtx/vault.h index c1e0831a66..4e6b90fe1f 100644 --- a/src/test/jtx/vault.h +++ b/src/test/jtx/vault.h @@ -1,13 +1,13 @@ #pragma once #include -#include #include #include #include #include +#include #include #include diff --git a/src/test/jtx/xchain_bridge.h b/src/test/jtx/xchain_bridge.h index e4c012510d..aacef80bbe 100644 --- a/src/test/jtx/xchain_bridge.h +++ b/src/test/jtx/xchain_bridge.h @@ -1,12 +1,19 @@ #pragma once #include +#include #include #include #include +#include +#include #include -#include + +#include +#include +#include +#include namespace xrpl::test::jtx { diff --git a/src/test/nodestore/TestBase.h b/src/test/nodestore/TestBase.h index 885c3bbeac..1254fc51aa 100644 --- a/src/test/nodestore/TestBase.h +++ b/src/test/nodestore/TestBase.h @@ -1,17 +1,22 @@ #pragma once -#include +#include +#include #include -#include +#include #include #include #include #include +#include #include #include -#include +#include +#include +#include +#include namespace xrpl::NodeStore { diff --git a/src/test/protocol/STObject_test.cpp b/src/test/protocol/STObject_test.cpp index 801eebbe63..b823b24962 100644 --- a/src/test/protocol/STObject_test.cpp +++ b/src/test/protocol/STObject_test.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/src/test/protocol/STParsedJSON_test.cpp b/src/test/protocol/STParsedJSON_test.cpp index bc5c72b4fc..24981053f5 100644 --- a/src/test/protocol/STParsedJSON_test.cpp +++ b/src/test/protocol/STParsedJSON_test.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/src/test/rpc/GRPCTestClientBase.h b/src/test/rpc/GRPCTestClientBase.h deleted file mode 100644 index 15d335781d..0000000000 --- a/src/test/rpc/GRPCTestClientBase.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include - -#include - -#include - -namespace xrpl { -namespace test { - -struct GRPCTestClientBase -{ - explicit GRPCTestClientBase(std::string const& port) - : stub( - org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel( - beast::IP::Endpoint( - boost::asio::ip::make_address(getEnvLocalhostAddr()), - std::stoi(port)) - .to_string(), - grpc::InsecureChannelCredentials()))) - { - } - - grpc::Status status; - grpc::ClientContext context; - std::unique_ptr stub; -}; - -} // namespace test -} // namespace xrpl diff --git a/src/test/shamap/common.h b/src/test/shamap/common.h index 0475acdf6d..9bef10d851 100644 --- a/src/test/shamap/common.h +++ b/src/test/shamap/common.h @@ -1,11 +1,24 @@ #pragma once +#include +#include #include +#include +#include +#include #include #include +#include #include #include #include +#include +#include + +#include +#include +#include +#include namespace xrpl::tests { diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index 19110469ee..3fc5d015b0 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -1,12 +1,16 @@ #pragma once -#include - #include +#include #include +#include #include +#include +#include +#include +#include namespace xrpl::detail { diff --git a/src/test/unit_test/SuiteJournal.h b/src/test/unit_test/SuiteJournal.h index 174e9ff2ff..66287e328c 100644 --- a/src/test/unit_test/SuiteJournal.h +++ b/src/test/unit_test/SuiteJournal.h @@ -1,8 +1,13 @@ #pragma once -#include +#include #include +#include +#include +#include +#include + namespace xrpl::test { // A Journal::Sink intended for use with the beast unit test framework. diff --git a/src/test/unit_test/multi_runner.h b/src/test/unit_test/multi_runner.h index 55cf6c25fa..3390014cb8 100644 --- a/src/test/unit_test/multi_runner.h +++ b/src/test/unit_test/multi_runner.h @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -12,11 +13,15 @@ #include #include -#include +#include +#include +#include +#include +#include +#include #include #include #include -#include #include namespace xrpl { diff --git a/src/tests/libxrpl/CMakeLists.txt b/src/tests/libxrpl/CMakeLists.txt index bd56028728..df483a36d8 100644 --- a/src/tests/libxrpl/CMakeLists.txt +++ b/src/tests/libxrpl/CMakeLists.txt @@ -1,5 +1,6 @@ include(GoogleTest) include(isolate_headers) +include(verify_headers) # Test requirements. find_package(GTest REQUIRED) @@ -54,4 +55,10 @@ foreach(module IN LISTS test_modules) ) endforeach() +# The test helpers and per-module test headers are not built with add_module, +# so verify them against the test binary's own compile environment. +if(verify_headers) + verify_target_headers(xrpl_tests "${CMAKE_CURRENT_SOURCE_DIR}") +endif() + gtest_discover_tests(xrpl_tests DISCOVERY_TIMEOUT 60) diff --git a/src/tests/libxrpl/helpers/IOU.h b/src/tests/libxrpl/helpers/IOU.h index d80f962edf..10deaee99b 100644 --- a/src/tests/libxrpl/helpers/IOU.h +++ b/src/tests/libxrpl/helpers/IOU.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -8,7 +9,6 @@ #include -#include #include #include #include diff --git a/src/tests/libxrpl/helpers/TestFamily.h b/src/tests/libxrpl/helpers/TestFamily.h index 50f514480a..a5ff34a111 100644 --- a/src/tests/libxrpl/helpers/TestFamily.h +++ b/src/tests/libxrpl/helpers/TestFamily.h @@ -1,13 +1,22 @@ #pragma once +#include +#include #include +#include +#include #include #include +#include #include #include #include +#include +#include +#include #include +#include namespace xrpl::test { diff --git a/src/tests/libxrpl/helpers/TestServiceRegistry.h b/src/tests/libxrpl/helpers/TestServiceRegistry.h index 0536176344..0108f886d3 100644 --- a/src/tests/libxrpl/helpers/TestServiceRegistry.h +++ b/src/tests/libxrpl/helpers/TestServiceRegistry.h @@ -1,7 +1,9 @@ #pragma once #include +#include #include +#include #include #include #include @@ -13,8 +15,11 @@ #include #include +#include +#include #include #include +#include namespace xrpl::test { diff --git a/src/tests/libxrpl/helpers/TestSink.h b/src/tests/libxrpl/helpers/TestSink.h index 28c85f00e4..b8637b7038 100644 --- a/src/tests/libxrpl/helpers/TestSink.h +++ b/src/tests/libxrpl/helpers/TestSink.h @@ -2,6 +2,8 @@ #include +#include + namespace xrpl { class TestSink : public beast::Journal::Sink { diff --git a/src/tests/libxrpl/helpers/TxTest.h b/src/tests/libxrpl/helpers/TxTest.h index 1b3ce460a2..cb75cd5ee0 100644 --- a/src/tests/libxrpl/helpers/TxTest.h +++ b/src/tests/libxrpl/helpers/TxTest.h @@ -1,18 +1,23 @@ #pragma once #include +#include #include -#include +#include #include -#include #include #include +#include +#include #include #include #include +#include +#include #include #include #include +#include #include #include #include @@ -24,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/src/tests/libxrpl/protocol_autogen/TestHelpers.h b/src/tests/libxrpl/protocol_autogen/TestHelpers.h index a32ab5e20c..0fc26032f0 100644 --- a/src/tests/libxrpl/protocol_autogen/TestHelpers.h +++ b/src/tests/libxrpl/protocol_autogen/TestHelpers.h @@ -9,6 +9,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/app/consensus/RCLCensorshipDetector.h b/src/xrpld/app/consensus/RCLCensorshipDetector.h index 48df7368d9..4318a7b4ff 100644 --- a/src/xrpld/app/consensus/RCLCensorshipDetector.h +++ b/src/xrpld/app/consensus/RCLCensorshipDetector.h @@ -1,9 +1,9 @@ #pragma once #include -#include #include +#include #include #include diff --git a/src/xrpld/app/consensus/RCLConsensus.h b/src/xrpld/app/consensus/RCLConsensus.h index 32759300fa..359f6b8009 100644 --- a/src/xrpld/app/consensus/RCLConsensus.h +++ b/src/xrpld/app/consensus/RCLConsensus.h @@ -4,21 +4,37 @@ #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include -#include +#include + +#include #include +#include +#include +#include #include #include +#include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/app/consensus/RCLCxLedger.h b/src/xrpld/app/consensus/RCLCxLedger.h index 9f7984aaa6..89f70f9add 100644 --- a/src/xrpld/app/consensus/RCLCxLedger.h +++ b/src/xrpld/app/consensus/RCLCxLedger.h @@ -2,10 +2,16 @@ #include +#include +#include #include -#include +#include +#include #include +#include +#include + namespace xrpl { /** Represents a ledger in RCLConsensus. diff --git a/src/xrpld/app/consensus/RCLCxPeerPos.h b/src/xrpld/app/consensus/RCLCxPeerPos.h index 4618bdb746..e73ac3b532 100644 --- a/src/xrpld/app/consensus/RCLCxPeerPos.h +++ b/src/xrpld/app/consensus/RCLCxPeerPos.h @@ -2,11 +2,14 @@ #include +#include #include +#include #include #include #include #include +#include #include diff --git a/src/xrpld/app/consensus/RCLCxTx.h b/src/xrpld/app/consensus/RCLCxTx.h index 52637d32b3..f174a2fd54 100644 --- a/src/xrpld/app/consensus/RCLCxTx.h +++ b/src/xrpld/app/consensus/RCLCxTx.h @@ -1,6 +1,14 @@ #pragma once +#include +#include #include +#include +#include + +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/consensus/RCLValidations.h b/src/xrpld/app/consensus/RCLValidations.h index 37a6f6c743..e8a1996204 100644 --- a/src/xrpld/app/consensus/RCLValidations.h +++ b/src/xrpld/app/consensus/RCLValidations.h @@ -2,12 +2,23 @@ #include +#include +#include +#include #include #include +#include #include +#include #include +#include +#include +#include +#include #include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/ledger/AcceptedLedger.h b/src/xrpld/app/ledger/AcceptedLedger.h index b05af1f18a..ec83839d7a 100644 --- a/src/xrpld/app/ledger/AcceptedLedger.h +++ b/src/xrpld/app/ledger/AcceptedLedger.h @@ -3,6 +3,11 @@ #include #include #include +#include + +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/AccountStateSF.h b/src/xrpld/app/ledger/AccountStateSF.h index 5d00e65120..f5117db4d4 100644 --- a/src/xrpld/app/ledger/AccountStateSF.h +++ b/src/xrpld/app/ledger/AccountStateSF.h @@ -2,8 +2,14 @@ #include +#include +#include #include #include +#include + +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/BuildLedger.h b/src/xrpld/app/ledger/BuildLedger.h index 32d45daea3..faa800daa7 100644 --- a/src/xrpld/app/ledger/BuildLedger.h +++ b/src/xrpld/app/ledger/BuildLedger.h @@ -3,6 +3,10 @@ #include #include #include +#include + +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp index 7c74c10b1b..a8ce70d978 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp @@ -6,6 +6,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.h b/src/xrpld/app/ledger/ConsensusTransSetSF.h index f1d0e26d26..59894add7f 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.h +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.h @@ -2,8 +2,15 @@ #include +#include +#include #include +#include #include +#include + +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/InboundLedger.h b/src/xrpld/app/ledger/InboundLedger.h index b82e2f69cd..5f9f0e1baf 100644 --- a/src/xrpld/app/ledger/InboundLedger.h +++ b/src/xrpld/app/ledger/InboundLedger.h @@ -2,14 +2,31 @@ #include #include +#include #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include #include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/InboundLedgers.h b/src/xrpld/app/ledger/InboundLedgers.h index f6c864f777..65b2db7d8e 100644 --- a/src/xrpld/app/ledger/InboundLedgers.h +++ b/src/xrpld/app/ledger/InboundLedgers.h @@ -1,9 +1,23 @@ #pragma once #include +#include +#include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include +#include + namespace xrpl { /** Manages the lifetime of inbound ledgers. diff --git a/src/xrpld/app/ledger/InboundTransactions.h b/src/xrpld/app/ledger/InboundTransactions.h index bd176dbd95..d9799d9ad0 100644 --- a/src/xrpld/app/ledger/InboundTransactions.h +++ b/src/xrpld/app/ledger/InboundTransactions.h @@ -2,9 +2,16 @@ #include +#include #include +#include #include +#include + +#include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/ledger/LedgerCleaner.h b/src/xrpld/app/ledger/LedgerCleaner.h index 3f76f5593c..fd693d6bec 100644 --- a/src/xrpld/app/ledger/LedgerCleaner.h +++ b/src/xrpld/app/ledger/LedgerCleaner.h @@ -6,6 +6,8 @@ #include #include +#include + namespace xrpl { /** Check the ledger/transaction databases to make sure they have continuity */ diff --git a/src/xrpld/app/ledger/LedgerHistory.h b/src/xrpld/app/ledger/LedgerHistory.h index 057de7b1bc..3fb6e345cf 100644 --- a/src/xrpld/app/ledger/LedgerHistory.h +++ b/src/xrpld/app/ledger/LedgerHistory.h @@ -2,10 +2,17 @@ #include +#include #include +#include +#include +#include #include +#include #include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/ledger/LedgerHolder.h b/src/xrpld/app/ledger/LedgerHolder.h index 69fe00b439..3e70544bfc 100644 --- a/src/xrpld/app/ledger/LedgerHolder.h +++ b/src/xrpld/app/ledger/LedgerHolder.h @@ -2,8 +2,11 @@ #include #include +#include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/LedgerMaster.h b/src/xrpld/app/ledger/LedgerMaster.h index 885ab6db25..efd8c15e20 100644 --- a/src/xrpld/app/ledger/LedgerMaster.h +++ b/src/xrpld/app/ledger/LedgerMaster.h @@ -1,25 +1,42 @@ #pragma once #include -#include +#include #include #include #include #include #include +#include #include #include +#include #include #include +#include +#include +#include +#include #include #include +#include #include #include -#include +#include +#include + +#include +#include +#include +#include +#include #include #include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/LedgerPersistence.h b/src/xrpld/app/ledger/LedgerPersistence.h index e131932af4..f466c32296 100644 --- a/src/xrpld/app/ledger/LedgerPersistence.h +++ b/src/xrpld/app/ledger/LedgerPersistence.h @@ -1,7 +1,11 @@ #pragma once +#include #include +#include +#include +#include #include #include diff --git a/src/xrpld/app/ledger/LedgerReplayTask.h b/src/xrpld/app/ledger/LedgerReplayTask.h index 7bb75253f2..09329761c1 100644 --- a/src/xrpld/app/ledger/LedgerReplayTask.h +++ b/src/xrpld/app/ledger/LedgerReplayTask.h @@ -4,6 +4,11 @@ #include #include +#include +#include + +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/ledger/LedgerReplayer.h b/src/xrpld/app/ledger/LedgerReplayer.h index e2d256f597..d44289121c 100644 --- a/src/xrpld/app/ledger/LedgerReplayer.h +++ b/src/xrpld/app/ledger/LedgerReplayer.h @@ -1,11 +1,20 @@ #pragma once -#include +#include #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/xrpld/app/ledger/LedgerToJson.h b/src/xrpld/app/ledger/LedgerToJson.h index 853d4468cd..c9939fd2f4 100644 --- a/src/xrpld/app/ledger/LedgerToJson.h +++ b/src/xrpld/app/ledger/LedgerToJson.h @@ -5,8 +5,12 @@ #include #include -#include -#include +#include +#include + +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/LocalTxs.h b/src/xrpld/app/ledger/LocalTxs.h index 1575a18075..fe955eba24 100644 --- a/src/xrpld/app/ledger/LocalTxs.h +++ b/src/xrpld/app/ledger/LocalTxs.h @@ -2,7 +2,10 @@ #include #include +#include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/ledger/OpenLedger.h b/src/xrpld/app/ledger/OpenLedger.h index 554002d6af..3e0577a9be 100644 --- a/src/xrpld/app/ledger/OpenLedger.h +++ b/src/xrpld/app/ledger/OpenLedger.h @@ -3,15 +3,23 @@ #include #include -#include #include #include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include #include +#include #include namespace xrpl { diff --git a/src/xrpld/app/ledger/OrderBookDBImpl.h b/src/xrpld/app/ledger/OrderBookDBImpl.h index a68f63c043..d57d051cce 100644 --- a/src/xrpld/app/ledger/OrderBookDBImpl.h +++ b/src/xrpld/app/ledger/OrderBookDBImpl.h @@ -1,11 +1,22 @@ #pragma once +#include +#include #include #include +#include +#include +#include #include +#include +#include +#include +#include #include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/TransactionMaster.h b/src/xrpld/app/ledger/TransactionMaster.h index 84cbf56e8b..5dcad09f51 100644 --- a/src/xrpld/app/ledger/TransactionMaster.h +++ b/src/xrpld/app/ledger/TransactionMaster.h @@ -4,10 +4,19 @@ #include #include +#include #include +#include +#include #include #include +#include +#include +#include +#include +#include + namespace xrpl { class Application; diff --git a/src/xrpld/app/ledger/TransactionStateSF.h b/src/xrpld/app/ledger/TransactionStateSF.h index c5c113be7f..a3f7e7f55a 100644 --- a/src/xrpld/app/ledger/TransactionStateSF.h +++ b/src/xrpld/app/ledger/TransactionStateSF.h @@ -2,8 +2,14 @@ #include +#include +#include #include #include +#include + +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp index 4c79068bca..7ac85b892e 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include #include diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h index 57e8fb5652..10c8a21b3a 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h @@ -2,12 +2,22 @@ #include #include +#include #include #include #include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include namespace xrpl { class InboundLedgers; diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 31510b44d2..3fcac03ed5 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include diff --git a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h index 260f1ff753..5a8951fb25 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h +++ b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.h @@ -1,7 +1,10 @@ #pragma once #include -#include + +#include + +#include namespace xrpl { class Application; diff --git a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp index f9f1aa3188..e7cd031247 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include diff --git a/src/xrpld/app/ledger/detail/SkipListAcquire.cpp b/src/xrpld/app/ledger/detail/SkipListAcquire.cpp index 6c6679ed87..8ebd14083a 100644 --- a/src/xrpld/app/ledger/detail/SkipListAcquire.cpp +++ b/src/xrpld/app/ledger/detail/SkipListAcquire.cpp @@ -1,6 +1,8 @@ #include #include +#include +#include #include #include #include diff --git a/src/xrpld/app/ledger/detail/SkipListAcquire.h b/src/xrpld/app/ledger/detail/SkipListAcquire.h index 6600b495c9..6f8ceb8b74 100644 --- a/src/xrpld/app/ledger/detail/SkipListAcquire.h +++ b/src/xrpld/app/ledger/detail/SkipListAcquire.h @@ -1,11 +1,19 @@ #pragma once -#include #include #include +#include +#include #include -#include +#include + +#include +#include +#include +#include +#include +#include namespace xrpl { class InboundLedgers; diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.h b/src/xrpld/app/ledger/detail/TimeoutCounter.h index 18b443c67d..ab4dd28e47 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.h +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.h @@ -2,12 +2,18 @@ #include +#include #include #include #include +#include +#include +#include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.h b/src/xrpld/app/ledger/detail/TransactionAcquire.h index b94a9f4bfc..5b33066390 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.h +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.h @@ -1,9 +1,20 @@ #pragma once #include +#include +#include #include +#include +#include +#include #include +#include + +#include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 08d84636f6..b99c98afa1 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index 08e41e2c4c..33876b97b9 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -2,17 +2,25 @@ #include +#include +#include #include +#include #include -#include #include #include -#include #include #include +#include +#include +#include +#include #include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/main/BasicApp.h b/src/xrpld/app/main/BasicApp.h index 5ba7c719e3..aa367ca674 100644 --- a/src/xrpld/app/main/BasicApp.h +++ b/src/xrpld/app/main/BasicApp.h @@ -2,6 +2,7 @@ #include +#include #include #include #include diff --git a/src/xrpld/app/main/CollectorManager.h b/src/xrpld/app/main/CollectorManager.h index d07da15353..e695ddc956 100644 --- a/src/xrpld/app/main/CollectorManager.h +++ b/src/xrpld/app/main/CollectorManager.h @@ -1,8 +1,13 @@ #pragma once -#include +#include +#include +#include #include +#include +#include + namespace xrpl { /** Provides the beast::insight::Collector service. */ diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index 1af1343fc5..1146cbdc08 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -1,5 +1,6 @@ #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index 7d299474d9..db948cab99 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -2,16 +2,27 @@ #include #include -#include #include #include +#include #include #include #include -#include +#include #include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/main/LoadManager.h b/src/xrpld/app/main/LoadManager.h index 5baa01550e..794048567a 100644 --- a/src/xrpld/app/main/LoadManager.h +++ b/src/xrpld/app/main/LoadManager.h @@ -2,7 +2,7 @@ #include -#include +#include #include #include #include diff --git a/src/xrpld/app/main/NodeIdentity.h b/src/xrpld/app/main/NodeIdentity.h index bebd5c261d..789d061021 100644 --- a/src/xrpld/app/main/NodeIdentity.h +++ b/src/xrpld/app/main/NodeIdentity.h @@ -7,6 +7,8 @@ #include +#include + namespace xrpl { /** The cryptographic credentials identifying this server instance. diff --git a/src/xrpld/app/main/NodeStoreScheduler.h b/src/xrpld/app/main/NodeStoreScheduler.h index 19e8d9d212..48e606bb45 100644 --- a/src/xrpld/app/main/NodeStoreScheduler.h +++ b/src/xrpld/app/main/NodeStoreScheduler.h @@ -2,6 +2,7 @@ #include #include +#include namespace xrpl { diff --git a/src/xrpld/app/main/Tuning.h b/src/xrpld/app/main/Tuning.h index d61f27ec03..0f7a69f5b1 100644 --- a/src/xrpld/app/main/Tuning.h +++ b/src/xrpld/app/main/Tuning.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/AmendmentTableImpl.h b/src/xrpld/app/misc/AmendmentTableImpl.h index fe7c067d5a..db71189170 100644 --- a/src/xrpld/app/misc/AmendmentTableImpl.h +++ b/src/xrpld/app/misc/AmendmentTableImpl.h @@ -1,8 +1,12 @@ #pragma once +#include #include +#include -#include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/FeeVote.h b/src/xrpld/app/misc/FeeVote.h index 5c6206558a..d6b4b0fc6a 100644 --- a/src/xrpld/app/misc/FeeVote.h +++ b/src/xrpld/app/misc/FeeVote.h @@ -1,9 +1,15 @@ #pragma once +#include #include +#include +#include #include #include +#include +#include + namespace xrpl { /** Manager to process fee votes. */ diff --git a/src/xrpld/app/misc/FeeVoteImpl.cpp b/src/xrpld/app/misc/FeeVoteImpl.cpp index c4e6c3cdc2..363c17f4fa 100644 --- a/src/xrpld/app/misc/FeeVoteImpl.cpp +++ b/src/xrpld/app/misc/FeeVoteImpl.cpp @@ -10,6 +10,7 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/app/misc/NegativeUNLVote.h b/src/xrpld/app/misc/NegativeUNLVote.h index 5c2d3f8630..2896962a84 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.h +++ b/src/xrpld/app/misc/NegativeUNLVote.h @@ -1,12 +1,19 @@ #pragma once +#include +#include #include #include #include #include #include +#include +#include +#include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/SHAMapStore.h b/src/xrpld/app/misc/SHAMapStore.h index 3f43bc8fa4..9f12546463 100644 --- a/src/xrpld/app/misc/SHAMapStore.h +++ b/src/xrpld/app/misc/SHAMapStore.h @@ -2,9 +2,14 @@ #include +#include #include -#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index 33bbf1c613..0389130f7a 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index 1803c15e71..4025236868 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -1,17 +1,33 @@ #pragma once #include +#include #include +#include +#include +#include +#include +#include #include #include +#include #include #include #include +#include #include +#include #include #include +#include +#include +#include +#include +#include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/misc/Transaction.h b/src/xrpld/app/misc/Transaction.h index 80e041f5b7..ab0fa1f4d8 100644 --- a/src/xrpld/app/misc/Transaction.h +++ b/src/xrpld/app/misc/Transaction.h @@ -1,7 +1,11 @@ #pragma once +#include +#include #include +#include #include +#include #include #include #include @@ -9,8 +13,13 @@ #include #include #include +#include +#include +#include #include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/misc/TxQ.h b/src/xrpld/app/misc/TxQ.h index d3caec55cf..135cd592f0 100644 --- a/src/xrpld/app/misc/TxQ.h +++ b/src/xrpld/app/misc/TxQ.h @@ -1,17 +1,35 @@ #pragma once +#include +#include +#include #include #include +#include +#include +#include #include +#include +#include #include #include #include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/ValidatorKeys.h b/src/xrpld/app/misc/ValidatorKeys.h index 1f96815681..df88ec33a3 100644 --- a/src/xrpld/app/misc/ValidatorKeys.h +++ b/src/xrpld/app/misc/ValidatorKeys.h @@ -5,6 +5,8 @@ #include #include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/app/misc/ValidatorList.h b/src/xrpld/app/misc/ValidatorList.h index 3f1823f930..0db3eee284 100644 --- a/src/xrpld/app/misc/ValidatorList.h +++ b/src/xrpld/app/misc/ValidatorList.h @@ -3,17 +3,30 @@ #include #include -#include #include -#include +#include +#include +#include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include +#include +#include namespace protocol { class TMValidatorList; diff --git a/src/xrpld/app/misc/ValidatorSite.h b/src/xrpld/app/misc/ValidatorSite.h index 55f060baf1..7302ebbb52 100644 --- a/src/xrpld/app/misc/ValidatorSite.h +++ b/src/xrpld/app/misc/ValidatorSite.h @@ -4,14 +4,21 @@ #include #include -#include #include +#include #include #include +#include +#include +#include +#include +#include #include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/detail/AccountTxPaging.h b/src/xrpld/app/misc/detail/AccountTxPaging.h index a895549322..628ef82c3d 100644 --- a/src/xrpld/app/misc/detail/AccountTxPaging.h +++ b/src/xrpld/app/misc/detail/AccountTxPaging.h @@ -1,8 +1,11 @@ #pragma once +#include +#include #include #include +#include //------------------------------------------------------------------------------ diff --git a/src/xrpld/app/misc/detail/ValidatorSite.cpp b/src/xrpld/app/misc/detail/ValidatorSite.cpp index 6ce3711652..7b51fbd597 100644 --- a/src/xrpld/app/misc/detail/ValidatorSite.cpp +++ b/src/xrpld/app/misc/detail/ValidatorSite.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/src/xrpld/app/misc/detail/WorkBase.h b/src/xrpld/app/misc/detail/WorkBase.h index 56b227613f..5f5fdd28b7 100644 --- a/src/xrpld/app/misc/detail/WorkBase.h +++ b/src/xrpld/app/misc/detail/WorkBase.h @@ -2,7 +2,7 @@ #include -#include +#include #include #include @@ -12,6 +12,8 @@ #include #include +#include +#include #include namespace xrpl::detail { diff --git a/src/xrpld/app/misc/detail/WorkFile.h b/src/xrpld/app/misc/detail/WorkFile.h index 067dc4c38b..2fc7ab952d 100644 --- a/src/xrpld/app/misc/detail/WorkFile.h +++ b/src/xrpld/app/misc/detail/WorkFile.h @@ -10,6 +10,9 @@ #include #include +#include +#include +#include #include namespace xrpl::detail { diff --git a/src/xrpld/app/misc/detail/WorkPlain.h b/src/xrpld/app/misc/detail/WorkPlain.h index d3c0309e77..4c45fb4801 100644 --- a/src/xrpld/app/misc/detail/WorkPlain.h +++ b/src/xrpld/app/misc/detail/WorkPlain.h @@ -2,6 +2,9 @@ #include +#include +#include + namespace xrpl::detail { // Work over TCP/IP diff --git a/src/xrpld/app/misc/detail/WorkSSL.h b/src/xrpld/app/misc/detail/WorkSSL.h index 74676bb7c1..d4b3b9ff25 100644 --- a/src/xrpld/app/misc/detail/WorkSSL.h +++ b/src/xrpld/app/misc/detail/WorkSSL.h @@ -3,13 +3,14 @@ #include #include -#include +#include #include #include #include -#include +#include +#include namespace xrpl::detail { diff --git a/src/xrpld/app/misc/make_NetworkOPs.h b/src/xrpld/app/misc/make_NetworkOPs.h index a848067e36..b4dba2b065 100644 --- a/src/xrpld/app/misc/make_NetworkOPs.h +++ b/src/xrpld/app/misc/make_NetworkOPs.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include #include @@ -8,6 +8,7 @@ #include +#include #include namespace xrpl { diff --git a/src/xrpld/app/rdb/PeerFinder.h b/src/xrpld/app/rdb/PeerFinder.h index e5ac6dda8c..4f186ff7e2 100644 --- a/src/xrpld/app/rdb/PeerFinder.h +++ b/src/xrpld/app/rdb/PeerFinder.h @@ -1,10 +1,15 @@ #pragma once -#include #include +#include +#include #include +#include +#include +#include + namespace xrpl { /** diff --git a/src/xrpld/app/rdb/backend/SQLiteDatabase.h b/src/xrpld/app/rdb/backend/SQLiteDatabase.h index e5c69c2703..f5b930d23e 100644 --- a/src/xrpld/app/rdb/backend/SQLiteDatabase.h +++ b/src/xrpld/app/rdb/backend/SQLiteDatabase.h @@ -1,10 +1,22 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include #include #include +#include #include #include diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index dcc146397b..6e92a0de60 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -43,7 +43,9 @@ #include // IWYU pragma: keep #include +#include // IWYU pragma: keep #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/app/rdb/backend/detail/Node.h b/src/xrpld/app/rdb/backend/detail/Node.h index 8267bb1a82..ba3eb91ca3 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.h +++ b/src/xrpld/app/rdb/backend/detail/Node.h @@ -2,9 +2,33 @@ #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace xrpl::detail { /* Need to change TableTypeCount if TableType is modified. */ diff --git a/src/xrpld/app/rdb/detail/PeerFinder.cpp b/src/xrpld/app/rdb/detail/PeerFinder.cpp index 9452c3af99..c40e3e42c6 100644 --- a/src/xrpld/app/rdb/detail/PeerFinder.cpp +++ b/src/xrpld/app/rdb/detail/PeerFinder.cpp @@ -11,6 +11,7 @@ #include // IWYU pragma: keep +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index b8d04e18b5..fa41f25be1 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -3,19 +3,28 @@ #include #include #include -#include #include +#include #include +#include #include +#include +#include #include #include #include #include +#include +#include #include +#include +#include #include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/consensus/ConsensusParms.h b/src/xrpld/consensus/ConsensusParms.h index e6dd7f046e..d00a5dc3c7 100644 --- a/src/xrpld/consensus/ConsensusParms.h +++ b/src/xrpld/consensus/ConsensusParms.h @@ -4,9 +4,9 @@ #include #include -#include #include #include +#include namespace xrpl { diff --git a/src/xrpld/consensus/ConsensusProposal.h b/src/xrpld/consensus/ConsensusProposal.h index d16679bfb5..c27d5c2819 100644 --- a/src/xrpld/consensus/ConsensusProposal.h +++ b/src/xrpld/consensus/ConsensusProposal.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace xrpl { /** Represents a proposed position taken during a round of consensus. diff --git a/src/xrpld/consensus/ConsensusTypes.h b/src/xrpld/consensus/ConsensusTypes.h index f043fc0663..6b33f50662 100644 --- a/src/xrpld/consensus/ConsensusTypes.h +++ b/src/xrpld/consensus/ConsensusTypes.h @@ -3,10 +3,14 @@ #include #include +#include #include +#include #include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/consensus/DisputedTx.h b/src/xrpld/consensus/DisputedTx.h index ba8329714b..96df1536f5 100644 --- a/src/xrpld/consensus/DisputedTx.h +++ b/src/xrpld/consensus/DisputedTx.h @@ -4,10 +4,15 @@ #include #include +#include #include #include +#include +#include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/consensus/LedgerTrie.h b/src/xrpld/consensus/LedgerTrie.h index b11a69a641..a21eea2a8a 100644 --- a/src/xrpld/consensus/LedgerTrie.h +++ b/src/xrpld/consensus/LedgerTrie.h @@ -5,9 +5,13 @@ #include #include +#include +#include #include +#include #include #include +#include #include #include #include diff --git a/src/xrpld/consensus/Validations.h b/src/xrpld/consensus/Validations.h index d4da8a2887..a204cd0c78 100644 --- a/src/xrpld/consensus/Validations.h +++ b/src/xrpld/consensus/Validations.h @@ -5,12 +5,21 @@ #include #include #include +#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include diff --git a/src/xrpld/core/Config.h b/src/xrpld/core/Config.h index 45b36808b2..285ea7b9ac 100644 --- a/src/xrpld/core/Config.h +++ b/src/xrpld/core/Config.h @@ -1,16 +1,20 @@ #pragma once #include +#include #include #include #include #include #include #include // VFALCO Breaks levelization +#include #include #include // VFALCO FIX: This include should not be here +#include +#include #include #include #include diff --git a/src/xrpld/core/TimeKeeper.h b/src/xrpld/core/TimeKeeper.h index 8eb13e75c0..9e067759ec 100644 --- a/src/xrpld/core/TimeKeeper.h +++ b/src/xrpld/core/TimeKeeper.h @@ -4,6 +4,7 @@ #include #include +#include namespace xrpl { diff --git a/src/xrpld/overlay/Cluster.h b/src/xrpld/overlay/Cluster.h index a8c2083fbc..b3864e0fc6 100644 --- a/src/xrpld/overlay/Cluster.h +++ b/src/xrpld/overlay/Cluster.h @@ -7,9 +7,14 @@ #include #include +#include +#include #include #include +#include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/overlay/Compression.h b/src/xrpld/overlay/Compression.h index fb58bd128a..4b7493e7e6 100644 --- a/src/xrpld/overlay/Compression.h +++ b/src/xrpld/overlay/Compression.h @@ -2,6 +2,10 @@ #include #include +#include + +#include +#include namespace xrpl::compression { diff --git a/src/xrpld/overlay/Message.h b/src/xrpld/overlay/Message.h index cd21ca40c6..63aa360f92 100644 --- a/src/xrpld/overlay/Message.h +++ b/src/xrpld/overlay/Message.h @@ -4,10 +4,17 @@ #include #include -#include -#include +#include + +#include + +#include #include +#include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/overlay/Overlay.h b/src/xrpld/overlay/Overlay.h index 87c6ff132a..cc5be791a7 100644 --- a/src/xrpld/overlay/Overlay.h +++ b/src/xrpld/overlay/Overlay.h @@ -2,8 +2,12 @@ #include +#include +#include +#include #include #include +#include #include #include @@ -11,8 +15,15 @@ #include #include +#include + +#include +#include #include +#include #include +#include +#include namespace boost::asio::ssl { class context; diff --git a/src/xrpld/overlay/Peer.h b/src/xrpld/overlay/Peer.h index 0c86776030..29778b42a6 100644 --- a/src/xrpld/overlay/Peer.h +++ b/src/xrpld/overlay/Peer.h @@ -7,6 +7,12 @@ #include #include +#include +#include +#include +#include +#include + namespace xrpl { namespace Resource { diff --git a/src/xrpld/overlay/PeerSet.h b/src/xrpld/overlay/PeerSet.h index f50b7130f4..4670ec9783 100644 --- a/src/xrpld/overlay/PeerSet.h +++ b/src/xrpld/overlay/PeerSet.h @@ -4,6 +4,15 @@ #include #include +#include + +#include + +#include +#include +#include +#include + namespace xrpl { /** Supports data retrieval by managing a set of peers. diff --git a/src/xrpld/overlay/ReduceRelayCommon.h b/src/xrpld/overlay/ReduceRelayCommon.h index 2389c21f0e..243ce167f9 100644 --- a/src/xrpld/overlay/ReduceRelayCommon.h +++ b/src/xrpld/overlay/ReduceRelayCommon.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include // Blog post explaining the rationale behind reduction of flooding gossip // protocol: diff --git a/src/xrpld/overlay/Slot.h b/src/xrpld/overlay/Slot.h index 7490798787..a29020e03a 100644 --- a/src/xrpld/overlay/Slot.h +++ b/src/xrpld/overlay/Slot.h @@ -5,19 +5,33 @@ #include #include -#include +#include +#include +#include +#include #include #include #include +#include +#include #include -#include + +#include #include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include +#include namespace xrpl::reduce_relay { diff --git a/src/xrpld/overlay/Squelch.h b/src/xrpld/overlay/Squelch.h index 96d8c26f1d..0485c91c81 100644 --- a/src/xrpld/overlay/Squelch.h +++ b/src/xrpld/overlay/Squelch.h @@ -3,6 +3,7 @@ #include #include +#include #include #include diff --git a/src/xrpld/overlay/detail/ConnectAttempt.h b/src/xrpld/overlay/detail/ConnectAttempt.h index aba224d5c7..bed3f672be 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.h +++ b/src/xrpld/overlay/detail/ConnectAttempt.h @@ -1,9 +1,21 @@ #pragma once +#include #include #include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/Handshake.h b/src/xrpld/overlay/detail/Handshake.h index 3cbaa118da..6dcc06bbf1 100644 --- a/src/xrpld/overlay/detail/Handshake.h +++ b/src/xrpld/overlay/detail/Handshake.h @@ -3,8 +3,9 @@ #include #include +#include +#include #include -#include #include #include @@ -13,8 +14,9 @@ #include #include +#include #include -#include +#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/OverlayImpl.h b/src/xrpld/overlay/detail/OverlayImpl.h index 545d9eb75c..7db32c0d23 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.h +++ b/src/xrpld/overlay/detail/OverlayImpl.h @@ -3,20 +3,30 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include +#include #include #include @@ -25,14 +35,22 @@ #include #include +#include + #include #include #include +#include #include +#include #include #include #include +#include +#include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/PeerImp.h b/src/xrpld/overlay/detail/PeerImp.h index 28fb6b33a4..4a96f9a6e6 100644 --- a/src/xrpld/overlay/detail/PeerImp.h +++ b/src/xrpld/overlay/detail/PeerImp.h @@ -2,28 +2,59 @@ #include #include +#include +#include +#include +#include #include #include #include #include +#include +#include +#include #include +#include +#include +#include +#include #include +#include #include +#include +#include #include +#include #include #include +#include +#include #include +#include #include #include #include +#include + +#include + #include +#include +#include #include +#include +#include +#include #include #include +#include +#include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/ProtocolMessage.h b/src/xrpld/overlay/detail/ProtocolMessage.h index b1a30bad10..da418f8e82 100644 --- a/src/xrpld/overlay/detail/ProtocolMessage.h +++ b/src/xrpld/overlay/detail/ProtocolMessage.h @@ -5,14 +5,21 @@ #include #include -#include #include #include +#include + +#include + +#include #include +#include #include +#include #include +#include #include namespace xrpl { diff --git a/src/xrpld/overlay/detail/TrafficCount.h b/src/xrpld/overlay/detail/TrafficCount.h index cb77c2359f..b96ee022d6 100644 --- a/src/xrpld/overlay/detail/TrafficCount.h +++ b/src/xrpld/overlay/detail/TrafficCount.h @@ -1,10 +1,16 @@ #pragma once #include -#include + +#include + +#include #include +#include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/TxMetrics.h b/src/xrpld/overlay/detail/TxMetrics.h index 50df7a65cc..44cd0272ee 100644 --- a/src/xrpld/overlay/detail/TxMetrics.h +++ b/src/xrpld/overlay/detail/TxMetrics.h @@ -1,11 +1,13 @@ #pragma once #include -#include #include +#include + #include +#include #include namespace xrpl::metrics { diff --git a/src/xrpld/overlay/detail/ZeroCopyStream.h b/src/xrpld/overlay/detail/ZeroCopyStream.h index f77f266321..deccb627b9 100644 --- a/src/xrpld/overlay/detail/ZeroCopyStream.h +++ b/src/xrpld/overlay/detail/ZeroCopyStream.h @@ -6,6 +6,9 @@ #include +#include +#include + namespace xrpl { /** Implements ZeroCopyInputStream around a buffer sequence. @@ -20,7 +23,7 @@ private: using iterator = Buffers::const_iterator; using const_buffer = boost::asio::const_buffer; - google::protobuf::int64 count_ = 0; + std::int64_t count_ = 0; iterator last_; iterator first_; // Where pos_ comes from const_buffer pos_; // What Next() will return @@ -37,7 +40,7 @@ public: bool Skip(int count) override; - [[nodiscard]] google::protobuf::int64 + [[nodiscard]] std::int64_t ByteCount() const override { return count_; @@ -116,7 +119,7 @@ private: Streambuf& streambuf_; std::size_t blockSize_; - google::protobuf::int64 count_ = 0; + std::int64_t count_ = 0; std::size_t commit_ = 0; buffers_type buffers_; iterator pos_; @@ -132,7 +135,7 @@ public: void BackUp(int count) override; - [[nodiscard]] google::protobuf::int64 + [[nodiscard]] std::int64_t ByteCount() const override { return count_; diff --git a/src/xrpld/overlay/make_Overlay.h b/src/xrpld/overlay/make_Overlay.h index acd477deec..f0dfa429c0 100644 --- a/src/xrpld/overlay/make_Overlay.h +++ b/src/xrpld/overlay/make_Overlay.h @@ -1,12 +1,19 @@ #pragma once +#include #include #include #include +#include +#include +#include +#include #include +#include + namespace xrpl { Overlay::Setup diff --git a/src/xrpld/overlay/predicates.h b/src/xrpld/overlay/predicates.h index d7c2add937..2527b8c728 100644 --- a/src/xrpld/overlay/predicates.h +++ b/src/xrpld/overlay/predicates.h @@ -3,6 +3,7 @@ #include #include +#include #include namespace xrpl { diff --git a/src/xrpld/peerfinder/PeerfinderManager.h b/src/xrpld/peerfinder/PeerfinderManager.h index ec4beb2db4..d482ae7241 100644 --- a/src/xrpld/peerfinder/PeerfinderManager.h +++ b/src/xrpld/peerfinder/PeerfinderManager.h @@ -5,11 +5,20 @@ #include #include +#include #include +#include #include +#include +#include +#include +#include +#include #include +#include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/Slot.h b/src/xrpld/peerfinder/Slot.h index 289252e3fa..f43b7d1009 100644 --- a/src/xrpld/peerfinder/Slot.h +++ b/src/xrpld/peerfinder/Slot.h @@ -3,6 +3,8 @@ #include #include +#include +#include #include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/Bootcache.h b/src/xrpld/peerfinder/detail/Bootcache.h index 01ee2cad33..5384bb356a 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.h +++ b/src/xrpld/peerfinder/detail/Bootcache.h @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/src/xrpld/peerfinder/detail/Checker.h b/src/xrpld/peerfinder/detail/Checker.h index 2f324bf8b6..20687448df 100644 --- a/src/xrpld/peerfinder/detail/Checker.h +++ b/src/xrpld/peerfinder/detail/Checker.h @@ -1,12 +1,14 @@ #pragma once #include +#include #include #include #include #include +#include #include #include diff --git a/src/xrpld/peerfinder/detail/Counts.h b/src/xrpld/peerfinder/detail/Counts.h index 67b8370996..0d8bf1c56e 100644 --- a/src/xrpld/peerfinder/detail/Counts.h +++ b/src/xrpld/peerfinder/detail/Counts.h @@ -4,7 +4,12 @@ #include #include -#include +#include +#include + +#include +#include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/Fixed.h b/src/xrpld/peerfinder/detail/Fixed.h index 61df9caddb..3319994251 100644 --- a/src/xrpld/peerfinder/detail/Fixed.h +++ b/src/xrpld/peerfinder/detail/Fixed.h @@ -1,7 +1,12 @@ #pragma once +#include #include +#include +#include +#include + namespace xrpl::PeerFinder { /** Metadata for a Fixed slot. */ diff --git a/src/xrpld/peerfinder/detail/Handouts.h b/src/xrpld/peerfinder/detail/Handouts.h index 7523197c40..faadb51fd2 100644 --- a/src/xrpld/peerfinder/detail/Handouts.h +++ b/src/xrpld/peerfinder/detail/Handouts.h @@ -1,12 +1,17 @@ #pragma once +#include #include #include #include +#include #include +#include +#include #include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/Livecache.h b/src/xrpld/peerfinder/detail/Livecache.h index c5f04be90a..1dcc8f6daf 100644 --- a/src/xrpld/peerfinder/detail/Livecache.h +++ b/src/xrpld/peerfinder/detail/Livecache.h @@ -7,13 +7,27 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index b74643f7a5..7d10f7f516 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -14,14 +15,29 @@ #include #include #include +#include #include +#include +#include +#include #include +#include +#include #include +#include +#include #include #include #include +#include +#include #include +#include +#include +#include +#include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/SlotImp.h b/src/xrpld/peerfinder/detail/SlotImp.h index 0cf4d7a3c8..cf1915268f 100644 --- a/src/xrpld/peerfinder/detail/SlotImp.h +++ b/src/xrpld/peerfinder/detail/SlotImp.h @@ -4,9 +4,14 @@ #include #include +#include +#include #include +#include +#include #include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/Source.h b/src/xrpld/peerfinder/detail/Source.h index c86176911e..cf8920e056 100644 --- a/src/xrpld/peerfinder/detail/Source.h +++ b/src/xrpld/peerfinder/detail/Source.h @@ -2,8 +2,12 @@ #include +#include + #include +#include + namespace xrpl::PeerFinder { /** A static or dynamic source of peer addresses. diff --git a/src/xrpld/peerfinder/detail/SourceStrings.h b/src/xrpld/peerfinder/detail/SourceStrings.h index 156db0ce85..618970fa03 100644 --- a/src/xrpld/peerfinder/detail/SourceStrings.h +++ b/src/xrpld/peerfinder/detail/SourceStrings.h @@ -3,6 +3,8 @@ #include #include +#include +#include namespace xrpl::PeerFinder { diff --git a/src/xrpld/peerfinder/detail/Store.h b/src/xrpld/peerfinder/detail/Store.h index 347fc09b15..570dba0523 100644 --- a/src/xrpld/peerfinder/detail/Store.h +++ b/src/xrpld/peerfinder/detail/Store.h @@ -1,5 +1,11 @@ #pragma once +#include + +#include +#include +#include + namespace xrpl::PeerFinder { /** Abstract persistence for PeerFinder data. */ diff --git a/src/xrpld/peerfinder/detail/StoreSqdb.h b/src/xrpld/peerfinder/detail/StoreSqdb.h index 19cdd774b7..f868e89ff7 100644 --- a/src/xrpld/peerfinder/detail/StoreSqdb.h +++ b/src/xrpld/peerfinder/detail/StoreSqdb.h @@ -3,8 +3,17 @@ #include #include +#include +#include +#include #include +#include + +#include +#include +#include + namespace xrpl::PeerFinder { /** Database persistence for PeerFinder using SQLite */ diff --git a/src/xrpld/peerfinder/detail/Tuning.h b/src/xrpld/peerfinder/detail/Tuning.h index b4781495b8..1bf9df382e 100644 --- a/src/xrpld/peerfinder/detail/Tuning.h +++ b/src/xrpld/peerfinder/detail/Tuning.h @@ -1,6 +1,9 @@ #pragma once +#include #include +#include +#include /** Heuristically tuned constants. */ /** @{ */ diff --git a/src/xrpld/peerfinder/detail/iosformat.h b/src/xrpld/peerfinder/detail/iosformat.h index 632ac10c16..a0b9ff537a 100644 --- a/src/xrpld/peerfinder/detail/iosformat.h +++ b/src/xrpld/peerfinder/detail/iosformat.h @@ -1,5 +1,8 @@ #pragma once +#include +#include +#include #include #include #include diff --git a/src/xrpld/peerfinder/make_Manager.h b/src/xrpld/peerfinder/make_Manager.h index 846330988b..1f3f226397 100644 --- a/src/xrpld/peerfinder/make_Manager.h +++ b/src/xrpld/peerfinder/make_Manager.h @@ -2,6 +2,10 @@ #include +#include +#include +#include + #include #include diff --git a/src/xrpld/perflog/detail/PerfLogImp.cpp b/src/xrpld/perflog/detail/PerfLogImp.cpp index 5ace4d8c8b..3aa7e38ea2 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.cpp +++ b/src/xrpld/perflog/detail/PerfLogImp.cpp @@ -1,5 +1,7 @@ #include +#include + #include #include #include @@ -12,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/perflog/detail/PerfLogImp.h b/src/xrpld/perflog/detail/PerfLogImp.h index bd60912c18..88bf473554 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.h +++ b/src/xrpld/perflog/detail/PerfLogImp.h @@ -3,17 +3,23 @@ #include #include +#include +#include #include +#include #include #include #include #include -#include +#include +#include +#include #include #include #include +#include #include namespace xrpl::perf { diff --git a/src/xrpld/rpc/BookChanges.h b/src/xrpld/rpc/BookChanges.h index 45c3cf2e4b..3c10ece78f 100644 --- a/src/xrpld/rpc/BookChanges.h +++ b/src/xrpld/rpc/BookChanges.h @@ -1,13 +1,25 @@ #pragma once +#include +#include #include +#include +#include #include +#include +#include #include #include #include #include +#include +#include #include +#include +#include +#include +#include namespace json { class Value; diff --git a/src/xrpld/rpc/CTID.h b/src/xrpld/rpc/CTID.h index 781cd85e29..c2133a19b5 100644 --- a/src/xrpld/rpc/CTID.h +++ b/src/xrpld/rpc/CTID.h @@ -2,9 +2,14 @@ #include +#include +#include +#include #include -#include #include +#include +#include +#include namespace xrpl::RPC { diff --git a/src/xrpld/rpc/Context.h b/src/xrpld/rpc/Context.h index 3724ce1783..fe6bb81ce3 100644 --- a/src/xrpld/rpc/Context.h +++ b/src/xrpld/rpc/Context.h @@ -4,8 +4,14 @@ #include #include +#include +#include +#include #include +#include +#include + namespace xrpl { class Application; diff --git a/src/xrpld/rpc/DeliveredAmount.h b/src/xrpld/rpc/DeliveredAmount.h index b603fa4acd..bba045d494 100644 --- a/src/xrpld/rpc/DeliveredAmount.h +++ b/src/xrpld/rpc/DeliveredAmount.h @@ -3,8 +3,8 @@ #include #include -#include #include +#include namespace json { class Value; diff --git a/src/xrpld/rpc/GRPCHandlers.h b/src/xrpld/rpc/GRPCHandlers.h index ac419c18ee..9dc7e0b13a 100644 --- a/src/xrpld/rpc/GRPCHandlers.h +++ b/src/xrpld/rpc/GRPCHandlers.h @@ -2,9 +2,13 @@ #include -#include +#include +#include +#include +#include +#include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/MPTokenIssuanceID.h b/src/xrpld/rpc/MPTokenIssuanceID.h index 8a8f6f3d51..cb2bfd1bdc 100644 --- a/src/xrpld/rpc/MPTokenIssuanceID.h +++ b/src/xrpld/rpc/MPTokenIssuanceID.h @@ -1,9 +1,9 @@ #pragma once -#include #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/Output.h b/src/xrpld/rpc/Output.h index 1c74562842..30b5c090d7 100644 --- a/src/xrpld/rpc/Output.h +++ b/src/xrpld/rpc/Output.h @@ -2,8 +2,10 @@ #include -namespace xrpl { -namespace RPC { +#include +#include + +namespace xrpl::RPC { using Output = std::function; @@ -13,5 +15,4 @@ stringOutput(std::string& s) return [&](boost::string_ref const& b) { s.append(b.data(), b.size()); }; } -} // namespace RPC -} // namespace xrpl +} // namespace xrpl::RPC diff --git a/src/xrpld/rpc/RPCCall.h b/src/xrpld/rpc/RPCCall.h index 7a09115e42..a06eca4413 100644 --- a/src/xrpld/rpc/RPCCall.h +++ b/src/xrpld/rpc/RPCCall.h @@ -2,14 +2,17 @@ #include -#include +#include +#include #include #include +#include #include #include #include +#include #include namespace xrpl { diff --git a/src/xrpld/rpc/RPCHandler.h b/src/xrpld/rpc/RPCHandler.h index 7e57b456fc..d1cd54145d 100644 --- a/src/xrpld/rpc/RPCHandler.h +++ b/src/xrpld/rpc/RPCHandler.h @@ -1,8 +1,13 @@ #pragma once #include +#include #include +#include + +#include + namespace xrpl::RPC { struct JsonContext; diff --git a/src/xrpld/rpc/RPCSub.h b/src/xrpld/rpc/RPCSub.h index 4c0903ed3e..95206e5cf6 100644 --- a/src/xrpld/rpc/RPCSub.h +++ b/src/xrpld/rpc/RPCSub.h @@ -6,6 +6,9 @@ #include +#include +#include + namespace xrpl { /** Subscription object for JSON RPC. */ diff --git a/src/xrpld/rpc/Role.h b/src/xrpld/rpc/Role.h index d1b641f067..660fb92c7c 100644 --- a/src/xrpld/rpc/Role.h +++ b/src/xrpld/rpc/Role.h @@ -1,7 +1,9 @@ #pragma once +#include #include #include +#include #include #include #include @@ -10,7 +12,7 @@ #include #include -#include +#include #include namespace xrpl { diff --git a/src/xrpld/rpc/ServerHandler.h b/src/xrpld/rpc/ServerHandler.h index 0aac05ea44..054bec9b5b 100644 --- a/src/xrpld/rpc/ServerHandler.h +++ b/src/xrpld/rpc/ServerHandler.h @@ -2,11 +2,19 @@ #include #include +#include #include +#include +#include +#include +#include #include #include -#include +#include +#include +#include +#include // IWYU pragma: keep #include #include @@ -15,8 +23,15 @@ #include #include +#include +#include #include +#include #include +#include +#include +#include +#include #include namespace xrpl { diff --git a/src/xrpld/rpc/Status.h b/src/xrpld/rpc/Status.h index 8f7c620baa..4f15ab0242 100644 --- a/src/xrpld/rpc/Status.h +++ b/src/xrpld/rpc/Status.h @@ -1,9 +1,16 @@ #pragma once #include +#include #include #include +#include +#include +#include +#include +#include + namespace xrpl::RPC { /** Status represents the results of an operation that might fail. diff --git a/src/xrpld/rpc/detail/AccountAssets.h b/src/xrpld/rpc/detail/AccountAssets.h index 55fce62fa6..16c6087e3f 100644 --- a/src/xrpld/rpc/detail/AccountAssets.h +++ b/src/xrpld/rpc/detail/AccountAssets.h @@ -2,7 +2,11 @@ #include -#include +#include +#include +#include + +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/AssetCache.h b/src/xrpld/rpc/detail/AssetCache.h index e53bc3ff94..4b89487526 100644 --- a/src/xrpld/rpc/detail/AssetCache.h +++ b/src/xrpld/rpc/detail/AssetCache.h @@ -4,10 +4,14 @@ #include #include +#include #include -#include +#include +#include +#include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/Handler.h b/src/xrpld/rpc/detail/Handler.h index 140f421ed3..5e583aa5bb 100644 --- a/src/xrpld/rpc/detail/Handler.h +++ b/src/xrpld/rpc/detail/Handler.h @@ -1,13 +1,21 @@ #pragma once -#include #include +#include #include #include +#include +#include #include +#include +#include #include +#include +#include +#include + namespace json { class Object; } // namespace json diff --git a/src/xrpld/rpc/detail/MPT.h b/src/xrpld/rpc/detail/MPT.h index 5cf2d5490f..93c8517539 100644 --- a/src/xrpld/rpc/detail/MPT.h +++ b/src/xrpld/rpc/detail/MPT.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/PathRequest.h b/src/xrpld/rpc/detail/PathRequest.h index 372223e99f..64bc6ef181 100644 --- a/src/xrpld/rpc/detail/PathRequest.h +++ b/src/xrpld/rpc/detail/PathRequest.h @@ -1,19 +1,31 @@ #pragma once +#include #include #include +#include +#include #include +#include #include -#include +#include +#include #include -#include +#include +#include +#include +#include #include +#include +#include #include +#include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/PathRequestManager.h b/src/xrpld/rpc/detail/PathRequestManager.h index c8e272a97d..94d126ed23 100644 --- a/src/xrpld/rpc/detail/PathRequestManager.h +++ b/src/xrpld/rpc/detail/PathRequestManager.h @@ -4,7 +4,17 @@ #include #include +#include +#include +#include +#include +#include +#include + #include +#include +#include +#include #include #include diff --git a/src/xrpld/rpc/detail/Pathfinder.h b/src/xrpld/rpc/detail/Pathfinder.h index 36caab308e..5ef6c31b25 100644 --- a/src/xrpld/rpc/detail/Pathfinder.h +++ b/src/xrpld/rpc/detail/Pathfinder.h @@ -4,11 +4,25 @@ #include #include +#include +#include +#include #include -#include +#include +#include +#include #include #include #include +#include +#include + +#include +#include +#include +#include +#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/PathfinderUtils.h b/src/xrpld/rpc/detail/PathfinderUtils.h index a703127148..ad48b3e9d7 100644 --- a/src/xrpld/rpc/detail/PathfinderUtils.h +++ b/src/xrpld/rpc/detail/PathfinderUtils.h @@ -1,6 +1,10 @@ #pragma once +#include +#include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index 7e30b81fa6..e839d9d78d 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -1,5 +1,6 @@ #include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/rpc/detail/RPCHelpers.h b/src/xrpld/rpc/detail/RPCHelpers.h index bbc101a072..4a4dca42e5 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.h +++ b/src/xrpld/rpc/detail/RPCHelpers.h @@ -1,16 +1,27 @@ #pragma once -#include #include #include #include -#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include // IWYU pragma: keep #include +#include #include +#include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp index 38827dc93c..6843c34b19 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include #include @@ -20,6 +21,9 @@ #include #include +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep #include #include diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 9ec2a6673c..cbd47d38e6 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -1,17 +1,20 @@ #pragma once -#include #include #include #include +#include +#include #include -#include #include #include +#include + +#include #include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/TransactionSign.h b/src/xrpld/rpc/detail/TransactionSign.h index 1fd9e87b54..cb3fb176dc 100644 --- a/src/xrpld/rpc/detail/TransactionSign.h +++ b/src/xrpld/rpc/detail/TransactionSign.h @@ -4,9 +4,14 @@ #include #include +#include #include #include +#include +#include +#include + namespace xrpl { // Forward declarations diff --git a/src/xrpld/rpc/detail/TrustLine.h b/src/xrpld/rpc/detail/TrustLine.h index 7a0a01d744..a80d81e4ae 100644 --- a/src/xrpld/rpc/detail/TrustLine.h +++ b/src/xrpld/rpc/detail/TrustLine.h @@ -1,13 +1,18 @@ #pragma once #include -#include +#include +#include +#include +#include +#include #include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/Tuning.h b/src/xrpld/rpc/detail/Tuning.h index 12c09bcb15..5a9d546472 100644 --- a/src/xrpld/rpc/detail/Tuning.h +++ b/src/xrpld/rpc/detail/Tuning.h @@ -1,5 +1,7 @@ #pragma once +#include + /** Tuned constants. */ /** @{ */ namespace xrpl::RPC::Tuning { diff --git a/src/xrpld/rpc/detail/WSInfoSub.h b/src/xrpld/rpc/detail/WSInfoSub.h index c224b93e0e..cefb7ad2e4 100644 --- a/src/xrpld/rpc/detail/WSInfoSub.h +++ b/src/xrpld/rpc/detail/WSInfoSub.h @@ -7,8 +7,11 @@ #include #include +#include #include #include +#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/Handlers.h b/src/xrpld/rpc/handlers/Handlers.h index 2d39e42e02..7b347b2ecc 100644 --- a/src/xrpld/rpc/handlers/Handlers.h +++ b/src/xrpld/rpc/handlers/Handlers.h @@ -2,6 +2,8 @@ #include +#include + namespace xrpl { json::Value diff --git a/src/xrpld/rpc/handlers/account/AccountNFTs.cpp b/src/xrpld/rpc/handlers/account/AccountNFTs.cpp index 0249963908..5ce10f6121 100644 --- a/src/xrpld/rpc/handlers/account/AccountNFTs.cpp +++ b/src/xrpld/rpc/handlers/account/AccountNFTs.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp index 40042a0390..c2a8319876 100644 --- a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp +++ b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include #include diff --git a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsList.cpp b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsList.cpp index 95da4c8567..e0204159fd 100644 --- a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsList.cpp +++ b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsList.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include diff --git a/src/xrpld/rpc/handlers/admin/status/GetCounts.h b/src/xrpld/rpc/handlers/admin/status/GetCounts.h index 05751637ee..15cfa32a29 100644 --- a/src/xrpld/rpc/handlers/admin/status/GetCounts.h +++ b/src/xrpld/rpc/handlers/admin/status/GetCounts.h @@ -2,6 +2,8 @@ #include +#include + namespace xrpl { json::Value diff --git a/src/xrpld/rpc/handlers/ledger/Ledger.h b/src/xrpld/rpc/handlers/ledger/Ledger.h index 719e635170..59b64832f7 100644 --- a/src/xrpld/rpc/handlers/ledger/Ledger.h +++ b/src/xrpld/rpc/handlers/ledger/Ledger.h @@ -1,16 +1,18 @@ #pragma once -#include -#include #include +#include // IWYU pragma: keep #include #include #include #include +#include #include #include -#include + +#include +#include namespace json { class Object; diff --git a/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h b/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h index 11f6553dfa..57c4e58242 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h +++ b/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h @@ -2,18 +2,25 @@ #include +#include #include -#include +#include #include -#include +#include +#include +#include #include -#include -#include +#include #include #include +#include +#include #include -#include +#include +#include +#include +#include namespace xrpl::LedgerEntryHelpers { diff --git a/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp b/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp index 947a257916..abad196246 100644 --- a/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp +++ b/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp @@ -4,6 +4,7 @@ #include #include +#include // IWYU pragma: keep #include diff --git a/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp b/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp index 6a75277b1b..c1c8712655 100644 --- a/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp +++ b/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/rpc/handlers/orderbook/NFTOffersHelpers.h b/src/xrpld/rpc/handlers/orderbook/NFTOffersHelpers.h index 42b99a0009..70bc258d77 100644 --- a/src/xrpld/rpc/handlers/orderbook/NFTOffersHelpers.h +++ b/src/xrpld/rpc/handlers/orderbook/NFTOffersHelpers.h @@ -5,15 +5,25 @@ #include #include +#include +#include #include #include -#include #include +#include #include +#include +#include +#include #include +#include #include #include +#include +#include +#include + namespace xrpl { inline void diff --git a/src/xrpld/rpc/handlers/server_info/Version.h b/src/xrpld/rpc/handlers/server_info/Version.h index 1868df5d40..f25d8679ba 100644 --- a/src/xrpld/rpc/handlers/server_info/Version.h +++ b/src/xrpld/rpc/handlers/server_info/Version.h @@ -1,5 +1,12 @@ #pragma once +#include // IWYU pragma: keep +#include +#include +#include +#include + +#include #include namespace xrpl::RPC { diff --git a/src/xrpld/rpc/json_body.h b/src/xrpld/rpc/json_body.h index 5c4c56cef8..49c2b0e6e0 100644 --- a/src/xrpld/rpc/json_body.h +++ b/src/xrpld/rpc/json_body.h @@ -6,6 +6,11 @@ #include #include +#include +#include +#include +#include + namespace xrpl { /// Body that holds JSON diff --git a/src/xrpld/shamap/NodeFamily.cpp b/src/xrpld/shamap/NodeFamily.cpp index a1668e80b2..2e48117d6a 100644 --- a/src/xrpld/shamap/NodeFamily.cpp +++ b/src/xrpld/shamap/NodeFamily.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include #include diff --git a/src/xrpld/shamap/NodeFamily.h b/src/xrpld/shamap/NodeFamily.h index e0655292a0..d532f13ecc 100644 --- a/src/xrpld/shamap/NodeFamily.h +++ b/src/xrpld/shamap/NodeFamily.h @@ -2,8 +2,17 @@ #include +#include +#include +#include #include #include +#include +#include + +#include +#include +#include namespace xrpl {