Commit Graph

14037 Commits

Author SHA1 Message Date
yinyiqian1
cdf3e82f6e Disallow filtering account_objects by unsupported types (#5056)
* `account_objects` returns an invalid field error if `type` is not supported.
  This includes objects an account can't own, or which are unsupported by `account_objects`
* Includes:
  * Amendments
  * Directory Node
  * Fee Settings
  * Ledger Hashes
  * Negative UNL
2026-02-20 07:24:41 +09:00
Scott Schurr
e22f8749db chore: Add comments to SignerEntries.h (#5059) 2026-02-20 07:20:18 +09:00
Scott Schurr
2091d129d4 chore: Rename two files from Directory* to Dir*: (#5058)
The names of the files should reflect the name of the Dir class.

Co-authored-by: Zack Brunson <Zshooter@gmail.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-02-20 07:20:17 +09:00
Denis Angell
ce7dbaf5ab Update BUILD.md after PR #5052 (#5067)
* Document the need to specify "xrpld" and "tests" to build and test rippled.
2026-02-20 07:20:17 +09:00
John Freeman
7ae3065a36 Add xrpld build option and Conan package test (#5052)
* Make xrpld target optional

* Add job to test Conan recipe

* [fold] address review comments

* [fold] Enable tests in workflows

* [fold] Rename with_xrpld option

* [fold] Fix grep expression
2026-02-20 07:20:16 +09:00
dashangcun
e9d75a6cc7 chore: remove repeat words (#5053)
Signed-off-by: dashangcun <jchaodaohang@foxmail.com>
Co-authored-by: dashangcun <jchaodaohang@foxmail.com>
Co-authored-by: Zack Brunson <Zshooter@gmail.com>
2026-02-20 07:20:16 +09:00
yinyiqian1
eccc2fc522 fix CTID in tx command returns invalidParams on lowercase hex (#5049)
* fix CTID in tx command returns invalidParams on lowercase hex

* test mixed case and change auto to explicit type

* add header cctype because std::tolower is called

* remove unused local variable

* change test case comment from 'lowercase' to 'mixed case'

---------

Co-authored-by: Zack Brunson <Zshooter@gmail.com>
2026-02-20 07:20:15 +09:00
Ed Hennis
61e8f0956f Invariant: prevent a deleted account from leaving (most) artifacts on the ledger. (#4663)
* Add feature / amendment "InvariantsV1_1"

* Adds invariant AccountRootsDeletedClean:

* Checks that a deleted account doesn't leave any directly
  accessible artifacts behind.
* Always tests, but only changes the transaction result if
  featureInvariantsV1_1 is enabled.
* Unit tests.

* Resolves #4638

* [FOLD] Review feedback from @gregtatcam:

* Fix unused variable warning
* Improve Invariant test const correctness

* [FOLD] Review feedback from @mvadari:

* Centralize the account keylet function list, and some optimization

* [FOLD] Some structured binding doesn't work in clang

* [FOLD] Review feedback 2 from @mvadari:

* Clean up and clarify some comments.

* [FOLD] Change InvariantsV1_1 to unsupported

* Will allow multiple PRs to be merged over time using the same amendment.

* fixup! [FOLD] Change InvariantsV1_1 to unsupported

* [FOLD] Update and clarify some comments. No code changes.

* Move CMake directory

* Rearrange sources

* Rewrite includes

* Recompute loops

* Fix merge issue and formatting

---------

Co-authored-by: Pretty Printer <cpp@ripple.com>
2026-02-20 07:20:14 +09:00
yinyiqian1
66aa252a52 fix "account_nfts" with unassociated marker returning issue (#5045)
* fix "account_nfts" with unassociated marker returning issue

* create unit test for fixing nft page invalid marker not returning error

add more test

change test name

create unit test

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* fix "account_nfts" with unassociated marker returning issue

* [FOLD] accumulated review suggestions

* move BEAST check out of lambda function

---------

Authored-by: Scott Schurr <scott@ripple.com>
2026-02-20 07:20:14 +09:00
Scott Schurr
fbcff93251 fixInnerObjTemplate2 amendment (#5047)
* fixInnerObjTemplate2 amendment:

Apply inner object templates to all remaining (non-AMM)
inner objects.

Adds a unit test for applying the template to sfMajorities.
Other remaining inner objects showed no problems having
templates applied.

* Move CMake directory

* Rearrange sources

* Rewrite includes

* Recompute loops

---------

Co-authored-by: Pretty Printer <cpp@ripple.com>
2026-02-20 07:20:13 +09:00
tequ
e95edcba48 fix for xahaud codebase 2026-02-20 07:11:14 +09:00
Pretty Printer
d25b5dcd56 Recompute loops 2026-02-20 07:11:13 +09:00
Pretty Printer
e618806999 Rewrite includes 2026-02-20 07:11:13 +09:00
Pretty Printer
bfafa2bb39 Rearrange sources 2026-02-20 07:11:12 +09:00
Pretty Printer
e47b1c1b3b Move CMake directory 2026-02-20 07:11:11 +09:00
John Freeman
4564054423 Add bin/physical.sh (#4997) 2026-02-20 07:11:10 +09:00
John Freeman
8e221bcd68 Prepare to rearrange sources: (#4997)
- Remove CMake module "MultiConfig".
- Update clang-format configuration, CodeCov configuration,
  levelization script.
- Replace source lists in CMake with globs.
2026-02-20 07:11:10 +09:00
Bronek Kozicki
a13f367b75 Change order of checks in amm_info: (#4924)
* Change order of checks in amm_info

* Change amm_info error message in API version 3

* Change amm_info error tests
2026-02-20 07:11:09 +09:00
Scott Schurr
10435a40e6 Add the fixEnforceNFTokenTrustline amendment: (#4946)
Fix interactions between NFTokenOffers and trust lines.

Since the NFTokenAcceptOffer does not check the trust line that
the issuer receives as a transfer fee in the NFTokenAcceptOffer,
if the issuer deletes the trust line after NFTokenCreateOffer,
the trust line is created for the issuer by the
NFTokenAcceptOffer.  That's fixed.

Resolves #4925.
2026-02-20 07:11:09 +09:00
Chenna Keshava B S
b7fbe4eb99 Replaces the usage of boost::string_view with std::string_view (#4509) 2026-02-20 07:11:08 +09:00
Elliot Lee
316718312b docs: explain how to find a clang-format patch generated by CI (#4521) 2026-02-20 07:11:07 +09:00
tequ
9465fccbc1 XLS-52d: NFTokenMintOffer (#4845) 2026-02-20 07:10:42 +09:00
todaymoon
92d3125bca chore: remove repeat words (#5041) 2026-02-20 07:10:41 +09:00
Alex Kremer
1b1420d51b Expose all amendments known by libxrpl (#5026) 2026-02-20 07:10:41 +09:00
Scott Schurr
0a2a5479c6 fixReducedOffersV2: prevent offers from blocking order books: (#5032)
Fixes issue #4937.

The fixReducedOffersV1 amendment fixed certain forms of offer
modification that could lead to blocked order books.  Reduced
offers can block order books if the effective quality of the
reduced offer is worse than the quality of the original offer
(from the perspective of the taker). It turns out that, for
small values, the quality of the reduced offer can be
significantly affected by the rounding mode used during
scaling computations.

Issue #4937 identified an additional code path that modified
offers in a way that could lead to blocked order books.  This
commit changes the rounding in that newly located code path so
the quality of the modified offer is never worse than the
quality of the offer as it was originally placed.

It is possible that additional ways of producing blocking
offers will come to light.  Therefore there may be a future
need for a V3 amendment.
2026-02-20 07:10:40 +09:00
Chenna Keshava B S
b3a41ee9de Additional unit tests for testing deletion of trust lines (#4886) 2026-02-20 07:10:39 +09:00
Olek
4cebe4c0ea Fix conan typo: (#5044)
Add missed coma in 'exportes_sources'
2026-02-20 07:10:39 +09:00
Bronek Kozicki
0c3909af4e Add new command line option to make replaying transactions easier: (#5027)
* Add trap_tx_hash command line option

This new option can be used only if replay is also enabled. It takes a transaction hash from the ledger loaded for replay, and will cause a specific line to be hit in Transactor.cpp, right before the selected transaction is applied.
2026-02-20 07:10:38 +09:00
John Freeman
afc7af4ab9 Fix compatibility with Conan 2.x: (#5001)
Closes #4926, #4990
2026-02-20 07:10:38 +09:00
J. Scott Branson
ff2a603745 Update SQLite3 max_page_count to match current defaults (#5114)
When rippled initiates a connection to SQLite3, rippled sends a "PRAGMA"
statement defining the maximum number of pages allowed in the database.
Update the max_page_count so it is consistent with the default for newer
versions of SQLite3. Increasing max_page_count is critical for keeping
full history servers online.

Fix #5102
2026-02-20 07:10:37 +09:00
Valentin Balaschenko
8a054c36f0 Track latencies of certain code blocks, and log if they take too long 2026-02-20 07:10:36 +09:00
John Freeman
bf0705775a Use error codes throughout fast Base58 implementation 2026-02-20 07:10:36 +09:00
Mayukha Vadari
469b13dd71 Improve error handling in some RPC commands 2026-02-20 07:10:35 +09:00
Alex Kremer
fad6dfe1e3 Add xrpl.libpp as an exported lib in conan (#5022) 2026-02-20 07:07:02 +09:00
Gregory Tsipenyuk
0eb5cbf78c Fix Oracle's token pair deterministic order: (#5021)
Price Oracle data-series logic uses `unordered_map` to update the Oracle object.
This results in different servers disagreeing on the order of that hash table.
Consequently, the generated ledgers will have different hashes.
The fix uses `map` instead to guarantee the order of the token pairs
in the data-series.
2026-02-20 07:07:02 +09:00
Gregory Tsipenyuk
3d87543300 Fix last Liquidity Provider withdrawal:
Due to the rounding, LPTokenBalance of the last
Liquidity Provider (LP), might not match this LP's
trustline balance. This fix sets LPTokenBalance on
last LP withdrawal to this LP's LPToken trustline
balance.
2026-02-20 07:07:01 +09:00
Gregory Tsipenyuk
8f50c787c1 Fix offer crossing via single path AMM with transfer fee:
Single path AMM offer has to factor in the transfer in rate
when calculating the upper bound quality and the quality function
because single path AMM's offer quality is not constant.
This fix factors in the transfer fee in
BookStep::adjustQualityWithFees().
2026-02-20 07:07:01 +09:00
Gregory Tsipenyuk
0637543c2a Fix adjustAmountsByLPTokens():
The fix is to return the actual adjusted lp tokens and amounts
by the function.
2026-02-20 07:07:00 +09:00
Gregory Tsipenyuk
a9a04921b5 Add the fixAMMOfferRounding amendment: (#4983)
* Fix AMM offer rounding and low quality LOB offer blocking AMM:

A single-path AMM offer with account offer on DEX, is always generated
starting with the takerPays first, which is rounded up, and then
the takerGets, which is rounded down. This rounding ensures that the pool's
product invariant is maintained. However, when one of the offer's side
is XRP, this rounding can result in the AMM offer having a lower
quality, potentially causing offer generation to fail if the quality
is lower than the account's offer quality.

To address this issue, the proposed fix adjusts the offer generation process
to start with the XRP side first and always rounds it down. This results
in a smaller offer size, improving the offer's quality. Regardless if the offer
has XRP or not, the rounding is done so that the offer size is minimized.
This change still ensures the product invariant, as the other generated
side is the exact result of the swap-in or swap-out equations.

If a liquidity can be provided by both AMM and LOB offer on offer crossing
then AMM offer is generated so that it matches LOB offer quality. If LOB
offer quality is less than limit quality then generated AMM offer quality
is also less than limit quality and the offer doesn't cross. To address
this issue, if LOB quality is better than limit quality then use LOB
quality to generate AMM offer. Otherwise, don't use the quality to generate
AMM offer. In this case, limitOut() function in StrandFlow limits
the out amount to match strand's quality to limit quality and consume
maximum AMM liquidity.
2026-02-20 07:06:59 +09:00
Gregory Tsipenyuk
02c2936e62 Price Oracle: validate input parameters and extend test coverage: (#5013)
* Price Oracle: validate input parameters and extend test coverage:

Validate trim, time_threshold, document_id are valid
Int, UInt, or string convertible to UInt. Validate base_asset
and quote_asset are valid currency. Update error codes.
Extend Oracle and GetAggregatePrice unit-tests.
Denote unreachable coverage code.

* Set one-line LCOV_EXCL_LINE

* Move ledger_entry tests to LedgerRPC_test.cpp

* Add constants for "None"

* Fix LedgerRPC test

---------

Co-authored-by: Scott Determan <scott.determan@yahoo.com>
2026-02-20 07:06:59 +09:00
Michael Legleux
6e51de48a1 Add external directory to Conan recipe's exports (#5006) 2026-02-20 07:06:58 +09:00
John Freeman
fb531107a9 Add missing includes (#5011) 2026-02-20 07:06:57 +09:00
seelabs
39b861c78a Remove flow assert: (#5009)
Rounding in the payment engine is causing an assert to sometimes fire
with "dust" amounts. This is causing issues when running debug builds of
rippled. This issue will be addressed, but the assert is no longer
serving its purpose.
2026-02-20 07:06:57 +09:00
seelabs
c9b825a09a fix amendment: AMM swap should honor invariants: (#5002)
The AMM has an invariant for swaps where:
new_balance_1*new_balance_2 >= old_balance_1*old_balance_2

Due to rounding, this invariant could sometimes be violated (although by
very small amounts).

This patch introduces an amendment `fixAMMRounding` that changes the
rounding to always favor the AMM. Doing this should maintain the
invariant.

Co-authored-by: Bronek Kozicki
Co-authored-by: thejohnfreeman
2026-02-20 07:06:56 +09:00
seelabs
88d3428249 Add global access to the current ledger rules:
It can be difficult to make transaction breaking changes to low level
code because the low level code does not have access to a ledger and the
current activated amendments in that ledger (the "rules"). This patch
adds global access to the current ledger rules as a `std::optional`. If
the optional is not seated, then there is no active transaction.
2026-02-20 07:06:56 +09:00
Snoppy
15f41c9777 chore: fix typos (#4958) 2026-02-20 07:06:55 +09:00
Ed Hennis
de142a1211 test: Add RPC error checking support to unit tests (#4987) 2026-02-20 07:06:54 +09:00
John Freeman
2187676f36 Ignore more commits 2026-02-20 07:06:54 +09:00
John Freeman
1cdca0a832 Address compiler warnings 2026-02-20 07:06:53 +09:00
John Freeman
384d8ed09b Add markers around source lists 2026-02-20 07:06:52 +09:00