mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
This commit is contained in:
@@ -6,18 +6,18 @@
|
||||
"sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1756234266.869",
|
||||
"soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1756234262.318",
|
||||
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1756234314.246",
|
||||
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1759820024.194",
|
||||
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1762797952.535",
|
||||
"re2/20230301#dfd6e2bf050eb90ddd8729cfb4c844a4%1756234257.976",
|
||||
"protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
|
||||
"openssl/3.5.4#a1d5835cc6ed5c5b8f3cd5b9b5d24205%1760106486.594",
|
||||
"nudb/2.0.9#c62cfd501e57055a7e0d8ee3d5e5427d%1756234237.107",
|
||||
"nudb/2.0.9#fb8dfd1a5557f5e0528114c2da17721e%1763150366.909",
|
||||
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
|
||||
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1756223727.64",
|
||||
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1756230911.03",
|
||||
"libarchive/3.8.1#5cf685686322e906cb42706ab7e099a8%1756234256.696",
|
||||
"jemalloc/5.3.0#e951da9cf599e956cebc117880d2d9f8%1729241615.244",
|
||||
"grpc/1.50.1#02291451d1e17200293a409410d1c4e1%1756234248.958",
|
||||
"doctest/2.4.12#eb9fb352fb2fdfc8abb17ec270945165%1749889324.069",
|
||||
"doctest/2.4.12#eb9fb352fb2fdfc8abb17ec270945165%1762797941.757",
|
||||
"date/3.0.4#f74bbba5a08fa388256688743136cb6f%1756234217.493",
|
||||
"c-ares/1.34.5#b78b91e7cfb1f11ce777a285bbf169c6%1756234217.915",
|
||||
"bzip2/1.0.8#00b4a4658791c1f06914e087f0e792f5%1756234261.716",
|
||||
@@ -53,6 +53,9 @@
|
||||
],
|
||||
"lz4/[>=1.9.4 <2]": [
|
||||
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504"
|
||||
],
|
||||
"sqlite3/3.44.2": [
|
||||
"sqlite3/3.49.1"
|
||||
]
|
||||
},
|
||||
"config_requires": []
|
||||
|
||||
@@ -66,7 +66,6 @@ XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo
|
||||
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(NegativeUNL, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
|
||||
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
|
||||
@@ -130,6 +129,7 @@ XRPL_RETIRE_FEATURE(HardenedValidations)
|
||||
XRPL_RETIRE_FEATURE(ImmediateOfferKilled)
|
||||
XRPL_RETIRE_FEATURE(MultiSign)
|
||||
XRPL_RETIRE_FEATURE(MultiSignReserve)
|
||||
XRPL_RETIRE_FEATURE(NegativeUNL)
|
||||
XRPL_RETIRE_FEATURE(NonFungibleTokensV1_1)
|
||||
XRPL_RETIRE_FEATURE(PayChan)
|
||||
XRPL_RETIRE_FEATURE(SortedDirectories)
|
||||
|
||||
@@ -1329,7 +1329,7 @@ class Vault_test : public beast::unit_test::suite
|
||||
Vault& vault) {
|
||||
auto [tx, keylet] = vault.create({.owner = owner, .asset = asset});
|
||||
testcase("insufficient fee");
|
||||
env(tx, fee(env.current()->fees().base), ter(telINSUF_FEE_P));
|
||||
env(tx, fee(env.current()->fees().base - 1), ter(telINSUF_FEE_P));
|
||||
});
|
||||
|
||||
testCase([this](
|
||||
@@ -2074,6 +2074,10 @@ class Vault_test : public beast::unit_test::suite
|
||||
auto const sleMPT = env.le(mptoken);
|
||||
BEAST_EXPECT(sleMPT == nullptr);
|
||||
|
||||
// Use one reserve so the next transaction fails
|
||||
env(ticket::create(owner, 1));
|
||||
env.close();
|
||||
|
||||
// No reserve to create MPToken for asset in VaultWithdraw
|
||||
tx = vault.withdraw(
|
||||
{.depositor = owner,
|
||||
@@ -2091,7 +2095,7 @@ class Vault_test : public beast::unit_test::suite
|
||||
}
|
||||
},
|
||||
{.requireAuth = false,
|
||||
.initialXRP = acctReserve + incReserve * 4 - 1});
|
||||
.initialXRP = acctReserve + incReserve * 4 + 1});
|
||||
|
||||
testCase([this](
|
||||
Env& env,
|
||||
@@ -2980,6 +2984,9 @@ class Vault_test : public beast::unit_test::suite
|
||||
env.le(keylet::line(owner, asset.raw().get<Issue>()));
|
||||
BEAST_EXPECT(trustline == nullptr);
|
||||
|
||||
env(ticket::create(owner, 1));
|
||||
env.close();
|
||||
|
||||
// Fail because not enough reserve to create trust line
|
||||
tx = vault.withdraw(
|
||||
{.depositor = owner,
|
||||
@@ -2995,7 +3002,7 @@ class Vault_test : public beast::unit_test::suite
|
||||
env(tx);
|
||||
env.close();
|
||||
},
|
||||
CaseArgs{.initialXRP = acctReserve + incReserve * 4 - 1});
|
||||
CaseArgs{.initialXRP = acctReserve + incReserve * 4 + 1});
|
||||
|
||||
testCase(
|
||||
[&, this](
|
||||
@@ -3016,8 +3023,7 @@ class Vault_test : public beast::unit_test::suite
|
||||
env(pay(owner, charlie, asset(100)));
|
||||
env.close();
|
||||
|
||||
// Use up some reserve on tickets
|
||||
env(ticket::create(charlie, 2));
|
||||
env(ticket::create(charlie, 3));
|
||||
env.close();
|
||||
|
||||
// Fail because not enough reserve to create MPToken for shares
|
||||
@@ -3035,7 +3041,7 @@ class Vault_test : public beast::unit_test::suite
|
||||
env(tx);
|
||||
env.close();
|
||||
},
|
||||
CaseArgs{.initialXRP = acctReserve + incReserve * 4 - 1});
|
||||
CaseArgs{.initialXRP = acctReserve + incReserve * 4 + 1});
|
||||
|
||||
testCase([&, this](
|
||||
Env& env,
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace test {
|
||||
/*
|
||||
* This file implements the following negative UNL related tests:
|
||||
* -- test filling and applying ttUNL_MODIFY Tx and ledger update
|
||||
* -- test ttUNL_MODIFY Tx failure without featureNegativeUNL amendment
|
||||
* -- test the NegativeUNLVote class. The test cases are split to multiple
|
||||
* test classes to allow parallel execution.
|
||||
* -- test the negativeUNLFilter function
|
||||
@@ -208,7 +207,7 @@ class NegativeUNL_test : public beast::unit_test::suite
|
||||
|
||||
testcase("Create UNLModify Tx and apply to ledgers");
|
||||
|
||||
jtx::Env env(*this, jtx::testable_amendments() | featureNegativeUNL);
|
||||
jtx::Env env(*this, jtx::testable_amendments());
|
||||
std::vector<PublicKey> publicKeys = createPublicKeys(3);
|
||||
// genesis ledger
|
||||
auto l = std::make_shared<Ledger>(
|
||||
@@ -216,7 +215,6 @@ class NegativeUNL_test : public beast::unit_test::suite
|
||||
env.app().config(),
|
||||
std::vector<uint256>{},
|
||||
env.app().getNodeFamily());
|
||||
BEAST_EXPECT(l->rules().enabled(featureNegativeUNL));
|
||||
|
||||
// Record the public keys and ledger sequences of expected negative UNL
|
||||
// validators when we build the ledger history
|
||||
@@ -500,44 +498,6 @@ class NegativeUNL_test : public beast::unit_test::suite
|
||||
}
|
||||
};
|
||||
|
||||
class NegativeUNLNoAmendment_test : public beast::unit_test::suite
|
||||
{
|
||||
void
|
||||
testNegativeUNLNoAmendment()
|
||||
{
|
||||
testcase("No negative UNL amendment");
|
||||
|
||||
jtx::Env env(*this, jtx::testable_amendments() - featureNegativeUNL);
|
||||
std::vector<PublicKey> publicKeys = createPublicKeys(1);
|
||||
// genesis ledger
|
||||
auto l = std::make_shared<Ledger>(
|
||||
create_genesis,
|
||||
env.app().config(),
|
||||
std::vector<uint256>{},
|
||||
env.app().getNodeFamily());
|
||||
BEAST_EXPECT(!l->rules().enabled(featureNegativeUNL));
|
||||
|
||||
// generate more ledgers
|
||||
for (auto i = 0; i < 256 - 1; ++i)
|
||||
{
|
||||
l = std::make_shared<Ledger>(
|
||||
*l, env.app().timeKeeper().closeTime());
|
||||
}
|
||||
BEAST_EXPECT(l->seq() == 256);
|
||||
auto txDisable_0 = createTx(true, l->seq(), publicKeys[0]);
|
||||
OpenView accum(&*l);
|
||||
BEAST_EXPECT(applyAndTestResult(env, accum, txDisable_0, false));
|
||||
accum.apply(*l);
|
||||
BEAST_EXPECT(negUnlSizeTest(l, 0, false, false));
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testNegativeUNLNoAmendment();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Utility class for creating validators and ledger history
|
||||
*/
|
||||
@@ -563,7 +523,7 @@ struct NetworkHistory
|
||||
};
|
||||
|
||||
NetworkHistory(beast::unit_test::suite& suite, Parameter const& p)
|
||||
: env(suite, jtx::testable_amendments() | featureNegativeUNL)
|
||||
: env(suite, jtx::testable_amendments())
|
||||
, param(p)
|
||||
, validations(env.app().getValidations())
|
||||
{
|
||||
@@ -1867,7 +1827,6 @@ class NegativeUNLVoteFilterValidations_test : public beast::unit_test::suite
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(NegativeUNL, consensus, ripple);
|
||||
BEAST_DEFINE_TESTSUITE(NegativeUNLNoAmendment, consensus, ripple);
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(NegativeUNLVoteInternal, consensus, ripple);
|
||||
BEAST_DEFINE_TESTSUITE_MANUAL(NegativeUNLVoteScoreTable, consensus, ripple);
|
||||
|
||||
@@ -19,7 +19,6 @@ Vault::create(CreateArgs const& args)
|
||||
jv[jss::TransactionType] = jss::VaultCreate;
|
||||
jv[jss::Account] = args.owner.human();
|
||||
jv[jss::Asset] = to_json(args.asset);
|
||||
jv[jss::Fee] = STAmount(env.current()->fees().increment).getJson();
|
||||
if (args.flags)
|
||||
jv[jss::Flags] = *args.flags;
|
||||
return {jv, keylet};
|
||||
|
||||
@@ -124,7 +124,8 @@ class Feature_test : public beast::unit_test::suite
|
||||
featureToName(fixRemoveNFTokenAutoTrustLine) ==
|
||||
"fixRemoveNFTokenAutoTrustLine");
|
||||
BEAST_EXPECT(featureToName(featureFlow) == "Flow");
|
||||
BEAST_EXPECT(featureToName(featureNegativeUNL) == "NegativeUNL");
|
||||
BEAST_EXPECT(
|
||||
featureToName(featureDeletableAccounts) == "DeletableAccounts");
|
||||
BEAST_EXPECT(
|
||||
featureToName(fixIncludeKeyletFields) == "fixIncludeKeyletFields");
|
||||
BEAST_EXPECT(featureToName(featureTokenEscrow) == "TokenEscrow");
|
||||
|
||||
@@ -346,9 +346,7 @@ RCLConsensus::Adaptor::onClose(
|
||||
prevLedger, validations, initialSet, j_);
|
||||
}
|
||||
}
|
||||
else if (
|
||||
prevLedger->isVotingLedger() &&
|
||||
prevLedger->rules().enabled(featureNegativeUNL))
|
||||
else if (prevLedger->isVotingLedger())
|
||||
{
|
||||
// previous ledger was a voting ledger,
|
||||
// so the current consensus session is for a flag ledger,
|
||||
@@ -1015,8 +1013,7 @@ RCLConsensus::Adaptor::preStartRound(
|
||||
inboundTransactions_.newRound(prevLgr.seq());
|
||||
|
||||
// Notify NegativeUNLVote that new validators are added
|
||||
if (prevLgr.ledger_->rules().enabled(featureNegativeUNL) &&
|
||||
!nowTrusted.empty())
|
||||
if (!nowTrusted.empty())
|
||||
nUnlVote_.newValidators(prevLgr.seq() + 1, nowTrusted);
|
||||
|
||||
// propose only if we're in sync with the network (and validating)
|
||||
|
||||
@@ -28,7 +28,7 @@ buildLedgerImpl(
|
||||
{
|
||||
auto built = std::make_shared<Ledger>(*parent, closeTime);
|
||||
|
||||
if (built->isFlagLedger() && built->rules().enabled(featureNegativeUNL))
|
||||
if (built->isFlagLedger())
|
||||
{
|
||||
built->updateNegativeUNL();
|
||||
}
|
||||
|
||||
@@ -2063,8 +2063,7 @@ NetworkOPsImp::beginConsensus(
|
||||
"ripple::NetworkOPsImp::beginConsensus : closedLedger parent matches "
|
||||
"hash");
|
||||
|
||||
if (prevLedger->rules().enabled(featureNegativeUNL))
|
||||
app_.validators().setNegativeUNL(prevLedger->negativeUNL());
|
||||
app_.validators().setNegativeUNL(prevLedger->negativeUNL());
|
||||
TrustChanges const changes = app_.validators().updateTrusted(
|
||||
app_.getValidations().getCurrentNodeIDs(),
|
||||
closingInfo.parentCloseTime,
|
||||
|
||||
@@ -51,13 +51,6 @@ Transactor::invokePreflight<Change>(PreflightContext const& ctx)
|
||||
return temBAD_SEQUENCE;
|
||||
}
|
||||
|
||||
if (ctx.tx.getTxnType() == ttUNL_MODIFY &&
|
||||
!ctx.rules.enabled(featureNegativeUNL))
|
||||
{
|
||||
JLOG(ctx.j.warn()) << "Change: NegativeUNL not enabled";
|
||||
return temDISABLED;
|
||||
}
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,13 +79,6 @@ VaultCreate::preflight(PreflightContext const& ctx)
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
XRPAmount
|
||||
VaultCreate::calculateBaseFee(ReadView const& view, STTx const& tx)
|
||||
{
|
||||
// One reserve increment is typically much greater than one base fee.
|
||||
return calculateOwnerReserveFee(view, tx);
|
||||
}
|
||||
|
||||
TER
|
||||
VaultCreate::preclaim(PreclaimContext const& ctx)
|
||||
{
|
||||
@@ -142,8 +135,9 @@ VaultCreate::doApply()
|
||||
|
||||
if (auto ter = dirLink(view(), account_, vault))
|
||||
return ter;
|
||||
adjustOwnerCount(view(), owner, 1, j_);
|
||||
auto ownerCount = owner->at(sfOwnerCount);
|
||||
// We will create Vault and PseudoAccount, hence increase OwnerCount by 2
|
||||
adjustOwnerCount(view(), owner, 2, j_);
|
||||
auto const ownerCount = owner->at(sfOwnerCount);
|
||||
if (mPriorBalance < view().fees().accountReserve(ownerCount))
|
||||
return tecINSUFFICIENT_RESERVE;
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@ public:
|
||||
static NotTEC
|
||||
preflight(PreflightContext const& ctx);
|
||||
|
||||
static XRPAmount
|
||||
calculateBaseFee(ReadView const& view, STTx const& tx);
|
||||
|
||||
static TER
|
||||
preclaim(PreclaimContext const& ctx);
|
||||
|
||||
|
||||
@@ -146,7 +146,35 @@ VaultDelete::doApply()
|
||||
return tecHAS_OBLIGATIONS; // LCOV_EXCL_LINE
|
||||
|
||||
// Destroy the pseudo-account.
|
||||
view().erase(view().peek(keylet::account(pseudoID)));
|
||||
auto vaultPseudoSLE = view().peek(keylet::account(pseudoID));
|
||||
if (!vaultPseudoSLE || vaultPseudoSLE->at(~sfVaultID) != vault->key())
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
|
||||
// Making the payment and removing the empty holding should have deleted any
|
||||
// obligations associated with the vault or vault pseudo-account.
|
||||
if (*vaultPseudoSLE->at(sfBalance))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.error()) << "VaultDelete: pseudo-account has a balance";
|
||||
return tecHAS_OBLIGATIONS;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
if (vaultPseudoSLE->at(sfOwnerCount) != 0)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.error()) << "VaultDelete: pseudo-account still owns objects";
|
||||
return tecHAS_OBLIGATIONS;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
if (view().exists(keylet::ownerDir(pseudoID)))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.error()) << "VaultDelete: pseudo-account has a directory";
|
||||
return tecHAS_OBLIGATIONS;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
view().erase(vaultPseudoSLE);
|
||||
|
||||
// Remove the vault from its owner's directory.
|
||||
auto const ownerID = vault->at(sfOwner);
|
||||
@@ -170,7 +198,9 @@ VaultDelete::doApply()
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
adjustOwnerCount(view(), owner, -1, j_);
|
||||
|
||||
// We are destroying Vault and PseudoAccount, hence decrease by 2
|
||||
adjustOwnerCount(view(), owner, -2, j_);
|
||||
|
||||
// Destroy the vault.
|
||||
view().erase(vault);
|
||||
|
||||
Reference in New Issue
Block a user