Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch Amendment #5060

Open
wants to merge 92 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
879aba5
featureBatch rough draft
dangell7 Jul 10, 2024
46fd68f
clang-format
dangell7 Jul 10, 2024
c57ace7
add atomic swap
dangell7 Jul 17, 2024
91d9909
Merge branch 'develop' into feature-batch
dangell7 Jul 17, 2024
f37377d
add batch `bsig`
dangell7 Jul 17, 2024
b3136a2
[fold] clang-format
dangell7 Jul 17, 2024
5e919eb
[fold] remove `tapRETRY`
dangell7 Jul 27, 2024
1225a61
[fold] remove comments
dangell7 Jul 27, 2024
304ff3e
[fold] fix invariant workaround
dangell7 Jul 27, 2024
aded948
[fold] fix applyTransaction workaround
dangell7 Jul 27, 2024
82d4943
[fold] remove test template
dangell7 Jul 27, 2024
eaf7893
[fold] update logging
dangell7 Jul 27, 2024
ca39807
[fold] remove log
dangell7 Jul 27, 2024
dd71073
clang-format
dangell7 Jul 27, 2024
26518a5
[fold] remove workaround
dangell7 Jul 27, 2024
3ceb05c
update atomic
dangell7 Jul 30, 2024
12324f1
refactor & OpenView `revert()`
dangell7 Jul 31, 2024
e9f045b
[fold] clang-format
dangell7 Jul 31, 2024
51ed234
Merge branch 'develop' into feature-batch
dangell7 Jul 31, 2024
676b9b6
[fold] add revert
dangell7 Jul 31, 2024
6c6180d
[fold] clang-format
dangell7 Jul 31, 2024
bd03ea3
[revert] remove rawRevert func
dangell7 Aug 1, 2024
c0e00b0
refactor with stacking views
dangell7 Aug 3, 2024
a3e15a1
clang-format
dangell7 Aug 3, 2024
14eef60
Merge branch 'develop' into feature-batch
dangell7 Aug 3, 2024
70e9931
[temp] invariant workaround
dangell7 Aug 3, 2024
c693b8f
update fields
dangell7 Aug 3, 2024
418836c
reject batch txn on submit
dangell7 Aug 3, 2024
fe09972
clang-format
dangell7 Aug 3, 2024
a72b070
add tests
dangell7 Aug 3, 2024
0a45c16
[fold] remove unused code
dangell7 Aug 5, 2024
2a0b9d4
include batch execution in tec failures
dangell7 Aug 5, 2024
3a9963a
atomic revert on non tec failures
dangell7 Aug 5, 2024
2c3c5c4
fix sequence & fee
dangell7 Aug 9, 2024
a54a570
Merge branch 'develop' into feature-batch
dangell7 Aug 9, 2024
3ab585b
clang-format
dangell7 Aug 9, 2024
26ee555
previousFields + nested views + signers
dangell7 Sep 5, 2024
0d5242e
clang-format
dangell7 Sep 5, 2024
51990ff
Merge branch 'develop' into feature-batch
dangell7 Sep 5, 2024
ff7fa26
add `sfBatchResult`
dangell7 Sep 5, 2024
ae5abf5
Merge branch 'develop' into feature-batch
dangell7 Sep 10, 2024
a78da6a
ticket sequence
dangell7 Sep 10, 2024
d3a2554
fix metadata
dangell7 Sep 10, 2024
e099e03
fix metadata
dangell7 Sep 10, 2024
84a69ef
fix metadata
dangell7 Sep 10, 2024
f9fe787
update tests
dangell7 Sep 10, 2024
0deea74
clang-format
dangell7 Sep 10, 2024
9266676
remove unused variable
dangell7 Sep 10, 2024
3fff4ca
rename func/field names
dangell7 Sep 10, 2024
ecfc64b
clang-format
dangell7 Sep 10, 2024
096f4bf
[fold] remove log
dangell7 Sep 10, 2024
122368f
Merge branch 'develop' into feature-batch
dangell7 Sep 12, 2024
274660b
add sfTxIDs and update signing
dangell7 Sep 18, 2024
04c5bde
clang-format
dangell7 Sep 18, 2024
e4a5c52
Merge branch 'develop' into feature-batch
dangell7 Sep 18, 2024
659e705
[fixup] rerun actions
dangell7 Sep 18, 2024
597e7fe
[fixup] remove comments
dangell7 Sep 18, 2024
639f8b7
fix no account
dangell7 Sep 22, 2024
75fd76b
clang-format
dangell7 Sep 22, 2024
2925a5d
Merge branch 'develop' into feature-batch
dangell7 Sep 24, 2024
1367e03
Merge branch 'develop' into feature-batch
dangell7 Oct 1, 2024
f185d38
[fold] remove comment
dangell7 Oct 30, 2024
767a88e
[fold] update headers
dangell7 Oct 30, 2024
ee03811
[fold] change error response text
dangell7 Oct 30, 2024
9d8368d
[fold] change flags bit
dangell7 Oct 30, 2024
b408b80
[fold] fix formatting
dangell7 Oct 30, 2024
27d4685
[fold] normal consequences
dangell7 Oct 30, 2024
419b14d
[fold] refactor single/multi sign
dangell7 Oct 30, 2024
6c87e70
[fold] review comments
dangell7 Oct 31, 2024
a75cf0e
[fold] clang-format
dangell7 Oct 31, 2024
e6021bf
[fold] tickets are not chronological
dangell7 Oct 31, 2024
fd0acb7
[fold] fix fee calculation
dangell7 Oct 31, 2024
8a6d6ce
Merge branch 'develop' into feature-batch
dangell7 Oct 31, 2024
dd77e03
[fold] fix merge issues
dangell7 Oct 31, 2024
6cb23e3
[fold] clang-format
dangell7 Oct 31, 2024
88c40e4
[fold] addressing review
dangell7 Nov 6, 2024
e4cb784
[fold] change sequence handling
dangell7 Nov 7, 2024
47120ac
[fixup] rename `prevFields` -> `batchPrevAcctRootFields`
dangell7 Nov 7, 2024
6ed4ac8
[fold] revert applyFlags change
dangell7 Nov 7, 2024
52f1ba9
[fold] use `unordered_set`
dangell7 Nov 7, 2024
1978fd3
Merge branch 'develop' into feature-batch
dangell7 Nov 7, 2024
6ffe349
[fold] clang-format
dangell7 Nov 7, 2024
04519e6
[fold] fix bad merge
dangell7 Nov 7, 2024
8029c30
[fold] address review
dangell7 Nov 11, 2024
7e60777
[fold] add quorum and out of order test
dangell7 Nov 18, 2024
403599b
[fold] add view change test
dangell7 Nov 18, 2024
d18e9b3
[fold] update to spec (BatchExecution)
dangell7 Nov 18, 2024
afe58ab
[fold] add test
dangell7 Nov 18, 2024
aec8268
[fold] add comments for Transactor.reset()
dangell7 Nov 18, 2024
086e6b0
[fold] add/update tests
dangell7 Nov 18, 2024
2ea9fe6
[fold] add tests
dangell7 Nov 18, 2024
776aabc
[fold] apply open view on open and closed
dangell7 Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions include/xrpl/protocol/Batch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2024 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================

#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/STVector256.h>
#include <xrpl/protocol/Serializer.h>

namespace ripple {

inline void
serializeBatch(
Serializer& msg,
std::uint32_t const& flags,
STVector256 const& txids)
{
msg.add32(HashPrefix::batch);
msg.add32(flags);
msg.add32(txids.size());
for (auto const& txid : txids)
msg.addBitString(txid);
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
}

} // namespace ripple
2 changes: 1 addition & 1 deletion include/xrpl/protocol/Feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace detail {
// Feature.cpp. Because it's only used to reserve storage, and determine how
// large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than
// the actual number of amendments. A LogicError on startup will verify this.
static constexpr std::size_t numFeatures = 83;
static constexpr std::size_t numFeatures = 84;

/** Amendments that this server supports and the default voting behavior.
Whether they are enabled depends on the Rules defined in the validated
Expand Down
3 changes: 3 additions & 0 deletions include/xrpl/protocol/HashPrefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ enum class HashPrefix : std::uint32_t {

/** Credentials signature */
credential = detail::make_hash_prefix('C', 'R', 'D'),

/** Batch */
batch = detail::make_hash_prefix('B', 'C', 'H'),
};

template <class Hasher>
Expand Down
17 changes: 17 additions & 0 deletions include/xrpl/protocol/STTx.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,16 @@ class STTx final : public STObject, public CountedObject<STTx>
@return `true` if valid signature. If invalid, the error message string.
*/
enum class RequireFullyCanonicalSig : bool { no, yes };

Expected<void, std::string>
checkSign(RequireFullyCanonicalSig requireCanonicalSig, Rules const& rules)
const;

Expected<void, std::string>
checkBatchSign(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why add these to STTx instead of having the code in Batch.cpp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because they were so similar to the other functionality. I can move them. Is this preferred?

RequireFullyCanonicalSig requireCanonicalSig,
Rules const& rules) const;

// SQL Functions with metadata.
static std::string const&
getMetaSQLInsertReplaceHeader();
Expand All @@ -148,6 +154,17 @@ class STTx final : public STObject, public CountedObject<STTx>
RequireFullyCanonicalSig requireCanonicalSig,
Rules const& rules) const;

Expected<void, std::string>
checkBatchSingleSign(
STObject const& batchSigner,
RequireFullyCanonicalSig requireCanonicalSig) const;

Expected<void, std::string>
checkBatchMultiSign(
STObject const& batchSigner,
RequireFullyCanonicalSig requireCanonicalSig,
Rules const& rules) const;

STBase*
copy(std::size_t n, void* buf) const override;
STBase*
Expand Down
3 changes: 2 additions & 1 deletion include/xrpl/protocol/TER.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ enum TEMcodes : TERUnderlyingType {

temARRAY_EMPTY,
temARRAY_TOO_LARGE,

temBAD_TRANSFER_FEE,
temINVALID_BATCH,
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -344,6 +344,7 @@ enum TECcodes : TERUnderlyingType {
tecARRAY_TOO_LARGE = 191,
tecLOCKED = 192,
tecBAD_CREDENTIALS = 193,
tecBATCH_FAILURE = 194
};

//------------------------------------------------------------------------------
Expand Down
51 changes: 32 additions & 19 deletions include/xrpl/protocol/TxFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ namespace ripple {
// clang-format off
// Universal Transaction flags:
constexpr std::uint32_t tfFullyCanonicalSig = 0x80000000;
constexpr std::uint32_t tfInnerBatchTxn = 0x40000000;
constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig;
constexpr std::uint32_t tfUniversalMask = ~tfUniversal;
constexpr std::uint32_t tfUniversalV2 = tfFullyCanonicalSig | tfInnerBatchTxn;
constexpr std::uint32_t tfUniversalMask = ~(tfFullyCanonicalSig | tfInnerBatchTxn);
Comment on lines +63 to +64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
constexpr std::uint32_t tfUniversalV2 = tfFullyCanonicalSig | tfInnerBatchTxn;
constexpr std::uint32_t tfUniversalMask = ~(tfFullyCanonicalSig | tfInnerBatchTxn);
constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig | tfInnerBatchTxn;
constexpr std::uint32_t tfUniversalMask = ~(tfFullyCanonicalSig | tfInnerBatchTxn);

we can prob add tfInnerBatchTxn into tfUniversal directly, and check in Transactor::preflight1 if tfInnerBatchTxn is usable


// AccountSet flags:
constexpr std::uint32_t tfRequireDestTag = 0x00010000;
Expand All @@ -69,7 +71,7 @@ constexpr std::uint32_t tfOptionalAuth = 0x00080000;
constexpr std::uint32_t tfDisallowXRP = 0x00100000;
constexpr std::uint32_t tfAllowXRP = 0x00200000;
constexpr std::uint32_t tfAccountSetMask =
~(tfUniversal | tfRequireDestTag | tfOptionalDestTag | tfRequireAuth |
~(tfUniversalV2 | tfRequireDestTag | tfOptionalDestTag | tfRequireAuth |
tfOptionalAuth | tfDisallowXRP | tfAllowXRP);

// AccountSet SetFlag/ClearFlag values
Expand Down Expand Up @@ -98,15 +100,15 @@ constexpr std::uint32_t tfImmediateOrCancel = 0x00020000;
constexpr std::uint32_t tfFillOrKill = 0x00040000;
constexpr std::uint32_t tfSell = 0x00080000;
constexpr std::uint32_t tfOfferCreateMask =
~(tfUniversal | tfPassive | tfImmediateOrCancel | tfFillOrKill | tfSell);
~(tfUniversalV2 | tfPassive | tfImmediateOrCancel | tfFillOrKill | tfSell);

// Payment flags:
constexpr std::uint32_t tfNoRippleDirect = 0x00010000;
constexpr std::uint32_t tfPartialPayment = 0x00020000;
constexpr std::uint32_t tfLimitQuality = 0x00040000;
constexpr std::uint32_t tfPaymentMask =
~(tfUniversal | tfPartialPayment | tfLimitQuality | tfNoRippleDirect);
constexpr std::uint32_t tfMPTPaymentMask = ~(tfUniversal | tfPartialPayment);
~(tfUniversalV2 | tfPartialPayment | tfLimitQuality | tfNoRippleDirect);
constexpr std::uint32_t tfMPTPaymentMask = ~(tfUniversalV2 | tfPartialPayment);

// TrustSet flags:
constexpr std::uint32_t tfSetfAuth = 0x00010000;
Expand All @@ -115,7 +117,7 @@ constexpr std::uint32_t tfClearNoRipple = 0x00040000;
constexpr std::uint32_t tfSetFreeze = 0x00100000;
constexpr std::uint32_t tfClearFreeze = 0x00200000;
constexpr std::uint32_t tfTrustSetMask =
~(tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze |
~(tfUniversalV2 | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze |
tfClearFreeze);

// EnableAmendment flags:
Expand All @@ -125,7 +127,7 @@ constexpr std::uint32_t tfLostMajority = 0x00020000;
// PaymentChannelClaim flags:
constexpr std::uint32_t tfRenew = 0x00010000;
constexpr std::uint32_t tfClose = 0x00020000;
constexpr std::uint32_t tfPayChanClaimMask = ~(tfUniversal | tfRenew | tfClose);
constexpr std::uint32_t tfPayChanClaimMask = ~(tfUniversalV2 | tfRenew | tfClose);

// NFTokenMint flags:
constexpr std::uint32_t const tfBurnable = 0x00000001;
Expand All @@ -142,16 +144,16 @@ constexpr std::uint32_t const tfMPTCanTrade = lsfMPTCanTrade;
constexpr std::uint32_t const tfMPTCanTransfer = lsfMPTCanTransfer;
constexpr std::uint32_t const tfMPTCanClawback = lsfMPTCanClawback;
constexpr std::uint32_t const tfMPTokenIssuanceCreateMask =
~(tfUniversal | tfMPTCanLock | tfMPTRequireAuth | tfMPTCanEscrow | tfMPTCanTrade | tfMPTCanTransfer | tfMPTCanClawback);
~(tfUniversalV2 | tfMPTCanLock | tfMPTRequireAuth | tfMPTCanEscrow | tfMPTCanTrade | tfMPTCanTransfer | tfMPTCanClawback);

// MPTokenAuthorize flags:
constexpr std::uint32_t const tfMPTUnauthorize = 0x00000001;
constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversal | tfMPTUnauthorize);
constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversalV2 | tfMPTUnauthorize);

// MPTokenIssuanceSet flags:
constexpr std::uint32_t const tfMPTLock = 0x00000001;
constexpr std::uint32_t const tfMPTUnlock = 0x00000002;
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversalV2 | tfMPTLock | tfMPTUnlock);

// MPTokenIssuanceDestroy flags:
constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask = ~tfUniversal;
Expand All @@ -170,24 +172,24 @@ constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask = ~tfUniversal;
// tfTrustLine flag as a way to prevent the attack. But until the
// amendment passes we still need to keep the old behavior available.
constexpr std::uint32_t const tfNFTokenMintOldMask =
~(tfUniversal | tfBurnable | tfOnlyXRP | tfTrustLine | tfTransferable);
~(tfUniversalV2 | tfBurnable | tfOnlyXRP | tfTrustLine | tfTransferable);

constexpr std::uint32_t const tfNFTokenMintMask =
~(tfUniversal | tfBurnable | tfOnlyXRP | tfTransferable);
~(tfUniversalV2 | tfBurnable | tfOnlyXRP | tfTransferable);

// NFTokenCreateOffer flags:
constexpr std::uint32_t const tfSellNFToken = 0x00000001;
constexpr std::uint32_t const tfNFTokenCreateOfferMask =
~(tfUniversal | tfSellNFToken);
~(tfUniversalV2 | tfSellNFToken);

// NFTokenCancelOffer flags:
constexpr std::uint32_t const tfNFTokenCancelOfferMask = ~(tfUniversal);
constexpr std::uint32_t const tfNFTokenCancelOfferMask = ~tfUniversalV2;

// NFTokenAcceptOffer flags:
constexpr std::uint32_t const tfNFTokenAcceptOfferMask = ~tfUniversal;
constexpr std::uint32_t const tfNFTokenAcceptOfferMask = ~tfUniversalV2;

// Clawback flags:
constexpr std::uint32_t const tfClawbackMask = ~tfUniversal;
constexpr std::uint32_t const tfClawbackMask = ~tfUniversalV2;

// AMM Flags:
constexpr std::uint32_t tfLPToken = 0x00010000;
Expand All @@ -204,16 +206,27 @@ constexpr std::uint32_t tfWithdrawSubTx =
constexpr std::uint32_t tfDepositSubTx =
tfLPToken | tfSingleAsset | tfTwoAsset | tfOneAssetLPToken |
tfLimitLPToken | tfTwoAssetIfEmpty;
constexpr std::uint32_t tfWithdrawMask = ~(tfUniversal | tfWithdrawSubTx);
constexpr std::uint32_t tfDepositMask = ~(tfUniversal | tfDepositSubTx);
constexpr std::uint32_t tfWithdrawMask = ~(tfUniversalV2 | tfWithdrawSubTx);
constexpr std::uint32_t tfDepositMask = ~(tfUniversalV2 | tfDepositSubTx);

// AMMClawback flags:
constexpr std::uint32_t tfClawTwoAssets = 0x00000001;
constexpr std::uint32_t tfAMMClawbackMask = ~(tfUniversal | tfClawTwoAssets);

// BridgeModify flags:
constexpr std::uint32_t tfClearAccountCreateAmount = 0x00010000;
constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreateAmount);
constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversalV2 | tfClearAccountCreateAmount);

// Batch Flags
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
constexpr std::uint32_t tfAllOrNothing = 0x00010000;
constexpr std::uint32_t tfOnlyOne = 0x00020000;
constexpr std::uint32_t tfUntilFailure = 0x00040000;
constexpr std::uint32_t tfIndependent = 0x00080000;
constexpr std::uint32_t const tfBatchMask =
~(tfUniversalV2 | tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent);
constexpr std::uint32_t const tfBatchSubTx =
tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent;

// clang-format on

} // namespace ripple
Expand Down
19 changes: 19 additions & 0 deletions include/xrpl/protocol/TxMeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,32 @@ class TxMeta
return static_cast<bool>(mDelivered);
}

STArray const&
getBatchExecutions() const
{
return *mBatchExecutions;
}

void
setBatchExecutions(STArray const& batchExecutions)
{
mBatchExecutions = batchExecutions;
}

bool
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
hasBatchExecutions() const
{
return static_cast<bool>(mBatchExecutions);
}

private:
uint256 mTransactionID;
std::uint32_t mLedger;
std::uint32_t mIndex;
int mResult;

std::optional<STAmount> mDelivered;
std::optional<STArray> mBatchExecutions;

STArray mNodes;
};
Expand Down
1 change: 1 addition & 0 deletions include/xrpl/protocol/detail/features.macro
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ XRPL_FEATURE(AMMClawback, Supported::yes, VoteBehavior::DefaultNo
XRPL_FIX (AMMv1_2, Supported::yes, VoteBehavior::DefaultNo)
// InvariantsV1_1 will be changes to Supported::yes when all the
// invariants expected to be included under it are complete.
XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(MPTokensV1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(InvariantsV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (NFTokenPageLinks, Supported::yes, VoteBehavior::DefaultNo)
Expand Down
8 changes: 8 additions & 0 deletions include/xrpl/protocol/detail/sfields.macro
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ TYPED_SFIELD(sfAssetClass, VL, 28)
TYPED_SFIELD(sfProvider, VL, 29)
TYPED_SFIELD(sfMPTokenMetadata, VL, 30)
TYPED_SFIELD(sfCredentialType, VL, 31)
TYPED_SFIELD(sfInnerResult, VL, 32)

// account (common)
TYPED_SFIELD(sfAccount, ACCOUNT, 1)
Expand Down Expand Up @@ -291,6 +292,7 @@ TYPED_SFIELD(sfHashes, VECTOR256, 2)
TYPED_SFIELD(sfAmendments, VECTOR256, 3)
TYPED_SFIELD(sfNFTokenOffers, VECTOR256, 4)
TYPED_SFIELD(sfCredentialIDs, VECTOR256, 5)
TYPED_SFIELD(sfTxIDs, VECTOR256, 6)

// path set
UNTYPED_SFIELD(sfPaths, PATHSET, 1)
Expand Down Expand Up @@ -343,6 +345,9 @@ UNTYPED_SFIELD(sfXChainClaimAttestationCollectionElement, OBJECT, 30)
UNTYPED_SFIELD(sfXChainCreateAccountAttestationCollectionElement, OBJECT, 31)
UNTYPED_SFIELD(sfPriceData, OBJECT, 32)
UNTYPED_SFIELD(sfCredential, OBJECT, 33)
UNTYPED_SFIELD(sfRawTransaction, OBJECT, 34)
UNTYPED_SFIELD(sfBatchExecution, OBJECT, 35)
UNTYPED_SFIELD(sfBatchSigner, OBJECT, 36)

// array of objects (common)
// ARRAY/1 is reserved for end of array
Expand Down Expand Up @@ -372,3 +377,6 @@ UNTYPED_SFIELD(sfPriceDataSeries, ARRAY, 24)
UNTYPED_SFIELD(sfAuthAccounts, ARRAY, 25)
UNTYPED_SFIELD(sfAuthorizeCredentials, ARRAY, 26)
UNTYPED_SFIELD(sfUnauthorizeCredentials, ARRAY, 27)
UNTYPED_SFIELD(sfBatchExecutions, ARRAY, 28)
UNTYPED_SFIELD(sfRawTransactions, ARRAY, 29)
UNTYPED_SFIELD(sfBatchSigners, ARRAY, 30)
6 changes: 6 additions & 0 deletions include/xrpl/protocol/detail/transactions.macro
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ TRANSACTION(ttCREDENTIAL_DELETE, 60, CredentialDelete, ({
{sfCredentialType, soeREQUIRED},
}))

/** This transaction type wraps inner transactions for batch. */
TRANSACTION(ttBATCH, 61, Batch, ({
{sfRawTransactions, soeREQUIRED},
{sfTxIDs, soeREQUIRED},
{sfBatchSigners, soeOPTIONAL},
}))

/** This system-generated transaction type is used to update the status of the various amendments.

Expand Down
2 changes: 2 additions & 0 deletions include/xrpl/protocol/jss.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ JSS(PriceData); // field.
JSS(Provider); // field.
JSS(QuoteAsset); // in: Oracle.
JSS(RippleState); // ledger type.
JSS(RawTransaction); // in: Batch
JSS(RawTransactions); // in: Batch
JSS(SLE_hit_rate); // out: GetCounts.
JSS(Scale); // field.
JSS(SettleDelay); // in: TransactionSign
Expand Down
13 changes: 13 additions & 0 deletions src/libxrpl/protocol/InnerObjectFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ InnerObjectFormats::InnerObjectFormats()
{sfIssuer, soeREQUIRED},
{sfCredentialType, soeREQUIRED},
});

add(sfBatchExecution.jsonName.c_str(),
sfBatchExecution.getCode(),
{{sfTransactionType, soeREQUIRED},
{sfInnerResult, soeREQUIRED},
{sfTransactionHash, soeOPTIONAL}});

add(sfBatchSigner.jsonName.c_str(),
sfBatchSigner.getCode(),
{{sfAccount, soeREQUIRED},
{sfSigningPubKey, soeOPTIONAL},
{sfTxnSignature, soeOPTIONAL},
{sfSigners, soeOPTIONAL}});
}

InnerObjectFormats const&
Expand Down
Loading
Loading