Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a2bdd34
resolve other pathing unittest outside pathtest, and fix formatting
shortthefomo Jun 3, 2026
37ebcd7
drop Pathfinder::initPathTable() no longer used and fix all clang-tid…
shortthefomo Jun 3, 2026
a87f061
pathfinding: eager PayGraph build at OB-ready and oversample Yen's k-…
shortthefomo Jun 4, 2026
87b1815
Merge branch 'develop' of github-shortthefomo:shortthefomo/rippled in…
shortthefomo Jun 4, 2026
cbab8ab
pathfinding: drop per-asset context_ carry-over so each tick reflects…
shortthefomo Jun 4, 2026
26e5b35
ci: fix unused-private-field, deprecated atomic shared_ptr, and inclu…
shortthefomo Jun 4, 2026
2c899e3
ci: fall back to atomic shared_ptr free functions wrapped with deprec…
shortthefomo Jun 4, 2026
68e4b83
fix cspell issues.
shortthefomo Jun 4, 2026
b744231
right pre-commit run and i dont need to step through each issue.
shortthefomo Jun 5, 2026
effcdb7
Merge branch 'develop' into pathfinding-2
shortthefomo Jun 5, 2026
097478e
fix contradiction to definition in example config
shortthefomo Jun 5, 2026
e3099f4
Merge develop into pathfinding-2
shortthefomo Jun 5, 2026
a9b1a28
test: add unit tests for OrderBookDB and PayGraph to improve coverage
shortthefomo Jun 6, 2026
58b84a5
test: add unit tests for GraphPathfinder to improve coverage
shortthefomo Jun 6, 2026
1913f40
test: add 12 PathRequest unit tests for parseJson, isValid, and state…
shortthefomo Jun 6, 2026
66e5e37
test: add unit tests for PathRequestManager to improve coverage
shortthefomo Jun 6, 2026
ca75bb6
Add Pathfinding 2.0 gap coverage tests and fix pathSearch config rena…
shortthefomo Jun 6, 2026
f339c69
Fix integer overflow in qualityToFixed by using 128-bit arithmetic
shortthefomo Jun 6, 2026
d0c7653
Merge develop into pathfinding-2 branch
shortthefomo Jul 6, 2026
c83e9c6
fix, Top-of-book weights would ignore liquidity depth and exchange ra…
shortthefomo Jul 6, 2026
0aed926
Merge develop into pathfinding-2
shortthefomo Jul 18, 2026
7de601a
Skip Flow exceptions when the AMM are invariant marked
shortthefomo Jul 18, 2026
5493e04
clang format
shortthefomo Jul 18, 2026
d77c492
target only path find for the Flow Exception skip so we dont touch co…
shortthefomo Jul 18, 2026
0a48d49
add the missing changes attempt2, target only path find for the Flow …
shortthefomo Jul 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ overrides:
- /'[^']*'/g # single-quoted strings
- /`[^`]*`/g # backtick strings
suggestWords:
- unsynched->unsynced
- xprl->xrpl
- xprld->xrpld # cspell: disable-line not sure what this problem is....
- unsynched->unsynced # cspell: disable-line not sure what this problem is....
- synched->synced
- synch->sync
words:
Expand All @@ -58,7 +60,6 @@ words:
- autobridging
- bimap
- bindir
- blindings
- bookdir
- Bougalis
- Britto
Expand All @@ -85,7 +86,6 @@ words:
- coro
- coros
- cowid
- cpack
- cryptocondition
- cryptoconditional
- cryptoconditions
Expand All @@ -96,6 +96,7 @@ words:
- daria
- dcmake
- dearmor
- dedupe
- decryptor
- dedented
- deleteme
Expand All @@ -108,11 +109,9 @@ words:
- distro
- doxyfile
- dxrpl
- elgamal
- enabled
- enablerepo
- endmacro
- envrc
- exceptioned
- EXPECT_STREQ
- Falco
Expand All @@ -122,7 +121,6 @@ words:
- fmtdur
- fsanitize
- funclets
- Gamal
- gcov
- gcovr
- ghead
Expand Down Expand Up @@ -161,18 +159,23 @@ words:
- libpb
- libxrpl
- llection
- localised
- LOCALGOOD
- logwstream
- lseq
- lsmf
- ltype
- materialisations
- materialises
- materialised
- mathbunnyru
- mcmodel
- MEMORYSTATUSEX
- MPTAMM
- MPTDEX
- Merkle
- Metafuncton
- minimisation
- misprediction
- missingok
- mptbalance
Expand All @@ -192,6 +195,7 @@ words:
- multisign
- multisigned
- Nakamoto
- neighbours
- nftid
- nftoffer
- nftoken
Expand Down Expand Up @@ -220,7 +224,6 @@ words:
- partitioner
- paychan
- paychans
- Pedersen
- permdex
- perminute
- permissioned
Expand All @@ -239,15 +242,9 @@ words:
- pyenv
- pyparsing
- qalloc
- qbsprofile
- queuable
- Raphson
- rcflags
- replayer
- rerandomize
- rerandomization
- rerandomized
- rerandomizes
- rerere
- retriable
- RIPD
Expand All @@ -267,10 +264,10 @@ words:
- sahyadri
- Satoshi
- scons
- Schnorr
- secp
- sendq
- seqit
- Serialises
- sf
- SFIELD
- sfields
Expand Down Expand Up @@ -300,9 +297,10 @@ words:
- stvar
- stvector
- stxchainattestations
- summands
- superpeer
- superpeers
- specialisation
- summands
- takergets
- takerpays
- ters
Expand All @@ -319,7 +317,6 @@ words:
- txs
- ubsan
- UBSAN
- ufdio
- umant
- unacquired
- unambiguity
Expand All @@ -331,6 +328,7 @@ words:
- unflatten
- unfund
- unimpair
- unranked
- unroutable
- unscalable
- unserviced
Expand Down
29 changes: 3 additions & 26 deletions cfg/xrpld-example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -773,33 +773,10 @@
#
#
# [path_search]
# When searching for paths, the default search aggressiveness. This can take
# exponentially more resources as the size is increased.
# Set to 1 to enable path finding, or 0 to disable it.
# Path finding is disabled by default; set to 1 to enable it.
#
# The recommended value to support advanced pathfinding is: 7
#
# The default is: 2
#
# [path_search_fast]
# [path_search_max]
# When searching for paths, the minimum and maximum search aggressiveness.
#
# If you do not need pathfinding, you can set path_search_max to zero to
# disable it and avoid some expensive bookkeeping.
#
# To support advanced pathfinding the recommended value for
# 'path_search_fast' is 2, and for 'path_search_max' is 10.
#
# The default for 'path_search_fast' is 2. The default for 'path_search_max' is 3.
#
# [path_search_old]
#
# For clients that use the legacy path finding interfaces, the search
# aggressiveness to use.
#
# The recommended value to support advanced pathfinding is: 7.
#
# The default is: 2
# The default is: 0
#
#
#
Expand Down
12 changes: 12 additions & 0 deletions include/xrpl/ledger/OrderBookDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ class OrderBookDB
*/
virtual bool
isBookToXRP(Asset const& asset, std::optional<Domain> const& domain = std::nullopt) = 0;

/** Get all assets that appear as takerPays in any known order book.

Used by pathfinding to seed vertex discovery so that
non-XRP-rooted assets are always included even when they have no
direct XRP book.

@param domain Optional domain restriction
@return Vector of all known takerPays assets
*/
virtual std::vector<Asset>
getAllTakerPaysAssets(std::optional<Domain> const& domain = std::nullopt) = 0;
};

/**
Expand Down
8 changes: 8 additions & 0 deletions include/xrpl/tx/paths/detail/Steps.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,19 @@ class FlowException : public std::runtime_error
{
public:
TER ter;
// When set, the AMM pool (book pair) that failed. Path_find may record
// this hop in PathRequestManager; consensus payment flow never consults it.
std::optional<Book> ammBook;

FlowException(TER t, std::string const& msg) : std::runtime_error(msg), ter(t)
{
}

FlowException(TER t, std::string const& msg, Book const& amm)
: std::runtime_error(msg), ter(t), ammBook(amm)
{
}

explicit FlowException(TER t) : std::runtime_error(transHuman(t)), ter(t)
{
}
Expand Down
5 changes: 4 additions & 1 deletion src/libxrpl/tx/paths/BookStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,10 @@ BookStep<TIn, TOut, TDerived>::consumeOffer(
// when the amendment isn't active.
if (sb.rules().enabled(fixAMMOverflowOffer))
{
Throw<FlowException>(tecINVARIANT_FAILED, "AMM pool product invariant failed.");
// Attach the book so path_find can record the hop if it catches
// this exception. Never write/read any blacklist here — AMM
// participation in consensus payment flow must stay deterministic.
Throw<FlowException>(tecINVARIANT_FAILED, "AMM pool product invariant failed.", book_);
}
}

Expand Down
27 changes: 24 additions & 3 deletions src/libxrpl/tx/transactors/payment/Payment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,17 +439,38 @@ Payment::preclaim(PreclaimContext const& ctx)
{
STPathSet const& paths = ctx.tx.getFieldPathSet(sfPaths);

if (paths.size() > kMaxPathSize || std::ranges::any_of(paths, [](STPath const& path) {
return path.size() > kMaxPathLength;
}))
// Validate path count and length with detailed logging
if (paths.size() > kMaxPathSize)
{
JLOG(ctx.j.error()) << "Payment rejected: Too many paths (" << paths.size() << " > "
<< kMaxPathSize << ")";
// Open view: the soft tel (unchanged). Inner batch txns are claimed
// on a closed view, where a tel is invalid, so use the tef.
if (ctx.view.open())
return telBAD_PATH_COUNT;
if (ctx.parentBatchId && ctx.view.rules().enabled(featureBatchV1_1))
return tefBAD_PATH_COUNT;
}

// Check each path for length violations and log details
for (std::size_t i = 0; i < paths.size(); ++i)
{
if (paths[i].size() > kMaxPathLength)
{
JLOG(ctx.j.error()) << "Payment rejected: Path " << i << " exceeds maximum length ("
<< paths[i].size() << " > " << kMaxPathLength << ")";
// Log the path elements for debugging
JLOG(ctx.j.debug()) << "Path " << i << " has " << paths[i].size()
<< " elements (max allowed: " << kMaxPathLength << ")";

// Open view: the soft tel (unchanged). Inner batch txns are claimed
// on a closed view, where a tel is invalid, so use the tef.
if (ctx.view.open())
return telBAD_PATH_COUNT;
if (ctx.parentBatchId && ctx.view.rules().enabled(featureBatchV1_1))
return tefBAD_PATH_COUNT;
}
}
}

if (auto const err = credentials::valid(ctx.tx, ctx.view, ctx.tx[sfAccount], ctx.j);
Expand Down
9 changes: 8 additions & 1 deletion src/test/app/Offer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <test/jtx/acctdelete.h>
#include <test/jtx/amount.h>
#include <test/jtx/balance.h>
#include <test/jtx/envconfig.h>
#include <test/jtx/fee.h>
#include <test/jtx/flags.h>
#include <test/jtx/jtx_json.h>
Expand Down Expand Up @@ -4330,7 +4331,13 @@ class OfferBaseUtil_test : public beast::unit_test::Suite
testcase("RippleConnect Smoketest payment flow");
using namespace jtx;

Env env{*this, features};
Env env(
*this,
envconfig([](std::unique_ptr<Config> cfg) {
cfg->pathSearch = true;
return cfg;
}),
features);

// This test mimics a payment flow. The players:
// A USD gateway with hot and cold wallets
Expand Down
4 changes: 1 addition & 3 deletions src/test/app/PathMPT_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ class PathMPT_test : public beast::unit_test::Suite
// with the search parameters that the tests were written for.
using namespace jtx;
return Env(*this, envconfig([](std::unique_ptr<Config> cfg) {
cfg->pathSearchOld = 7;
cfg->pathSearch = 7;
cfg->pathSearchMax = 10;
cfg->pathSearch = true;
return cfg;
}));
}
Expand Down
Loading
Loading