Skip to content

Commit

Permalink
Merge branch 'develop' into patch-ctid
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 authored Oct 5, 2023
2 parents 9575307 + 4e84ad6 commit 67af70e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 47 deletions.
8 changes: 6 additions & 2 deletions API-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ This version is supported by all `rippled` versions. At time of writing, it is t

#### V1 account_info response

In [the response to the `account_info` command](https://xrpl.org/account_info.html#response-format), there is `account_data` - which is supposed to be an `AccountRoot` object - and `signer_lists` is in this object. However, the docs say that `signer_lists` should be at the root level of the reponse - and this makes sense, since signer lists are not part of the AccountRoot object. (First reported in [xrpl-dev-portal#938](https://github.com/XRPLF/xrpl-dev-portal/issues/938).) Thanks to [rippled#3770](https://github.com/XRPLF/rippled/pull/3770), this field will be moved in `api_version: 2`, to the root level of the response.
In [the response to the `account_info` command](https://xrpl.org/account_info.html#response-format), there is `account_data` - which is supposed to be an `AccountRoot` object - and `signer_lists` is returned in this object. However, the docs say that `signer_lists` should be at the root level of the reponse.

It makes sense for `signer_lists` to be at the root level because signer lists are not part of the AccountRoot object. (First reported in [xrpl-dev-portal#938](https://github.com/XRPLF/xrpl-dev-portal/issues/938).)

In `api_version: 2`, the `signer_lists` field [will be moved](#modifications-to-account_info-response-in-v2) to the root level of the account_info response. (https://github.com/XRPLF/rippled/pull/3770)

#### server_info - network_id

Expand Down Expand Up @@ -108,7 +112,7 @@ Currently (prior to the release of 2.0), it is available as a "beta" version, me
1
```

Since `api_version` 2 is in "beta", breaking changes can be made at any time.
Since `api_version` 2 is in "beta", breaking changes to V2 can currently be made at any time.

#### Modifications to account_info response in V2

Expand Down
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The [minimum compiler versions][2] required are:

| Compiler | Version |
|-------------|---------|
| GCC | 10 |
| GCC | 11 |
| Clang | 13 |
| Apple Clang | 13.1.6 |
| MSVC | 19.23 |
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Your report should include the following:
- The steps to reproduce the vulnerability;
- Any other relevant details or artifacts, including code, scripts or patches.

In your mail, please describe of the issue or the potential threat; if possible, please include a "repro" (code that can reproduce the issue) or describe the best way to reproduce and replicate the issue. Please make your report as extensive as possible.
In your email, please describe the issue or potential threat. If possible, include a "repro" (code that can reproduce the issue) or describe the best way to reproduce and replicate the issue. Please make your report as detailed and comprehensive as possible.

For more information on responsible disclosure, please read this [Wikipedia article](https://en.wikipedia.org/wiki/Responsible_disclosure).

Expand Down
12 changes: 7 additions & 5 deletions src/ripple/app/rdb/impl/UnitaryShard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ updateLedgerDBs(

auto const sParentHash{to_string(ledger->info().parentHash)};
auto const sDrops{to_string(ledger->info().drops)};
auto const closingTime{
ledger->info().closeTime.time_since_epoch().count()};
auto const prevClosingTime{
ledger->info().parentCloseTime.time_since_epoch().count()};
auto const closeTimeRes{ledger->info().closeTimeResolution.count()};
auto const sAccountHash{to_string(ledger->info().accountHash)};
auto const sTxHash{to_string(ledger->info().txHash)};

Expand All @@ -190,11 +195,8 @@ updateLedgerDBs(
":closingTime, :prevClosingTime, :closeTimeRes,"
":closeFlags, :accountSetHash, :transSetHash);",
soci::use(sHash), soci::use(ledgerSeq), soci::use(sParentHash),
soci::use(sDrops),
soci::use(ledger->info().closeTime.time_since_epoch().count()),
soci::use(
ledger->info().parentCloseTime.time_since_epoch().count()),
soci::use(ledger->info().closeTimeResolution.count()),
soci::use(sDrops), soci::use(closingTime),
soci::use(prevClosingTime), soci::use(closeTimeRes),
soci::use(ledger->info().closeFlags), soci::use(sAccountHash),
soci::use(sTxHash);

Expand Down
7 changes: 4 additions & 3 deletions src/ripple/app/rdb/impl/Wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,20 @@ insertPeerReservation(
PublicKey const& nodeId,
std::string const& description)
{
auto const sNodeId = toBase58(TokenType::NodePublic, nodeId);
session << "INSERT INTO PeerReservations (PublicKey, Description) "
"VALUES (:nodeId, :desc) "
"ON CONFLICT (PublicKey) DO UPDATE SET "
"Description=excluded.Description",
soci::use(toBase58(TokenType::NodePublic, nodeId)),
soci::use(description);
soci::use(sNodeId), soci::use(description);
}

void
deletePeerReservation(soci::session& session, PublicKey const& nodeId)
{
auto const sNodeId = toBase58(TokenType::NodePublic, nodeId);
session << "DELETE FROM PeerReservations WHERE PublicKey = :nodeId",
soci::use(toBase58(TokenType::NodePublic, nodeId));
soci::use(sNodeId);
}

bool
Expand Down
54 changes: 19 additions & 35 deletions src/ripple/protocol/impl/TxFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,26 @@ namespace ripple {

TxFormats::TxFormats()
{
#pragma push_macro("PSEUDO_TXN_COMMON_FIELDS")

// clang-format off

#define PSEUDO_TXN_COMMON_FIELDS \
{sfTransactionType, soeREQUIRED}, \
{sfFlags, soeOPTIONAL}, \
{sfSourceTag, soeOPTIONAL}, \
{sfAccount, soeREQUIRED}, \
{sfSequence, soeREQUIRED}, \
{sfPreviousTxnID, soeOPTIONAL}, /* emulate027 */ \
{sfLastLedgerSequence, soeOPTIONAL}, \
{sfAccountTxnID, soeOPTIONAL}, \
{sfFee, soeREQUIRED}, \
{sfOperationLimit, soeOPTIONAL}, \
{sfMemos, soeOPTIONAL}, \
{sfSigningPubKey, soeREQUIRED}, \
{sfTxnSignature, soeOPTIONAL}, \
{sfSigners, soeOPTIONAL}, /* submit_multisigned */ \
{sfNetworkID, soeOPTIONAL}

// clang-format on

// Fields shared by all pseudo-transaction txFormats:
static const std::initializer_list<SOElement> pseudoCommonFields{
PSEUDO_TXN_COMMON_FIELDS,
};

// Fields shared by all normal transaction txFormats:
// Fields shared by all txFormats:
static const std::initializer_list<SOElement> commonFields{
PSEUDO_TXN_COMMON_FIELDS,
{sfTransactionType, soeREQUIRED},
{sfFlags, soeOPTIONAL},
{sfSourceTag, soeOPTIONAL},
{sfAccount, soeREQUIRED},
{sfSequence, soeREQUIRED},
{sfPreviousTxnID, soeOPTIONAL}, // emulate027
{sfLastLedgerSequence, soeOPTIONAL},
{sfAccountTxnID, soeOPTIONAL},
{sfFee, soeREQUIRED},
{sfOperationLimit, soeOPTIONAL},
{sfMemos, soeOPTIONAL},
{sfSigningPubKey, soeREQUIRED},
{sfTicketSequence, soeOPTIONAL},
{sfTxnSignature, soeOPTIONAL},
{sfSigners, soeOPTIONAL}, // submit_multisigned
{sfNetworkID, soeOPTIONAL},
};

#pragma pop_macro("PSEUDO_TXN_COMMON_FIELDS")

add(jss::AccountSet,
ttACCOUNT_SET,
{
Expand Down Expand Up @@ -223,7 +207,7 @@ TxFormats::TxFormats()
{sfLedgerSequence, soeREQUIRED},
{sfAmendment, soeREQUIRED},
},
pseudoCommonFields);
commonFields);

add(jss::SetFee,
ttFEE,
Expand All @@ -239,7 +223,7 @@ TxFormats::TxFormats()
{sfReserveBaseDrops, soeOPTIONAL},
{sfReserveIncrementDrops, soeOPTIONAL},
},
pseudoCommonFields);
commonFields);

add(jss::UNLModify,
ttUNL_MODIFY,
Expand All @@ -248,7 +232,7 @@ TxFormats::TxFormats()
{sfLedgerSequence, soeREQUIRED},
{sfUNLModifyValidator, soeREQUIRED},
},
pseudoCommonFields);
commonFields);

add(jss::TicketCreate,
ttTICKET_CREATE,
Expand Down

0 comments on commit 67af70e

Please sign in to comment.