mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 14:50:54 +00:00
Merge remote-tracking branch 'upstream/release/3.3.x' into mathbunnyru/merge-3.3.0-to-develop
* upstream/release/3.3.x: (41 commits) chore: Bump version to 3.3.0 chore: Bump version to 3.3.0-rc7 fix: Increase manifest protocol message size cap and fix manifests relay fix: Cap untrusted manifests per message and drop oversized ones chore: Bump version to 3.2.1 chore: Bump version to 3.2.1-rc1 fix: Cap untrusted manifests per message and drop oversized ones fix: Reject oversized validator manifest before decoding fix: Reduce untrusted manifest cache cap to 100 fix: Bound untrusted manifest cache chore: Bump version to 3.3.0-rc6 feat: Package validator-keys inside rippled chore: Bump version to 3.3.0-rc5 fix: Switch SponsorshipSet to use a delta for sfFeeAmount fix: Re-revert "fix: Set request size limits and differential pricing for get-object-by-hash calls" chore: Bump version to 3.3.0-rc4 fix: Revert "fix: Set request size limits and differential pricing for get-object-by-hash calls" chore: Bump version to 3.3.0-rc3 fix: Reduce untrusted manifest cache cap to 100 fix: Revert "fix: Reject oversized SHAMap nodes in gotStaleData and fetch-pack path" ...
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
@@ -1866,6 +1867,103 @@ public:
|
||||
BEAST_EXPECT(same(st, stpath(gw_, ipe(xrpIssue()))));
|
||||
}
|
||||
|
||||
void
|
||||
testAssembleAddDeduplication()
|
||||
{
|
||||
testcase("STPathSet::assembleAdd deduplication — O(N^2) regression");
|
||||
|
||||
static constexpr std::string_view kAccount1 = "A3F19C7B2E5D08146FB93A7C0E2D5184BC6F3A09";
|
||||
static constexpr std::string_view kAccount2 = "1D7E4B90C2A6F3851E0B9D47A2C5F8136E0A4B7D";
|
||||
static constexpr std::string_view kAccount3 = "F08C36A1D95E27B40CA1F63E8D204B7950E1C3A6";
|
||||
static constexpr std::string_view kAccount4 = "4B6209E7F1A3C85D0E94B27Af3D6018C5A7E92B4";
|
||||
static constexpr std::string_view kAccount5 = "9E2D7041BCA3F6589D013E7B2A4C6F80159D3E7A";
|
||||
static constexpr std::string_view kAccount6 = "7C5A91E384F2D06BA19C4E73D820F516B3A9C0E4";
|
||||
static constexpr std::string_view kAccount7 = "2F8B043C6A1E9D75B0C38E14F6A2D509731BC4E8";
|
||||
static constexpr std::string_view kAccount8 = "E61D9A30F47C285BA0D31E96C7B4F802513A8D6F";
|
||||
|
||||
static constexpr AccountID kAccountID1{kAccount1};
|
||||
static constexpr AccountID kAccountID2{kAccount2};
|
||||
static constexpr AccountID kAccountID3{kAccount3};
|
||||
static constexpr AccountID kAccountID4{kAccount4};
|
||||
static constexpr AccountID kAccountID5{kAccount5};
|
||||
static constexpr AccountID kAccountID6{kAccount6};
|
||||
static constexpr AccountID kAccountID7{kAccount7};
|
||||
static constexpr AccountID kAccountID8{kAccount8};
|
||||
|
||||
auto ps = STPathSet{};
|
||||
|
||||
auto createPathElements = [](auto const& account1, auto const& account2) {
|
||||
auto base = STPath{};
|
||||
base.pushBack(
|
||||
STPathElement{STPathElement::TypeAccount, account1, xrpCurrency(), account1});
|
||||
auto tail =
|
||||
STPathElement{STPathElement::TypeAccount, account2, xrpCurrency(), account2};
|
||||
return std::make_pair(base, tail);
|
||||
};
|
||||
|
||||
{
|
||||
auto [base, tail] = createPathElements(kAccountID1, kAccountID2);
|
||||
|
||||
for (auto i = 0uz; i < 10000; ++i)
|
||||
{
|
||||
ps.assembleAdd(base, tail);
|
||||
}
|
||||
|
||||
BEAST_EXPECT(ps.size() == 1);
|
||||
}
|
||||
|
||||
{
|
||||
auto [base, tail] = createPathElements(kAccountID3, kAccountID4);
|
||||
ps.assembleAdd(base, tail);
|
||||
}
|
||||
|
||||
{
|
||||
auto [base, tail] = createPathElements(kAccountID5, kAccountID6);
|
||||
ps.assembleAdd(base, tail);
|
||||
}
|
||||
|
||||
{
|
||||
auto [base, tail] = createPathElements(kAccountID7, kAccountID8);
|
||||
|
||||
auto before = ps.size();
|
||||
|
||||
for (auto i = 0uz; i < 10000; ++i)
|
||||
{
|
||||
ps.assembleAdd(base, tail);
|
||||
}
|
||||
|
||||
BEAST_EXPECT(ps.size() - before == 1);
|
||||
}
|
||||
|
||||
{
|
||||
auto [base, tail] = createPathElements(kAccountID1, kAccountID3);
|
||||
auto copy = base;
|
||||
copy.pushBack(tail);
|
||||
|
||||
auto before = ps.size();
|
||||
|
||||
ps.pushBack(copy);
|
||||
ps.assembleAdd(base, tail);
|
||||
|
||||
BEAST_EXPECT(ps.size() - before == 1);
|
||||
}
|
||||
|
||||
{
|
||||
auto [base, tail] = createPathElements(kAccountID2, kAccountID4);
|
||||
auto copy = base;
|
||||
copy.pushBack(tail);
|
||||
|
||||
auto before = ps.size();
|
||||
|
||||
ps.emplaceBack(copy);
|
||||
ps.assembleAdd(base, tail);
|
||||
|
||||
BEAST_EXPECT(ps.size() - before == 1);
|
||||
}
|
||||
|
||||
BEAST_EXPECT(ps.size() == 6);
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
@@ -1878,6 +1976,7 @@ public:
|
||||
issuesPathNegativeRippleClientIssue23Smaller();
|
||||
issuesPathNegativeRippleClientIssue23Larger();
|
||||
qualityPathsQualitySetAndTest();
|
||||
testAssembleAddDeduplication();
|
||||
trustAutoClearTrustNormalClear();
|
||||
trustAutoClearTrustAutoClear();
|
||||
norippleCombinations();
|
||||
|
||||
Reference in New Issue
Block a user