13575 Commits

Author SHA1 Message Date
Ed Hennis
d325f20c76 Set version to 3.1.0 (#6284) 3.1.0 2026-01-27 20:13:06 -05:00
Ed Hennis
69dda6b34c Set version to 3.1.0-rc2 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
Ayaz Salikhov
8c573cd0bb Fix dependencies so clio can use libxrpl (#6251)
- Include <functional> header in Number.h
2026-01-22 11:30:54 -05:00
Ed Hennis
c894cd2b5f Revert "Fix dependencies so clio can use libxrpl (#6251)"
This reverts commit ecfe43ece7.
2026-01-22 11:30:39 -05:00
Ayaz Salikhov
ecfe43ece7 Fix dependencies so clio can use libxrpl (#6251)
- Include <functional> header in Number.h
2026-01-21 14:11:21 -05:00
Bart
564a35175e Set version to 3.1.0-rc1 3.1.0-rc1 2026-01-12 20:44:28 -05:00
Ed Hennis
919ded6694 Change LendingProtocol feature and dependencies to supported (#5632) 2026-01-12 20:44:08 -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) 3.1.0-b1 2025-12-17 18:38:32 -05:00
Ed Hennis
7527e35379 Set version to 3.0.0 3.0.0 2025-12-09 12:11:16 -05:00
Vladislav Vysokikh
e19b2c55c2 Version 3.0.0-rc2 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
Bart
cd00aa591f ci: Clean workspace on Windows self-hosted runners (#6024)
This change updates the `cleanup-workspace` action to its latest version, which added support for Windows.
2025-11-28 11:58:15 +00:00
hustrust
d3466de16c docs: fix spelling in comments (#6002) 2025-11-28 11:58:15 +00:00
Ayaz Salikhov
90894ec6c1 ci: Update Conan to 2.22.2 (#6019)
This updates the CI image hashes after following change: https://github.com/XRPLF/ci/pull/81. And, since we use latest Conan, we can have `conan.lock` with a newline at the end, and we don't need to exclude it from `pre-commit` hooks any longer.
2025-11-28 11:20:31 +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
Bart
2237644ec5 ci: Trigger clio pipeline on PRs targeting release branches (#6080)
This change triggers the Clio pipeline on PRs that target any of the `release*` branches (in addition to the `master` branch), as opposed to only the `release` branch.
2025-11-26 11:01:22 +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
Bart
13b169ffcb ci: Remove missing commits check (#6077)
This change removes the CI check for missing commits, as well as a stray path to the publish-docs workflow that isn't used in the on-trigger workflow.
2025-11-25 17:29:07 +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
Ayaz Salikhov
234dc6bdca ci: Only upload artifacts in XRPLF repo owner (#6060)
This change prevents uploading too many artifacts in non-public repositories.
2025-11-25 17:29:06 +00:00
sunnyraindy
82c2bf7144 chore: Fix some typos in comments (#6040) 2025-11-25 17:29:06 +00:00
Bart
210d49df44 ci: Fix filtering out of Clang 20+ on ARM (#6046)
This change fixes the strategy matrix check to filter out the Clang 20+ on ARM, which still fail due to problems with Boost.
2025-11-25 17:29:06 +00:00
Bart
3ffa30bf24 ci: Use new Debian Trixie images (#6034)
This change uses the new Debian Trixie CI images added by XRPLF/ci#83.
2025-11-25 17:29:05 +00:00
Bronek Kozicki
e7e4d52e38 Version 3.0.0-rc1 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
Ayaz Salikhov
865557024e ci: Specify bash as the default shell in workflows (#6021) 2025-11-12 09:30:36 +00:00
Bronek Kozicki
91b96d6386 chore: Move running of unit tests out of coverage target (#6018)
This change makes the progress of unit tests visible and also gives more flexibility when running them.
2025-11-11 15:42:14 +00:00
Bart
f1dbb20d7b chore: Make CMake improvements (#6010)
This change removes unused definitions from the CMake files, moves variable definitions from `XrplSanity` to `XrplSettings` where they better belong, and updates the minimum GCC and Clang versions to match what we actually minimally support.
2025-11-11 12:13:12 +00:00
Bronek Kozicki
2a2881ee53 chore: Unify build & test, add ctest to coverage (#6013)
This change unifies the build and test jobs into a single job, and adds `ctest` to coverage reporting.

The mechanics of coverage reporting is slightly complex and most of it is encapsulated in the `coverage` target. The status quo way of preparing coverage reports involves running a single target `cmake --build . --target coverage`, which does three things:
* Build the `rippled` binary (via target dependency)
* Prepare coverage reports:
  * Run `./rippled -u` unit tests.
  * Gather test output and build reports.

This makes it awkward to add an additional `ctest` step between build and coverage reporting steps. The better solution is to split `coverage` target into separate build, followed by `ctest`, followed by test generation. Luckily, the `coverage` target has been designed specifically to support such case; it does not need to build `rippled`, it's just a dependency. Similarly it allows additional tests to be run before gathering test outputs; in principle we could even strip it from running tests and run them separately instead. This means we can keep build, `ctest` and generation of coverage reports as separate steps, as long as the state of build directory is fully (including file timestamps, additional coverage files etc.) preserved between the steps. This means that in order to run `ctest` for coverage reporting we need to integrate build and test into a single job, which this change does.
2025-11-11 12:13:11 +00:00
Shawn Xie
ee2dff337d fix: domain order book insertion #5998 2025-11-11 12:13:11 +00:00
Ed Hennis
102a89f351 test: Count crashed test suites (#5924)
When outputting the unit test summary, this change counts crashed tests as failures.
2025-11-11 12:13:09 +00:00
Bart
9add957962 ci: Update CI image hashes to use netstat (#5987)
To debug test failures we would like to use `netstat`, but that package wasn't installed yet in the CI images. This change uses the new CI images created by https://github.com/XRPLF/ci/pull/79.
2025-11-11 12:06:55 +00:00
Vlad
0f1b607bb4 refactor: Improve txset handling (#5951) 2025-11-03 11:36:41 +00:00
Bronek Kozicki
4425f84c1f Remove directory size limit (#5935)
This change introduces the `fixDirectoryLimit` amendment to remove the directory pages limit. We found that the directory size limit is easier to hit than originally assumed, and there is no good reason to keep this limit, since the object reserve provides the necessary incentive to avoid creating unnecessary objects on the ledger.
2025-10-31 14:26:44 +00:00
Bronek Kozicki
8a6cc3ded8 fix: Change Credential sfSubjectNode to optional (#5936)
Field `sfSubjectNode` is not populated by `CredentialCreate` in self-issued credentials. Rather than fixup the Credentials already on the ledger, we can in this case safely change the object template for this field from `soeREQUIRED` to `soeOPTIONAL`.
2025-10-31 14:26:44 +00:00
Bart
3eec6ffcd7 ci: Check whether test failures are caused by port exhaustion (#5938)
This change adds an extra step to the CI test job that outputs network info, which may allow us to confirm whether random test failures are caused by port exhaustion.
2025-10-31 14:26:43 +00:00
Ayaz Salikhov
6b56c805dd chore: Use new prepare-runner (#5970)
See: XRPLF/actions#19.
2025-10-31 14:26:43 +00:00
Bart
da0eff9c1b ci: Use nproc-2 to set parallelism for builds and tests (#5939)
This change reduces the number of cores used to build and test, as using all cores may be contributing to occasional build and test failures.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
2025-10-31 14:26:42 +00:00
Bart
6e326e6c11 ci: Use commit hash so workflows are not canceled when merging multiple PRs (#5950)
This change changes the CI concurrency group for pushes to the `develop` branch to use the commit hash instead of the target branch.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
2025-10-31 14:26:41 +00:00
Bart
405575fd53 ci: Only upload codecov reports in the original repo, not in forks (#5953)
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
2025-10-31 14:26:41 +00:00
Bart
f38f299a86 ci: Only log into Conan when uploading packages (#5952)
There are separate steps for logging into Conan and uploading packages. However, at the moment sometimes the login step is executed even though no packages will be uploaded. The condition for performing both steps should be the same.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
2025-10-31 14:26:40 +00:00
Bronek Kozicki
8951419dbe fix: invariant error in fee-sized VaultWithdraw (#5876)
This changes fixes an invariant error where the amount withdrawn is equal to the transaction fee.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
2025-10-31 14:26:39 +00:00