Commit Graph

144 Commits

Author SHA1 Message Date
JCW
dcec5a0bbc Revert unrelated changes & performance optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:06:20 +01:00
JCW
79c3a83088 Fix build error
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:03:16 +01:00
JCW
bd91ec7242 Optimise
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:03:14 +01:00
JCW
bb787e3995 Optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:55 +01:00
JCW
44aa394e1e Fix formatting
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:54 +01:00
JCW
2f6d133169 Improve test coverage
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:54 +01:00
JCW
9543ccf8e1 Set module name in json
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:53 +01:00
JCW
fa0cff3532 Fix build error
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:53 +01:00
JCW
3ec7596170 Fix build error
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:53 +01:00
JCW
28ad89ca20 Fix build error
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:53 +01:00
JCW
1a2b7e9b94 Fix issues
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:52 +01:00
JCW
c2aae2d846 Optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:52 +01:00
JCW
458bd8a3bd Revert unrelated changes
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:52 +01:00
JCW
89ebb6b495 Fix issues
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:24 +01:00
JCW
1d3d0c6774 Optimise
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:23 +01:00
JCW
f50f76788b Fix issues
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:23 +01:00
JCW
feae1d6e15 Optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:23 +01:00
JCW
7debf3e9f4 Optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:23 +01:00
JCW
90f970be46 Improve performance
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:23 +01:00
JCW
5e060a9e7b Fix
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:22 +01:00
JCW
dca000a60f Optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:22 +01:00
JCW
7500d635bb Fix issues
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:22 +01:00
JCW
3181042f15 Fix issues
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:22 +01:00
JCW
48cf042258 Optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:22 +01:00
JCW
61ff2ba0e7 Fix issues
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:21 +01:00
JCW
e19d770b86 performance optimisation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 14:02:21 +01:00
JCW
a128571ab5 Fix issues 2025-09-26 14:02:21 +01:00
JCW
dc221de60c Fix issues 2025-09-26 14:02:21 +01:00
JCW
cdf1109558 Performance improvement 2025-09-26 14:02:18 +01:00
JCW
ab9e6563e4 Fix PR comments
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:54 +01:00
Jingchen
d0f0789490 Update include/xrpl/basics/Log.h
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2025-09-26 13:55:54 +01:00
JCW
a90bf169bf Improve coverage
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:54 +01:00
JCW
856b36d0a5 Fix errors
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:53 +01:00
JCW
9edba67e64 Fix formatting
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:53 +01:00
JCW
0e4f9a7ccf Fix errors
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:51 +01:00
JCW
e4db80f61d Fix errors
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:39 +01:00
JCW
92312801f1 Support structured logs
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-09-26 13:55:16 +01:00
tequ
2c3024716b change fixPriceOracleOrder to Supported::yes (#5749) 2025-09-26 12:07:48 +01:00
Mayukha Vadari
6b8a589447 test: Add STInteger and STParsedJSON tests (#5726)
This change is to improve code coverage (and to simplify #5720 and #5725); there is otherwise no change in functionality. The change adds basic tests for `STInteger` and `STParsedJSON`, so it becomes easier to test smaller changes to the types, as well as removes `STParsedJSONArray`, since it is not used anywhere (including in Clio).
2025-09-22 20:00:31 +02:00
Ed Hennis
3cbdf818a7 Miscellaneous refactors and updates (#5590)
- Added a new Invariant: `ValidPseudoAccounts` which checks that all pseudo-accounts behave consistently through creation and updates, and that no "real" accounts look like pseudo-accounts (which means they don't have a 0 sequence). 
- `to_short_string(base_uint)`. Like `to_string`, but only returns the first 8 characters. (Similar to how a git commit ID can be abbreviated.) Used as a wrapped sink to prefix most transaction-related messages. More can be added later.
- `XRPL_ASSERT_PARTS`. Convenience wrapper for `XRPL_ASSERT`, which takes the `function` and `description` as separate parameters.
- `SField::sMD_PseudoAccount`. Metadata option for `SField` definitions to indicate that the field, if set in an `AccountRoot` indicates that account is a pseudo-account. Removes the need for hard-coded field lists all over the place. Added the flag to `AMMID` and `VaultID`.
- Added functionality to `SField` ctor to detect both code and name collisions using asserts. And require all SFields to have a name
- Convenience type aliases `STLedgerEntry::const_pointer` and `STLedgerEntry::const_ref`. (`SLE` is an alias to `STLedgerEntry`.)
- Generalized `feeunit.h` (`TaggedFee`) into `unit.h` (`ValueUnit`) and added new "BIPS"-related tags for future use. Also refactored the type restrictions to use Concepts.
- Restructured `transactions.macro` to do two big things
	1. Include the `#include` directives for transactor header files directly in the macro file. Removes the need to update `applySteps.cpp` and the resulting conflicts.
	2. Added a `privileges` parameter to the `TRANSACTION` macro, which specifies some of the operations a transaction is allowed to do. These `privileges` are enforced by invariant checks. Again, removed the need to update scattered lists of transaction types in various checks.
- Unit tests:
	1.  Moved more helper functions into `TestHelpers.h` and `.cpp`. 
	2. Cleaned up the namespaces to prevent / mitigate random collisions and ambiguous symbols, particularly in unity builds.
	3. Generalized `Env::balance` to add support for `MPTIssue` and `Asset`.
	4. Added a set of helper classes to simplify `Env` transaction parameter classes: `JTxField`, `JTxFieldWrapper`, and a bunch of classes derived or aliased from it. For an example of how awesome it is, check the changes `src/test/jtx/escrow.h` for how much simpler the definitions are for `finish_time`, `cancel_time`, `condition`, and `fulfillment`. 
	5. Generalized several of the amount-related helper classes to understand `Asset`s.
     6. `env.balance` for an MPT issuer will return a negative number (or 0) for consistency with IOUs.
2025-09-18 17:55:49 +00:00
Jingchen
dc8b37a524 refactor: Modularise ledger (#5493)
This change moves the ledger code to libxrpl.
2025-09-18 11:12:24 -04:00
Mayukha Vadari
510314d344 fix(amendment): Add missing fields for keylets to ledger objects (#5646)
This change adds a fix amendment (`fixIncludeKeyletFields`) that adds:
* `sfSequence` to `Escrow` and `PayChannel`
* `sfOwner` to `SignerList`
* `sfOracleDocumentID` to `Oracle`

This ensures that all ledger entries hold all the information needed to determine their keylet.
2025-09-17 21:34:47 +00:00
yinyiqian1
37b951859c Rename mutable flags (#5797)
This is a minor change on top of #5705
2025-09-17 21:43:04 +01:00
yinyiqian1
ccb9f1e42d Support DynamicMPT XLS-94d (#5705)
* extends the functionality of the MPTokenIssuanceSet transaction, allowing the issuer to update fields or flags that were explicitly marked as mutable during creation.
2025-09-15 19:42:36 +00:00
Denis Angell
37c377a1b6 Fix: EscrowTokenV1 (#5571)
* resolves an accounting inconsistency in MPT escrows where transfer fees were not properly handled when unlocking escrowed tokens.
2025-09-15 14:48:47 +00:00
yinyiqian1
61d628d654 fix: Add restrictions to Permission Delegation: fixDelegateV1_1 (#5650)
- Amendment: fixDelegateV1_1
- In DelegateSet, disallow invalid PermissionValues like 0, and transaction values when the transaction's amendment is not enabled. Acts as if the transaction doesn't exist, which is the same thing older versions without the amendment will do.
- Payment burn/mint should disallow DEX currency exchange.
- Support MPT for Payment burn/mint.
2025-09-10 17:47:33 +00:00
yinyiqian1
f1eaa6a264 enable fixAMMClawbackRounding (#5750) 2025-09-09 15:57:28 +00:00
Bronek Kozicki
cf5f65b68e Add Scale to SingleAssetVault (#5652)
* Add and Scale to VaultCreate
* Add round-trip calculation to VaultDeposit VaultWithdraw and VaultClawback
* Implement Number::truncate() for VaultClawback
* Add rounding to DepositWithdraw
* Disallow zero shares withdraw or deposit with tecPRECISION_LOSS
* Return tecPATH_DRY on overflow when converting shares/assets
* Remove empty shares MPToken in clawback or withdraw (except for vault owner)
* Implicitly create shares MPToken for vault owner in VaultCreate
* Review feedback: defensive checks in shares/assets calculations

---------

Co-authored-by: Ed Hennis <ed@ripple.com>
2025-09-04 08:54:24 +00:00
Mayukha Vadari
e0b9812fc5 Refactor ledger_entry RPC source code and tests (#5237)
This is a major refactor of LedgerEntry.cpp. It adds a number of helper functions to make the code easier to maintain.

It also splits up the ledger and ledger_entry tests into different files, and cleans up the ledger_entry tests to make them easier to write and maintain.

This refactor also caught a few bugs in some of the other RPC processing, so those are fixed along the way.
2025-08-29 15:52:09 -04:00
Alex Kremer
1506e65558 refactor: Update to Boost 1.88 (#5570)
This updates Boost to 1.88, which is needed because Clio wants to move to 1.88 as that fixes several ASAN false positives around coroutine usage. In order for Clio to move to newer boost, libXRPL needs to move too. Hence the changes in this PR. A lot has changed between 1.83 and 1.88 so there are lots of changes in the diff, especially in regards to Boost.Asio and coroutines in particular.
2025-08-27 09:34:50 +00:00