Compare commits

...

4 Commits

Author SHA1 Message Date
Bart
15997b6683 Add AI tool file to .gitignore 2025-11-05 15:01:54 +00:00
Bart
f909d954ee Merge branch 'develop' into bthomee/git 2025-11-05 15:00:57 +00:00
Jingchen
673fb06c75 refactor: Retire fixTrustLinesToSelf amendment (#5989)
Amendments activated for more than 2 years can be retired. This change retires the fixTrustLinesToSelf amendment.
2025-11-05 14:56:20 +00:00
Bart
e6d3238fb1 Clean up .gitignore and .gitattributes 2025-11-05 08:04:56 +00:00
8 changed files with 32 additions and 213 deletions

4
.gitattributes vendored
View File

@@ -1,10 +1,6 @@
# Set default behaviour, in case users don't have core.autocrlf set.
#* text=auto
# These annoying files
rippled.1 binary
LICENSE binary
# Visual Studio
*.sln text eol=crlf
*.vcproj text eol=crlf

105
.gitignore vendored
View File

@@ -1,69 +1,42 @@
# .gitignore
bin/boostbook_catalog.xml
bin/config.log
bin/project-cache.jam
# Ignore vim swap files.
*.swp
# Ignore SCons support files.
.sconsign.dblite
# Ignore python compiled files.
*.pyc
# Ignore Macintosh Desktop Services Store files.
# Macintosh Desktop Services Store files.
.DS_Store
# Ignore backup/temps
# Build, intermediate, and temporary artifacts.
*~
# Ignore object files.
*.o
.nih_c
tags
TAGS
GTAGS
GRTAGS
GPATH
bin/rippled
Debug/*.*
Release/*.*
*.pdb
*.swp
.clangd
Debug/
Release/
/.build/
/build/
/db/
/out.txt
/tmp/
CMakeSettings.json
CMakeUserPresets.json
# Ignore coverage files.
# Coverage files.
*.gcno
*.gcda
*.gcov
# Levelization checking
# Profiling data.
gmon.out
# Levelization data.
.github/scripts/levelization/results/*
!.github/scripts/levelization/results/loops.txt
!.github/scripts/levelization/results/ordering.txt
# Ignore tmp directory.
tmp
# Ignore database directory.
db/
db/*.db
db/*.db-*
# Ignore debug logs
debug_log.txt
# Ignore customized configs
# Customized configs.
rippled.cfg
validators.txt
# Doxygen generated documentation output
HtmlDocumentation
docs/html_doc
# Xcode user-specific project settings
# Xcode
.DS_Store
/build/
# XCode IDE.
*.pbxuser
!default.pbxuser
*.mode1v3
@@ -76,38 +49,14 @@ xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
# Intel Parallel Studio 2013 XE
My Amplifier XE Results - RippleD
# JetBrains IDE.
/.idea/
# Compiler intermediate output
/out.txt
# Build Log
rippled-build.log
# Profiling data
gmon.out
Builds/VisualStudio2015/*.db
Builds/VisualStudio2015/*.user
Builds/VisualStudio2015/*.opendb
Builds/VisualStudio2015/*.sdf
# MSVC
*.pdb
# Microsoft Visual Studio IDE.
.vs/
CMakeSettings.json
compile_commands.json
.clangd
packages
pkg_out
pkg
CMakeUserPresets.json
bld.rippled/
.vscode
.vscode/
# Suggested in-tree build directory
/.build*/
# AI tools.
.augment

3
docs/.gitignore vendored
View File

@@ -1,3 +0,0 @@
html
temp
out.txt

View File

@@ -62,7 +62,6 @@ XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (TrustLinesToSelf, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(ExpandedSignerList, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(CheckCashMakesTrustLine, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
@@ -119,6 +118,7 @@ XRPL_RETIRE(fixReducedOffersV1)
XRPL_RETIRE(fixRmSmallIncreasedQOffers)
XRPL_RETIRE(fixSTAmountCanonicalize)
XRPL_RETIRE(fixTakerDryOfferRemoval)
XRPL_RETIRE(fixTrustLinesToSelf)
XRPL_RETIRE(CryptoConditions)
XRPL_RETIRE(Escrow)
XRPL_RETIRE(EnforceInvariants)

View File

@@ -121,7 +121,8 @@ class Feature_test : public beast::unit_test::suite
// Test a random sampling of the variables. If any of these get retired
// or removed, swap out for any other feature.
BEAST_EXPECT(
featureToName(fixTrustLinesToSelf) == "fixTrustLinesToSelf");
featureToName(fixRemoveNFTokenAutoTrustLine) ==
"fixRemoveNFTokenAutoTrustLine");
BEAST_EXPECT(featureToName(featureFlow) == "Flow");
BEAST_EXPECT(featureToName(featureNegativeUNL) == "NegativeUNL");
BEAST_EXPECT(

View File

@@ -147,88 +147,6 @@ Change::preCompute()
account_ == beast::zero, "ripple::Change::preCompute : zero account");
}
void
Change::activateTrustLinesToSelfFix()
{
JLOG(j_.warn()) << "fixTrustLinesToSelf amendment activation code starting";
auto removeTrustLineToSelf = [this](Sandbox& sb, uint256 id) {
auto tl = sb.peek(keylet::child(id));
if (tl == nullptr)
{
JLOG(j_.warn()) << id << ": Unable to locate trustline";
return true;
}
if (tl->getType() != ltRIPPLE_STATE)
{
JLOG(j_.warn()) << id << ": Unexpected type "
<< static_cast<std::uint16_t>(tl->getType());
return true;
}
auto const& lo = tl->getFieldAmount(sfLowLimit);
auto const& hi = tl->getFieldAmount(sfHighLimit);
if (lo != hi)
{
JLOG(j_.warn()) << id << ": Trustline doesn't meet requirements";
return true;
}
if (auto const page = tl->getFieldU64(sfLowNode); !sb.dirRemove(
keylet::ownerDir(lo.getIssuer()), page, tl->key(), false))
{
JLOG(j_.error()) << id << ": failed to remove low entry from "
<< toBase58(lo.getIssuer()) << ":" << page
<< " owner directory";
return false;
}
if (auto const page = tl->getFieldU64(sfHighNode); !sb.dirRemove(
keylet::ownerDir(hi.getIssuer()), page, tl->key(), false))
{
JLOG(j_.error()) << id << ": failed to remove high entry from "
<< toBase58(hi.getIssuer()) << ":" << page
<< " owner directory";
return false;
}
if (tl->getFlags() & lsfLowReserve)
adjustOwnerCount(
sb, sb.peek(keylet::account(lo.getIssuer())), -1, j_);
if (tl->getFlags() & lsfHighReserve)
adjustOwnerCount(
sb, sb.peek(keylet::account(hi.getIssuer())), -1, j_);
sb.erase(tl);
JLOG(j_.warn()) << "Successfully deleted trustline " << id;
return true;
};
using namespace std::literals;
Sandbox sb(&view());
if (removeTrustLineToSelf(
sb,
uint256{
"2F8F21EFCAFD7ACFB07D5BB04F0D2E18587820C7611305BB674A64EAB0FA71E1"sv}) &&
removeTrustLineToSelf(
sb,
uint256{
"326035D5C0560A9DA8636545DD5A1B0DFCFF63E68D491B5522B767BB00564B1A"sv}))
{
JLOG(j_.warn()) << "fixTrustLinesToSelf amendment activation code "
"executed successfully";
sb.apply(ctx_.rawView());
}
}
TER
Change::applyAmendment()
{
@@ -305,9 +223,6 @@ Change::applyAmendment()
amendments.push_back(amendment);
amendmentObject->setFieldV256(sfAmendments, amendments);
if (amendment == fixTrustLinesToSelf)
activateTrustLinesToSelfFix();
ctx_.app.getAmendmentTable().enable(amendment);
if (!ctx_.app.getAmendmentTable().isSupported(amendment))

View File

@@ -29,9 +29,6 @@ public:
preclaim(PreclaimContext const& ctx);
private:
void
activateTrustLinesToSelfFix();
TER
applyAmendment();

View File

@@ -195,29 +195,8 @@ SetTrust::preclaim(PreclaimContext const& ctx)
auto const currency = saLimitAmount.getCurrency();
auto const uDstAccountID = saLimitAmount.getIssuer();
if (ctx.view.rules().enabled(fixTrustLinesToSelf))
{
if (id == uDstAccountID)
return temDST_IS_SRC;
}
else
{
if (id == uDstAccountID)
{
// Prevent trustline to self from being created,
// unless one has somehow already been created
// (in which case doApply will clean it up).
auto const sleDelete =
ctx.view.read(keylet::line(id, uDstAccountID, currency));
if (!sleDelete)
{
JLOG(ctx.j.trace())
<< "Malformed transaction: Can not extend credit to self.";
return temDST_IS_SRC;
}
}
}
if (id == uDstAccountID)
return temDST_IS_SRC;
// This might be nullptr
auto const sleDst = ctx.view.read(keylet::account(uDstAccountID));
@@ -403,21 +382,6 @@ SetTrust::doApply()
auto viewJ = ctx_.app.journal("View");
// Trust lines to self are impossible but because of the old bug there
// are two on 19-02-2022. This code was here to allow those trust lines
// to be deleted. The fixTrustLinesToSelf fix amendment will remove them
// when it enables so this code will no longer be needed.
if (!view().rules().enabled(fixTrustLinesToSelf) &&
account_ == uDstAccountID)
{
return trustDelete(
view(),
view().peek(keylet::line(account_, uDstAccountID, currency)),
account_,
uDstAccountID,
viewJ);
}
SLE::pointer sleDst = view().peek(keylet::account(uDstAccountID));
if (!sleDst)