- Compute the next "true" state, round the values off, then compute the
deltas needed to get the current state to that state. Plus some data
integrity checks.
- Add `Number::zero`, which is longer to type, but more readable than
`Number{}`.
- Prepare to improve Loan unit tests: track managementFeeRate in
BrokerInfo, define a LoanParameters object for creation options and
start adding support for it, track and verify loan state while making
payments.
- Addresses FIND-013 from audit.
- Bases the limit on the current ledger time, and ensures that
"payments * interval <= limit". This allows a loan to potentially run through
"the end of time" successfully, but not go a second over.
- Wrote several test cases, including a few that go right to "the end of
time".
- FIND-005, FIND-009, and FIND-010.
- Add the finding number to existing tests - FIND-001, FIND-003,
FIND-012, FIND-007.
- Tweak the interest rate failure log messages in LoanSet.
- Addresses FIND-005 from audit.
- Tuning values defined in Protocol.h. Optimal values TBD.
- loanPaymentsPerFeeIncrement: calculateBaseFee estimates the number
of payments included in the Amount and charges
"baseFee * number / loanPaymentsPerFeeIncrement".
- loanMaximumPaymentsPerTransaction: If the number of payments
(including overpayments if applicable) hits this limit, stop
processing more payments, but DO NOT FAIL.
- Fix the rounding in LoanSet for Guard 4 (sufficient computed payments)
- Tweak several test parameters to account for the new limits.
- Change payment component rounding for IOUs to "towards_zero".
- Add some safety limits to loan calculations to prevent nonsensical
values.
- Addresses FIND-006 from audit.
- Removes the "minimum" check for sfLoanOriginationFee, and replaces it
with a "valid range" check with the max value being
sfPrincipalRequested.
- Reuses the test from the report, with some modifications.
- Also adds some more test cases for existing interest rate tests.
- Changes:
1. Removed the `AssetType` template parameter from all functions in
favor of just using the `Asset` class.
2. Fully moved all `ripple::detail` functions from .h to .cpp.
3. Moved all definitions of non `detail` functions from .h to .cpp,
except roundPeriodicPayment, just because it's small and I want it
to be visible. Left declarations in .h
4. Moved `PaymentSpecialCase`, `PaymentComponents` and
`computePaymentComponents` into `detail` and updated references.
- This is an intermediate commit. It leaves the old variables in place,
so I can do verifications that the new computations are correct. They
will be removed in the next commit.
- PaymentComponents is an class used internally to break a payment value
into principal, interest, and fees.
- Adds a check to the MPToken creation invariant to ensure none are created for the issuer.
- `addEmptyHolding()` will return success without doing anything for these scenarios. There is nothing to do, as with XRP.
---------
Co-authored-by: Ed Hennis <ed@ripple.com>
The `-Wno-missing-template-arg-list-after-template-kw` flag is only needed for the grpc library. Use `+=` for the default build flags to make it easier to extend in the future.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
- Renamed canSendToAccount to canWithdraw, because the semantics are
a little different from a payment. Notably, if withdrawing to self,
you can still include a destination tag.
- Simplified the interface to canWithdraw to just pass in the
STTx.
- preflightDestinationAndTag is pretty pointless now, so removed it.
- canSendToAccount will check if a destination tag is required _before_
checking if the sender is the destination. This is the original
VaultWithdraw behavior, and I want to stay consistent.
- Correct interest rounding calculation
- Fix some comments
- Don't explicitly break out of the multiple payment loop for the final
payment. Assert that it will exit by the loop condition.
- Fix LoanSet.calculateBaseFee with multisign.
- Cleanups.
- Add View helper functions for Loan and Vault transactions
- preflightDestinationAndTag
- checkDestinationAndTag
- canSendToAccount
- Used the helpers in appropriate Loan and Vault transactions.
- They could also be used in older transactions, I'll save that for
later.
Amendments activated for more than 2 years can be retired. This change retires the fix1515 amendment.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
- Implement a new helper accountCanSend, which is like accountHolds, but
returns a meaningful value for issuers, and will include the available
credit on the other side of a trust line. (The sfHighLimit or
sfLowLimit as appropriate.)
- Use this new helper when checking the available balance in LoanPay.
- Loan scale is completely irrelevant to integral types (XRP, MPT), and
the field is "soeDEFAULT", so when set to 0, it won't be stored on
ledger, saving a little bit of space.
- Move management fee calculations out of transactors an into the
appropriate functions in LendingHelpers.h.
- Rewrite how overpayments are handled. May changed based on numerical
analysis.
- Update, fix, and clean up unit tests. Includes adding tolerances for
some checks where an exact match is unlikely.
- Add "integral()" function to Asset to simplify a common check.
As XRPL network demand grows and ledger sizes increase, the default 4K NuDB block size becomes a performance bottleneck, especially on high-performance storage systems. Modern SSDs and enterprise storage often perform better with larger block sizes, but rippled previously had no way to configure this parameter. This change therefore implements configurable NuDB block size support, allowing operators to optimize storage performance based on their hardware configuration. The feature adds a new `nudb_block_size` configuration parameter that enables block sizes from 4K to 32K bytes, with comprehensive validation and backward compatibility.
Specific changes are:
- Implements `parseBlockSize()` function with validation.
- Adds `nudb_block_size` configuration parameter.
- Supports block sizes from 4K to 32K (power of 2).
- Adds comprehensive logging and error handling.
- Maintains backward compatibility with 4K default.
- Adds unit tests for block size validation.
- Updates configuration documentation with performance guidance.
- Marks feature as experimental.
- Applies code formatting fixes.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
Similarly to other transaction typed that can create a trust line or MPToken for the transaction submitter (e.g. CashCheck #5285, EscrowFinish #5185 ), VaultWithdraw should enforce reserve before creating a new object. Additionally, the lsfRequireDestTag account flag should be enforced for the transaction submitter.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
The default job timeout is 5 hours, while build times are anywhere between 4-20 mins and test times between 2-10. As a runner occasionally gets stuck, we should fail much quicker.
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>