Compare commits

..

8 Commits

Author SHA1 Message Date
Bart
0b2c50b0d2 Merge branch 'develop' into bthomee/rename_binary 2025-12-02 14:28:35 -05:00
Bart
690dced2c8 Merge branch 'develop' into bthomee/rename_binary 2025-11-14 16:52:48 -05:00
Bart
3faff9f7a6 Merge branch 'develop' into bthomee/rename_binary 2025-11-10 11:51:28 -05:00
Bart
7141781db4 Restore changes to CI pipeline undone by other PR 2025-11-10 11:47:04 -05:00
Bart
802ac5629f Merge branch 'develop' into bthomee/rename_binary 2025-11-10 11:06:01 -05:00
Bart
2f15909ffa Reverse symlink 2025-11-07 11:08:44 +00:00
Bart
9184b7274c Fix comments 2025-11-07 11:04:23 +00:00
Bart
54a19a0e8d refactor: Rename rippled binary to xrpld 2025-11-07 11:02:05 +00:00
12 changed files with 81 additions and 36 deletions

View File

@@ -26,6 +26,9 @@ run from the repository root.
references to `ripple` and `rippled` (with or without capital letters) to references to `ripple` and `rippled` (with or without capital letters) to
`xrpl` and `xrpld`, respectively. The name of the binary will remain as-is, `xrpl` and `xrpld`, respectively. The name of the binary will remain as-is,
and will only be renamed to `xrpld` by a later script. and will only be renamed to `xrpld` by a later script.
4. `.github/scripts/rename/binary.sh`: This script will rename the binary from
`rippled` to `xrpld`, and reverses the symlink so that `rippled` points to
the `xrpld` binary.
You can run all these scripts from the repository root as follows: You can run all these scripts from the repository root as follows:
@@ -33,4 +36,5 @@ You can run all these scripts from the repository root as follows:
./.github/scripts/rename/definitions.sh . ./.github/scripts/rename/definitions.sh .
./.github/scripts/rename/copyright.sh . ./.github/scripts/rename/copyright.sh .
./.github/scripts/rename/cmake.sh . ./.github/scripts/rename/cmake.sh .
./.github/scripts/rename/binary.sh .
``` ```

42
.github/scripts/rename/binary.sh vendored Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Exit the script as soon as an error occurs.
set -e
# On MacOS, ensure that GNU sed is installed and available as `gsed`.
SED_COMMAND=sed
if [[ "${OSTYPE}" == 'darwin'* ]]; then
if ! command -v gsed &> /dev/null; then
echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'."
exit 1
fi
SED_COMMAND=gsed
fi
# This script changes the binary name from `rippled` to `xrpld`, and reverses
# the symlink that currently points from `xrpld` to `rippled` so that it points
# from `rippled` to `xrpld` instead.
# Usage: .github/scripts/rename/binary.sh <repository directory>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <repository directory>"
exit 1
fi
DIRECTORY=$1
echo "Processing directory: ${DIRECTORY}"
if [ ! -d "${DIRECTORY}" ]; then
echo "Error: Directory '${DIRECTORY}' does not exist."
exit 1
fi
pushd ${DIRECTORY}
# Remove the binary name override added by the cmake.sh script.
${SED_COMMAND} -z -i -E 's@\s+# For the time being.+"rippled"\)@@' cmake/XrplCore.cmake
# Reverse the symlink.
${SED_COMMAND} -i -E 's@create_symbolic_link\(rippled@create_symbolic_link(xrpld@' cmake/XrplInstall.cmake
${SED_COMMAND} -i -E 's@/xrpld\$\{suffix\}@/rippled${suffix}@' cmake/XrplInstall.cmake
popd
echo "Processing complete."

View File

@@ -129,14 +129,14 @@ jobs:
--parallel "${BUILD_NPROC}" \ --parallel "${BUILD_NPROC}" \
--target "${CMAKE_TARGET}" --target "${CMAKE_TARGET}"
- name: Upload rippled artifact (Linux) - name: Upload the binary (Linux)
if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }} if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
env: env:
BUILD_DIR: ${{ inputs.build_dir }} BUILD_DIR: ${{ inputs.build_dir }}
with: with:
name: rippled-${{ inputs.config_name }} name: xrpld-${{ inputs.config_name }}
path: ${{ env.BUILD_DIR }}/rippled path: ${{ env.BUILD_DIR }}/xrpld
retention-days: 3 retention-days: 3
if-no-files-found: error if-no-files-found: error
@@ -144,8 +144,8 @@ jobs:
if: ${{ runner.os == 'Linux' }} if: ${{ runner.os == 'Linux' }}
working-directory: ${{ inputs.build_dir }} working-directory: ${{ inputs.build_dir }}
run: | run: |
ldd ./rippled ldd ./xrpld
if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then if [ "$(ldd ./xrpld | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
echo 'The binary is statically linked.' echo 'The binary is statically linked.'
else else
echo 'The binary is dynamically linked.' echo 'The binary is dynamically linked.'
@@ -156,7 +156,7 @@ jobs:
if: ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }} if: ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }}
working-directory: ${{ inputs.build_dir }} working-directory: ${{ inputs.build_dir }}
run: | run: |
./rippled --version | grep libvoidstar ./xrpld --version | grep libvoidstar
- name: Run the separate tests - name: Run the separate tests
if: ${{ !inputs.build_only }} if: ${{ !inputs.build_only }}
@@ -177,7 +177,7 @@ jobs:
env: env:
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }} BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
run: | run: |
./rippled --unittest --unittest-jobs "${BUILD_NPROC}" ./xrpld --unittest --unittest-jobs "${BUILD_NPROC}"
- name: Debug failure (Linux) - name: Debug failure (Linux)
if: ${{ failure() && runner.os == 'Linux' && !inputs.build_only }} if: ${{ failure() && runner.os == 'Linux' && !inputs.build_only }}

View File

@@ -25,7 +25,7 @@ jobs:
env: env:
MESSAGE: | MESSAGE: |
The dependency relationships between the modules in rippled have The dependency relationships between the modules in xrpld have
changed, which may be an improvement or a regression. changed, which may be an improvement or a regression.
A rule of thumb is that if your changes caused something to be A rule of thumb is that if your changes caused something to be

View File

@@ -25,6 +25,8 @@ jobs:
run: .github/scripts/rename/copyright.sh . run: .github/scripts/rename/copyright.sh .
- name: Check CMake configs - name: Check CMake configs
run: .github/scripts/rename/cmake.sh . run: .github/scripts/rename/cmake.sh .
- name: Check binary name
run: .github/scripts/rename/binary.sh .
- name: Check for differences - name: Check for differences
env: env:
MESSAGE: | MESSAGE: |

View File

@@ -223,6 +223,4 @@ if(xrpld)
src/test/ledger/Invariants_test.cpp src/test/ledger/Invariants_test.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE) PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
endif() endif()
# For the time being, we will keep the name of the binary as it was.
set_target_properties(xrpld PROPERTIES OUTPUT_NAME "rippled")
endif() endif()

View File

@@ -67,8 +67,8 @@ if (is_root_project AND TARGET xrpld)
install(CODE " install(CODE "
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\") set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
include(create_symbolic_link) include(create_symbolic_link)
create_symbolic_link(rippled${suffix} \ create_symbolic_link(xrpld${suffix} \
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix}) \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/rippled${suffix})
") ")
endif () endif ()

View File

@@ -1271,8 +1271,7 @@ protected:
verifyLoanStatus, verifyLoanStatus,
issuer, issuer,
lender, lender,
borrower, borrower);
PaymentParameters{.showStepBalances = true});
} }
/** Runs through the complete lifecycle of a loan /** Runs through the complete lifecycle of a loan
@@ -7194,15 +7193,15 @@ class LoanArbitrary_test : public LoanBatch_test
.vaultDeposit = 10000, .vaultDeposit = 10000,
.debtMax = 0, .debtMax = 0,
.coverRateMin = TenthBips32{0}, .coverRateMin = TenthBips32{0},
.managementFeeRate = TenthBips16{0}, // .managementFeeRate = TenthBips16{5919},
.coverRateLiquidation = TenthBips32{0}}; .coverRateLiquidation = TenthBips32{0}};
LoanParameters const loanParams{ LoanParameters const loanParams{
.account = Account("lender"), .account = Account("lender"),
.counter = Account("borrower"), .counter = Account("borrower"),
.principalRequest = Number{200000, -6}, .principalRequest = Number{10000, 0},
.interest = TenthBips32{50000}, // .interest = TenthBips32{0},
.payTotal = 2, // .payTotal = 5816,
.payInterval = 200}; .payInterval = 150};
runLoan(AssetType::XRP, brokerParams, loanParams); runLoan(AssetType::XRP, brokerParams, loanParams);
} }

View File

@@ -644,7 +644,7 @@ MPTTester::operator[](std::string const& name) const
} }
PrettyAmount PrettyAmount
MPTTester::operator()(std::int64_t amount) const MPTTester::operator()(std::uint64_t amount) const
{ {
return MPT("", issuanceID())(amount); return MPT("", issuanceID())(amount);
} }

View File

@@ -272,7 +272,7 @@ public:
operator[](std::string const& name) const; operator[](std::string const& name) const;
PrettyAmount PrettyAmount
operator()(std::int64_t amount) const; operator()(std::uint64_t amount) const;
operator Asset() const; operator Asset() const;

View File

@@ -547,14 +547,6 @@ tryOverpayment(
auto const deltas = rounded - newRounded; auto const deltas = rounded - newRounded;
// The change in loan management fee is equal to the change between the old
// and the new outstanding management fees
XRPL_ASSERT_PARTS(
deltas.managementFee ==
rounded.managementFeeDue - managementFeeOutstanding,
"ripple::detail::tryOverpayment",
"no fee change");
auto const hypotheticalValueOutstanding = auto const hypotheticalValueOutstanding =
rounded.valueOutstanding - deltas.principal; rounded.valueOutstanding - deltas.principal;
@@ -569,6 +561,7 @@ tryOverpayment(
"the loan. Ignore the overpayment"; "the loan. Ignore the overpayment";
return Unexpected(tesSUCCESS); return Unexpected(tesSUCCESS);
} }
return LoanPaymentParts{ return LoanPaymentParts{
// Principal paid is the reduction in principal outstanding // Principal paid is the reduction in principal outstanding
.principalPaid = deltas.principal, .principalPaid = deltas.principal,
@@ -683,6 +676,12 @@ doOverpayment(
"ripple::detail::doOverpayment", "ripple::detail::doOverpayment",
"principal change agrees"); "principal change agrees");
XRPL_ASSERT_PARTS(
overpaymentComponents.trackedManagementFeeDelta ==
managementFeeOutstandingProxy - managementFeeOutstanding,
"ripple::detail::doOverpayment",
"no fee change");
// I'm not 100% sure the following asserts are correct. If in doubt, and // I'm not 100% sure the following asserts are correct. If in doubt, and
// everything else works, remove any that cause trouble. // everything else works, remove any that cause trouble.
@@ -713,6 +712,13 @@ doOverpayment(
"ripple::detail::doOverpayment", "ripple::detail::doOverpayment",
"principal payment matches"); "principal payment matches");
XRPL_ASSERT_PARTS(
loanPaymentParts.feePaid ==
overpaymentComponents.untrackedManagementFee +
overpaymentComponents.trackedManagementFeeDelta,
"ripple::detail::doOverpayment",
"fee payment matches");
// All validations passed, so update the proxy objects (which will // All validations passed, so update the proxy objects (which will
// modify the actual Loan ledger object) // modify the actual Loan ledger object)
totalValueOutstandingProxy = totalValueOutstanding; totalValueOutstandingProxy = totalValueOutstanding;

View File

@@ -305,13 +305,7 @@ LoanPay::doApply()
// change will be discarded. // change will be discarded.
if (loanSle->isFlag(lsfLoanImpaired)) if (loanSle->isFlag(lsfLoanImpaired))
{ {
if (auto const ret =
LoanManage::unimpairLoan(view, loanSle, vaultSle, j_); LoanManage::unimpairLoan(view, loanSle, vaultSle, j_);
ret != tesSUCCESS)
{
JLOG(j_.fatal()) << "Failed to unimpair loan before payment.";
return ret; // LCOV_EXCL_LINE
}
} }
LoanPaymentType const paymentType = [&tx]() { LoanPaymentType const paymentType = [&tx]() {