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 145 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 109 commits
Commits
Show all changes
145 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
e8b8a57
[fold] remove inner batch open view
dangell7 Dec 6, 2024
bd3a133
testing
dangell7 Dec 6, 2024
9b8c69d
[fold] add early return
dangell7 Dec 16, 2024
175ad0b
refactor
dangell7 Dec 16, 2024
38365b5
remove fee from outer batch
dangell7 Dec 17, 2024
ca5cf6e
Merge branch 'develop' into feature-batch
dangell7 Jan 3, 2025
3fc6aab
fix fee
dangell7 Jan 3, 2025
4d7de85
remove comments
dangell7 Jan 3, 2025
3444dcf
clang-format
dangell7 Jan 3, 2025
71ca218
[fold] fix issue
dangell7 Jan 3, 2025
3b132f9
[fold] add batch preflight
dangell7 Jan 3, 2025
9b413fc
[fold] remove batch execution test checks
dangell7 Jan 3, 2025
187fffc
[fold] fix tests
dangell7 Jan 3, 2025
98b83e8
[fold] fix universal flag
dangell7 Jan 3, 2025
76c1675
[fold] remove assert
dangell7 Jan 3, 2025
9960cbd
[fold] windows issue
dangell7 Jan 6, 2025
f2891f8
[fold] fix windows issue
dangell7 Jan 6, 2025
c388d49
[fold] add better trace logs
dangell7 Jan 8, 2025
813cbac
[revert] bad refactor
dangell7 Jan 8, 2025
d385958
[fold] add batch.preflight test
dangell7 Jan 8, 2025
f1764df
[fold] set router flag
dangell7 Jan 8, 2025
3c3169f
[fold] remove unused `e`
dangell7 Jan 8, 2025
75268c3
[fold] remove unused function
dangell7 Jan 8, 2025
a532496
[fold] remove rules check on canonical sig
dangell7 Jan 8, 2025
3a9a4b7
[fold] flags
dangell7 Jan 9, 2025
ef49db7
[fold] refactor msig
dangell7 Jan 9, 2025
0e1cfa8
[fold] add `validateBatch` to tests
dangell7 Jan 9, 2025
5bd400f
[fold] bad refactor
dangell7 Jan 9, 2025
a47a052
[fold] clang-format
dangell7 Jan 9, 2025
6c9e3b1
[fold] fix TER error response
dangell7 Jan 9, 2025
c6df6cd
[fold] add batch comment
dangell7 Jan 9, 2025
b7b6b8a
[fold] fix `tfBatchMask`
dangell7 Jan 9, 2025
97cce91
[fold] fix signature check on inner batch txn
dangell7 Jan 9, 2025
3dcd2a1
[fold] clang-format
dangell7 Jan 9, 2025
28b00bb
Merge branch 'develop' into feature-batch
dangell7 Jan 9, 2025
137b188
[merge] update feature number
dangell7 Jan 9, 2025
689660d
[fold] rename `sfBatchTransactionID` to `sfParentBatchID`
dangell7 Jan 9, 2025
0d41341
[fold] allow `AccountDelete` in batch
dangell7 Jan 9, 2025
07f6d6b
[fold] add comment
dangell7 Jan 10, 2025
2041dca
[fold] add extra inner txn validation
dangell7 Jan 10, 2025
e95c6c2
[fold] add regular key tests
dangell7 Jan 10, 2025
0d41b48
[fold] misc review fixes
dangell7 Jan 10, 2025
893b116
[fold] clang-format
dangell7 Jan 10, 2025
27e84dc
[fold] remove `sfTransactionIDs`
dangell7 Jan 10, 2025
a1ebf0b
[fold] clang-format
dangell7 Jan 10, 2025
89ee58e
[fold] rename rpc error `temINVALID_FLAG`
dangell7 Jan 11, 2025
971c848
[fold] add pseudo txn
dangell7 Jan 11, 2025
aadb21a
[fold] clang-format
dangell7 Jan 11, 2025
ae26673
Merge branch 'develop' into feature-batch
dangell7 Jan 11, 2025
c120902
[merge] bump feature #
dangell7 Jan 11, 2025
c2ca91c
[merge] fix bad merge
dangell7 Jan 11, 2025
c84166e
[fold] add missing signers validation
dangell7 Jan 11, 2025
accc8e0
[fold] refactor preflight
dangell7 Jan 12, 2025
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
20 changes: 20 additions & 0 deletions include/xrpl/basics/StringUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,26 @@ to_uint64(std::string const& s);
bool
isProperlyFormedTomlDomain(std::string_view domain);

template <
mvadari marked this conversation as resolved.
Show resolved Hide resolved
typename T,
typename = std::void_t<
std::enable_if_t<!std::is_convertible_v<T, std::string_view>>,
std::enable_if_t<std::is_convertible_v<
decltype(std::declval<T const&>().data()),
std::string_view::const_pointer>>,
std::enable_if_t<std::is_convertible_v<
decltype(std::declval<T const&>().size()),
std::string_view::size_type>>>>
bool
isProperlyFormedTomlDomain(T const& domain)
{
if (domain.data() == nullptr || domain.size() == 0)
return false;

return isProperlyFormedTomlDomain(
std::string_view{domain.data(), domain.size()});
}

} // namespace ripple

#endif
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(std::uint32_t(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
3 changes: 3 additions & 0 deletions include/xrpl/protocol/Protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ std::size_t constexpr maxPriceScale = 20;
*/
std::size_t constexpr maxTrim = 25;

/** The maximum number of transactions that can be in a batch. */
std::size_t constexpr maxBatchTxCount = 8;

} // namespace ripple

#endif
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(
mvadari marked this conversation as resolved.
Show resolved Hide resolved
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
26 changes: 13 additions & 13 deletions 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 @@ -343,7 +343,7 @@ enum TECcodes : TERUnderlyingType {
tecARRAY_EMPTY = 190,
tecARRAY_TOO_LARGE = 191,
tecLOCKED = 192,
tecBAD_CREDENTIALS = 193,
tecBAD_CREDENTIALS = 193
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -629,37 +629,37 @@ using TER = TERSubset<CanCvtToTER>;
//------------------------------------------------------------------------------

inline bool
isTelLocal(TER x)
isTelLocal(TER x) noexcept
{
return ((x) >= telLOCAL_ERROR && (x) < temMALFORMED);
return (x >= telLOCAL_ERROR && x < temMALFORMED);
}

inline bool
isTemMalformed(TER x)
isTemMalformed(TER x) noexcept
{
return ((x) >= temMALFORMED && (x) < tefFAILURE);
return (x >= temMALFORMED && x < tefFAILURE);
}

inline bool
isTefFailure(TER x)
isTefFailure(TER x) noexcept
{
return ((x) >= tefFAILURE && (x) < terRETRY);
return (x >= tefFAILURE && x < terRETRY);
}

inline bool
isTerRetry(TER x)
isTerRetry(TER x) noexcept
{
return ((x) >= terRETRY && (x) < tesSUCCESS);
return (x >= terRETRY && x < tesSUCCESS);
}

inline bool
isTesSuccess(TER x)
isTesSuccess(TER x) noexcept
{
return ((x) == tesSUCCESS);
return (x == tesSUCCESS);
}

inline bool
isTecClaim(TER x)
isTecClaim(TER x) noexcept
{
return ((x) >= tecCLAIM);
}
Expand Down
19 changes: 16 additions & 3 deletions include/xrpl/protocol/TxFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ namespace ripple {
// clang-format off
// Universal Transaction flags:
constexpr std::uint32_t tfFullyCanonicalSig = 0x80000000;
constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig;
constexpr std::uint32_t tfUniversalMask = ~tfUniversal;
constexpr std::uint32_t tfInnerBatchTxn = 0x40000000;
constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig | tfInnerBatchTxn;
constexpr std::uint32_t tfUniversalMask = ~(tfFullyCanonicalSig | tfInnerBatchTxn);

// AccountSet flags:
constexpr std::uint32_t tfRequireDestTag = 0x00010000;
Expand Down Expand Up @@ -97,6 +98,7 @@ constexpr std::uint32_t tfPassive = 0x00010000;
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);

Expand Down Expand Up @@ -181,7 +183,7 @@ constexpr std::uint32_t const tfNFTokenCreateOfferMask =
~(tfUniversal | tfSellNFToken);

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

// NFTokenAcceptOffer flags:
constexpr std::uint32_t const tfNFTokenAcceptOfferMask = ~tfUniversal;
Expand Down Expand Up @@ -214,6 +216,17 @@ constexpr std::uint32_t tfAMMClawbackMask = ~(tfUniversal | tfClawTwoAssets);
// BridgeModify flags:
constexpr std::uint32_t tfClearAccountCreateAmount = 0x00010000;
constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreateAmount);

// Batch Flags:
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 =
~(tfUniversal | tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent);
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
constexpr std::uint32_t const tfBatchSubTx =
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent;

// clang-format on

} // namespace ripple
Expand Down
12 changes: 11 additions & 1 deletion include/xrpl/protocol/TxMeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,20 @@ class TxMeta
CtorHelper);

public:
TxMeta(uint256 const& transactionID, std::uint32_t ledger);
TxMeta(
uint256 const& transactionID,
std::uint32_t ledger,
std::optional<uint256> batchId = std::nullopt);
TxMeta(uint256 const& txID, std::uint32_t ledger, Blob const&);
TxMeta(uint256 const& txID, std::uint32_t ledger, std::string const&);
TxMeta(uint256 const& txID, std::uint32_t ledger, STObject const&);

std::optional<uint256 const> const&
getBatchId() const
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
{
return mBatchId;
}

uint256 const&
getTxID() const
{
Expand Down Expand Up @@ -135,6 +144,7 @@ class TxMeta
int mResult;

std::optional<STAmount> mDelivered;
std::optional<uint256 const> const mBatchId;

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 @@ -29,6 +29,7 @@
// If you add an amendment here, then do not forget to increment `numFeatures`
// in include/xrpl/protocol/Feature.h.

XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Credentials, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(AMMClawback, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMv1_2, Supported::yes, VoteBehavior::DefaultNo)
Expand Down
6 changes: 6 additions & 0 deletions include/xrpl/protocol/detail/sfields.macro
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ TYPED_SFIELD(sfHookStateKey, UINT256, 30)
TYPED_SFIELD(sfHookHash, UINT256, 31)
TYPED_SFIELD(sfHookNamespace, UINT256, 32)
TYPED_SFIELD(sfHookSetTxnID, UINT256, 33)
TYPED_SFIELD(sfBatchTransactionID, UINT256, 34)

// number (common)
TYPED_SFIELD(sfNumber, NUMBER, 1)
Expand Down Expand Up @@ -294,6 +295,7 @@ TYPED_SFIELD(sfHashes, VECTOR256, 2)
TYPED_SFIELD(sfAmendments, VECTOR256, 3)
TYPED_SFIELD(sfNFTokenOffers, VECTOR256, 4)
TYPED_SFIELD(sfCredentialIDs, VECTOR256, 5)
TYPED_SFIELD(sfTransactionIDs, VECTOR256, 6)

// path set
UNTYPED_SFIELD(sfPaths, PATHSET, 1)
Expand Down Expand Up @@ -346,6 +348,8 @@ 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(sfBatchSigner, OBJECT, 35)

// array of objects (common)
// ARRAY/1 is reserved for end of array
Expand Down Expand Up @@ -375,3 +379,5 @@ UNTYPED_SFIELD(sfPriceDataSeries, ARRAY, 24)
UNTYPED_SFIELD(sfAuthAccounts, ARRAY, 25)
UNTYPED_SFIELD(sfAuthorizeCredentials, ARRAY, 26)
UNTYPED_SFIELD(sfUnauthorizeCredentials, ARRAY, 27)
UNTYPED_SFIELD(sfRawTransactions, ARRAY, 28)
UNTYPED_SFIELD(sfBatchSigners, ARRAY, 29)
7 changes: 6 additions & 1 deletion 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. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit:

Suggested change
/** This transaction type wraps inner transactions for batch. */
/** This transaction type batches together transactions. */

TRANSACTION(ttBATCH, 61, Batch, ({
{sfRawTransactions, soeREQUIRED},
{sfTransactionIDs, soeREQUIRED},
Copy link
Collaborator

@mvadari mvadari Jan 8, 2025

Choose a reason for hiding this comment

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

As discussed, we can remove this field

{sfBatchSigners, soeOPTIONAL},
}))

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

Expand Down Expand Up @@ -483,4 +489,3 @@ TRANSACTION(ttUNL_MODIFY, 102, UNLModify, ({
{sfLedgerSequence, soeREQUIRED},
{sfUNLModifyValidator, soeREQUIRED},
}))

2 changes: 2 additions & 0 deletions include/xrpl/protocol/jss.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ JSS(PriceDataSeries); // field.
JSS(PriceData); // field.
JSS(Provider); // field.
JSS(QuoteAsset); // in: Oracle.
JSS(RawTransaction); // in: Batch
JSS(RawTransactions); // in: Batch
JSS(SLE_hit_rate); // out: GetCounts.
JSS(Scale); // field.
JSS(SettleDelay); // in: TransactionSign
Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/basics/StringUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ to_uint64(std::string const& s)
}

bool
isProperlyFormedTomlDomain(std::string_view domain)
isProperlyFormedTomlDomain(std::string_view const domain)
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
{
// The domain must be between 4 and 128 characters long
if (domain.size() < 4 || domain.size() > 128)
Expand Down
7 changes: 7 additions & 0 deletions src/libxrpl/protocol/InnerObjectFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ InnerObjectFormats::InnerObjectFormats()
{sfIssuer, soeREQUIRED},
{sfCredentialType, soeREQUIRED},
});

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

InnerObjectFormats const&
Expand Down
Loading
Loading