Commit Graph

9679 Commits

Author SHA1 Message Date
Zhiyuan Wang
06afbd5587 fix: Prevent deletion of MPTokens with active escrow (#6635)
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-04-22 15:10:10 -04:00
Bart
53a9690d8e fix: Change Tuning::bookOffers minimum limit to 1 (#6812)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-04-22 15:10:10 -04:00
Bart
4e066ea455 refactor: Apply various minor improvements and corrections (#6739) 2026-04-22 15:09:43 -04:00
Valentin Balaschenko
df573c265c fix: Remove fatal assertion on Linux thread name truncation (#6690) 2026-04-22 15:09:42 -04:00
Valentin Balaschenko
c7a2c3d25a chore: Shorten job names to stay within Linux 15-char thread limit (#6669) 2026-04-22 15:09:42 -04:00
Valentin Balaschenko
9deae7eef8 refactor: Enforce 15-char limit and simplify labels for thread naming (#6212)
This change continues the thread naming work from #5691 and #5758, which enables more useful lock contention profiling by ensuring threads/jobs have short, stable, human-readable names (rather than being truncated/failing due to OS limits). This changes diagnostic naming only (thread names and job/load-event labels), not behavior.

Specific modifications are:
* Shortens all thread/job names used with `beast::setCurrentThreadName`, so the effective Linux thread name stays within the 15-character limit.
* Removes per-ledger sequence numbers from job/thread names to avoid long labels. This improves aggregation in lock contention profiling for short-lived job executions.
2026-04-22 15:09:42 -04:00
Mayukha Vadari
415e3d8ca5 fix: Assorted Permissioned Domain fixes (#6587) 2026-04-22 15:09:41 -04:00
Mayukha Vadari
26d4161239 fix: Assorted Vault fixes (#6607) 2026-04-22 15:09:41 -04:00
Mayukha Vadari
baa78ad13a fix: Assorted Oracle fixes (#6570) 2026-04-22 15:09:41 -04:00
Mayukha Vadari
fb19338b99 fix: Make assorted NFT fixes (#6566)
This change:
* Removes a set of unnecessary brackets in the initialization of an `std::uint32_t`.
* Fixes a couple of incorrect flags (same value, just wrong variables - so no amendment needed).
2026-04-22 15:09:41 -04:00
Copilot
fbab9e2687 fix: Peer crawler port field type inconsistency (#6318)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mvadari <8029314+mvadari@users.noreply.github.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-04-22 15:09:40 -04:00
Peter Chen
543e6f35e1 fix: Gateway balance with MPT (#6143)
When `gateway_balances` gets called on an account that is involved in the `EscrowCreate` transaction (with MPT being escrowed), the method returns internal error. This change fixes this case by excluding the MPT type when totaling escrow amount.
2026-04-22 15:09:40 -04:00
tequ
3519074575 refactor: Update PermissionedDomainDelete to use keylet for sle access (#6063) 2026-04-22 15:09:40 -04:00
Ed Hennis
846ae8900a Fix tautological assertion (#6393) 2026-04-22 15:09:40 -04:00
Copilot
24874f7e04 fix: Deletes expired NFToken offers from ledger (#5707)
This change introduces the `fixExpiredNFTokenOfferRemoval` amendment that allows expired offers to pass through `preclaim()` and be deleted in `doApply()`, following the same pattern used for expired credentials.
2026-04-22 15:09:40 -04:00
Pratik Mankawde
986af8e27c Limit reply size on TMGetObjectByHash queries (#6110)
`PeerImp` processes `TMGetObjectByHash` queries with an unbounded per-request loop, which performs a `NodeStore` fetch and then appends retrieved data to the reply for each queried object without a local count cap or reply-byte budget. However, the `Nodestore` fetches are expensive when high in numbers, which might slow down the process overall. Hence this code change adds an upper cap on the response size.
2026-04-22 15:09:39 -04:00
Zhanibek Bakin
ab629b5ee4 fix: Truncate thread name to 15 chars on Linux (#5758)
This change:
* Truncates thread names if more than 15 chars with `snprintf`.
* Adds warnings for truncated thread names if `-DTRUNCATED_THREAD_NAME_LOGS=ON`.
* Add a static assert for string literals to stop compiling if > 15 chars.
* Shortens `Resource::Manager` to `Resource::Mngr` to fix the static assert failure.
* Updates `CurrentThreadName_test` unit test specifically for Linux to verify truncation.
2026-04-22 15:09:39 -04:00
Olek
136034af44 Fix: nullptr resolving without db config (#6029)
If the config disables SQL db usage, such as a validator:

```
[ledger_tx_tables]
use_tx_tables = 0
```

then the pointer to DB engine is null, but it was still resolved during startup. Although it didn't crash in Release mode, possibly due to the compiler optimizing it away, it did crash in Debug mode. This change explicitly checks for the validity of the pointer and generates a runtime error if not set.
2026-04-22 15:09:39 -04:00
Mayukha Vadari
ee4e2f6e59 fix: Set correct index for limit in book_offers CLI (#6043)
This change fixes an indexing typo in the `book_offers` CLI processing, and does not affect the HTTPS/WS RPC processing.
2026-04-22 15:09:39 -04:00
Olek
b8577bd7b8 Fix: Perform array size check (#6030)
The `ledger_entry` and `deposit_preauth` requests require an array of credentials. However, the array size is not checked before is gets processing. This fix adds checks and return errors in case array size is too big.
2026-04-22 15:09:38 -04:00
Copilot
b46a9818e5 fix: account_tx limit parameter validation for malformed values (#5891)
This change fixes the `account_tx` RPC method to properly validate malformed limit parameter values. Previously, invalid values like `0`, `1.2`, `"10"`, `true`, `false`, `-1`, `[]`, `{}`, etc. were either accepted without errors or caused internal errors. Now all malformed values correctly return the `invalidParams` error.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
2026-04-22 15:09:38 -04:00
Vito Tumas
11bab06617 fix: Enforce aggregate MaximumAmount in multi-send MPT (#6644)
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
2026-04-06 12:54:32 -04:00
Vito Tumas
a92483e077 fix: Improve loan invariant message (#6668) 2026-04-01 18:55:56 -04:00
Mayukha Vadari
3ba3fcff4c release: Bump version to 3.1.2 2026-03-12 15:01:01 -04:00
Mayukha Vadari
ecc58740d0 release: Bump version to 3.1.2-rc1 2026-03-11 18:17:24 -04:00
Mayukha Vadari
0e3600a18f refactor: Improve exception handling 2026-03-11 18:17:16 -04:00
Ed Hennis
c5988233d0 Set version to 3.1.1 (#6410) 2026-02-23 15:47:09 -05:00
Valentin Balaschenko
61481ff61d Set version to 3.1.1-rc1 2026-02-20 19:22:03 -05:00
Ed Hennis
d325f20c76 Set version to 3.1.0 (#6284) 2026-01-27 20:13:06 -05:00
Ed Hennis
69dda6b34c Set version to 3.1.0-rc2 2026-01-22 18:13:41 -05:00
Ed Hennis
e3644f265c fix: Remove DEFAULT fields that change to the default in associateAsset (#6259)
- Add Vault creation tests for showing valid range for AssetsMaximum
2026-01-22 16:52:57 -05:00
Bart
564a35175e Set version to 3.1.0-rc1 2026-01-12 20:44:28 -05:00
Ed Hennis
1ead5a7ac1 Expand Number to support full integer range (#6192)
- Refactor Number internals away from int64 to uint64 & a sign flag
  - ctors and accessors return `rep`. Very few things expose
    `internalrep`.
  - An exception is "unchecked" and the new "normalized", which explicitly
    take an internalrep. But with those special control flags, it's easier
    to distinguish and control when they are used.

- For now, skip the larger mantissas in AMM transactions and tests

- Remove trailing zeros from scientific notation Number strings
  - Update tests. This has the happy side effect of making some of the string
    representations _more_ consistent between the small and large
    mantissa ranges.

- Add semi-automatic rounding of STNumbers based on Asset types
  - Create a new SField metadata enum, sMD_NeedsAsset, which indicates
    the field should be associated with an Asset so it can be rounded.
  - Add a new STTakesAsset intermediate class to handle the Asset
    association to a derived ST class. Currently only used in STNumber,
    but could be used by other types in the future.
  - Add "associateAsset" which takes an SLE and an Asset, finds the
    sMD_NeedsAsset fields, and associates the Asset to them. In the case
    of STNumber, that both stores the Asset, and rounds the value
    immediately.
  - Transactors only need to add a call to associateAsset _after_ all of
    the STNumbers have been set. Unfortunately, the inner workings of
    STObject do not do the association correctly with uninitialized
    fields.
  - When serializing an STNumber that has an Asset, round it before
    serializing.
  - Add an override of roundToAsset, which rounds a Number value in place
    to an Asset, but without any additional scale.
  - Update and fix a bunch of Loan-related tests to accommodate the
    expanded Number class.

---------

Co-authored-by: Vito <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com>
2026-01-13 01:04:22 +00:00
Ed Hennis
91d239f10b Improve and fix bugs in Lending Protocol - XLS-66 (#6156)
- Fix overpayment asserts (#6084)

- MPTTester::operator() parameter should be std::int64_t
	- Originally defined as uint64_t, but the testIssuerLoan() test called
	  it with a negative number, causing an overflow to a very large number
	  that in some circumstances could be silently cast back to an int64_t,
	  but might not be. I believe this is UB, and we don't want to rely on
	  that.

- Fix Overpayment Calculation  (#6087)
	- Adds additional unit tests to cover math calculations.
	- Removes unused methods.
- Fix LoanBrokerSet debtMaximum limits (#6116)
- Fix some minor bugs in Lending Protocol (#6101)
	- add nodiscard to unimpairLoan, and check result in LoanPay
	- add a check to verify that issuer exists
	- improve LoanManage error code for dust amounts

- In overpayment results, the management fee was being calculated twice:
  once as part of the value change, and as part of the fees paid.
  Exclude it from the value change.

- Round the initial total value computation upward, unless there is
  0-interest.
- Rename getVaultScale to getAssetsTotalScale, and convert one incorrect
  computation to use it.
- Use adjustImpreciseNumber for LossUnrealized.
- Add some logging to computeLoanProperties.

- Check permissions in LoanSet and LoanPay (#6108)

- Disallow pseudo accounts to be Destination for LoanBrokerCoverWithdraw (#6106)

- Ensure vault asset cap is not exceeded (#6124)

- Fix Overpayment ValueChange calculation in Lending Protocol (#6114)
	- Adds loan state to LoanProperties.
	- Cleans up computeLoanProperties.
	- Fixes missing management fee from overpayment.

- fix: Enable LP Deposits when the broker is the asset issuer (#6119)

- Add a few minor changes (#6158)
	- Updates or fixes a couple of things I noticed while reviewing changes
	  to the spec.
	- Rename sfPreviousPaymentDate to sfPreviousPaymentDueDate.
	- Make the vault asset cap check added in #6124 a little more robust:
	  1. Check in preflight if the vault is _already_ over the limit.
	  2. Prevent overflow when checking with the loan value. (Subtract
	     instead of adding, in case the values are near maxint. Both return
	     the same result. Also add a unit test so each case is covered.

- Add minimum grace period validation (#6133)

- Fix bugs: frozen pseudo-account, and FLC cutoff (#6170)
	- Fixes LoanManage tfBAD_LEDGER case by capping the amount of FLC to use to cover a loss at the amount of cover available.
	- Check if the Vault pseudo-account is frozen in LoanBrokerSet

- refactor: Rename raw state to theoretical state (#6187)

- Check if a withdrawal amount exceeds any applicable receiving limit. (#6117)
	- Check the trust line limit is not exceeded for a withdraw to a third party Destination account.

- Fix test failures from interaction between #6120 and #6133
	- LoanSet transaction added in #6120 failed the minimum grace period
	  added by #6133.

- Fix overpayment result calculation (#6195)

- Address review feedback from Lending Protocol re-review (#6161)
	- Reduce code duplication in LoanBrokerDelete
	- Reorder "canWithdraw" parameters to put "view" first
	- Combine accountSpendable into accountHolds
	- Avoid copies by taking a reference for the claw amount
	- Return function results directly
	- Fix typo for "parseLoan" in ledger_entry RPC
	- Improve some comments and unused variables
	- No need for late payment components lambda
	- Add explanatory comment for computeLoanProperties
	- Add comment linking computeRawLoanState to spec
	- Fix typo: TrueTotalPrincipalOutstanding
	- Fix missed ripple -> xrpl update
	- Remove unnecessary "else"s.
	- Clean up std::visit in accountHolds.
	
---------

Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com>
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
Co-authored-by: Gregory Tsipenyuk <gregtatcam@users.noreply.github.com>
2026-01-12 18:08:35 -05:00
Vito Tumas
418ce68302 VaultClawback: Burn shares of an empty vault (#6120)
- Adds a mechanism for the vault owner to burn user shares when the vault is stuck. If the Vault has 0 AssetsAvailable and Total, the owner may submit a VaultClawback to reclaim the worthless fees, and thus allow the Vault to be deleted. The Amount must be left off (unless the owner is the asset issuer), specified as 0 Shares, or specified as the number of Shares held.
2026-01-10 01:41:22 -05:00
Ed Hennis
f17e476f7a fix: Inner batch transactions never have valid signatures (#6069)
- Introduces amendment `fixBatchInnerSigs`
- Update Batch unit tests
  - Fix all the Env instantiations to _use_ the "features" parameter.
  - testInnerSubmitRPC runs with Batch enabled and disabled.
  - Add a test to testInnerSubmitRPC for a correctly signed tx incorrectly
    using the tfInnerBatchTxn flag.
  - Generalize the submitAndValidate lambda in testInnerSubmitRPC.
  - With the fix amendment, a transaction never reaches the transaction
    engine (Transactor and derived classes.)
  - Test submitting a pseudo-transaction. Stopped before reaching the
    transaction engine, but with different errors.
- The tests verify that without the amendment, a transaction with
  tfInnerBatchTxn is immediately rejected. Without the amendment, things
  are safe. The amendment just makes things safer and more future-proof.
2026-01-10 00:05:31 -05:00
Denis Angell
d25915ca1d fix: Reorder Batch Preflight Errors (#6176)
This change fixes https://github.com/XRPLF/rippled/issues/6058.
2026-01-09 21:59:23 -05:00
Bart
8990c45c40 Set version to 3.1.0-b1 (#6152) 2025-12-17 18:38:32 -05:00
Ed Hennis
7527e35379 Set version to 3.0.0 2025-12-09 12:11:16 -05:00
Vladislav Vysokikh
e19b2c55c2 Version 3.0.0-rc2 2025-12-02 15:11:44 -05:00
Ed Hennis
138d6e751b Implement Lending Protocol (unsupported) (#5270)
- Spec: XLS-66
- Introduces amendment "LendingProtocol", but leaves it UNSUPPORTED to
  allow for standalone testing, future development work, and potential
  bug fixes.
- AccountInfo RPC will indicate the type of pseudo-account when
  appropriate.
- Refactors and improves several existing classes and functional areas,
  including Number, STAmount, STObject, json_value, Asset, directory
  handling, View helper functions, and unit test helpers.
2025-12-02 15:11:43 -05:00
Bronek Kozicki
b195011eff fix: Apply object reserve for Vault pseudo-account (#5954) 2025-11-28 11:58:16 +00:00
hustrust
d3466de16c docs: fix spelling in comments (#6002) 2025-11-28 11:58:15 +00:00
Bronek Kozicki
6b55db490e fix: JSON parsing of negative STNumber and STAmount (#5990)
This change fixes JSON parsing of negative `int` input in `STNumber` and `STAmount`. The conversion of JSON to `STNumber` or `STAmount` may trigger a condition where we negate smallest possible `int` value, which is undefined behaviour. We use a temporary storage as `int64_t` to avoid this bug. Note that this only affects RPC, because we do not parse JSON in the protocol layer, and hence no amendment is needed.
2025-11-28 11:20:31 +00:00
Ed Hennis
587d4ac5cc refactor: Add support for extra transaction signature validation (#5851)
- Restructures `STTx` signature checking code to be able to handle
  a `sigObject`, which may be the full transaction, or may be an object
  field containing a separate signature. Either way, the `sigObject` can
  be a single- or multi-sign signature.
- This is distinct from 550f90a75e (#5594), which changed the check in
  Transactor, which validates whether a given account is allowed to sign
  for the given transaction. This cryptographically checks the signature
  validity.
2025-11-25 18:30:44 +00:00
Jingchen
d42f8e0bda chore: Clean up comment in NetworkOps_test.cpp (#6066)
This change removes a copyright notice that was accidentally copied over from another file.
2025-11-25 17:29:07 +00:00
Vito Tumas
0276a6b6bd docs: Improve VaultWithdraw documentation (#6068) 2025-11-25 17:29:07 +00:00
sunnyraindy
82c2bf7144 chore: Fix some typos in comments (#6040) 2025-11-25 17:29:06 +00:00
Bronek Kozicki
e7e4d52e38 Version 3.0.0-rc1 2025-11-12 09:30:43 +00:00
Bronek Kozicki
4135d56aa0 fix: floating point representation errors in vault (#5997)
This change fixes floating point errors in conversion of shares to assets and other way, used in `VaultDeposit`, `VaultWithdraw` and `VaultClawback`. In the floating point calculations the division introduces a larger error than multiplication. If we do division first, then the error introduced will be increased by the multiplication that follows, which is therefore the wrong order to perform these two operations. This change flips the order of arithmetic operations, which minimizes the error.
2025-11-12 09:30:42 +00:00