Commit Graph

14190 Commits

Author SHA1 Message Date
Vito Tumas
a91c3b2872 Merge branch 'develop' into tapanito/vault-freeze-check 2026-06-25 14:39:00 +02:00
Vito
ea8c6ff96f fix: Authorize AMM pseudo-accounts holding vault shares
A pseudo-account that holds vault shares but not the underlying asset fails
requireAuth's recursive share->underlying check, which left an AMM unable to
read its own vault-share balance (read as zero via accountHolds) and blocked
the MPToken transfer invariant on AMM create.

Exempt pseudo-accounts before the recursive check in requireAuth, gated by
fixCleanup3_3_0 to preserve pre-amendment consensus, and treat them as
authorized in the MPToken transfer invariant (fork-safe: that invariant is
enforced only under MPTokensV2). Create and withdraw of AMM-held vault shares
now succeed once fixCleanup3_3_0 is enabled.

Add AMM/vault-share coverage and side-specific AMM_WITHDRAW freeze invariant
tests, and correct the pre-amendment test expectations: pre-fixCleanup3_3_0
the shares remain inaccessible to the pseudo-account, so the withdraw fails
with tecAMM_FAILED.
2026-06-25 14:34:22 +02:00
Vito
95ddd1d251 fix: move amendment permutation generation to env 2026-06-25 11:41:31 +02:00
Michael Legleux
556d62a0de build: Align xrpld RPM packaging with DEB package (#7529) 2026-06-24 23:53:46 +00:00
Ayaz Salikhov
eef8f4a4ff chore: Use clang-tidy v22 new features (#7427) 2026-06-24 17:23:29 +00:00
Ayaz Salikhov
4fec58251b build: Patch nix binaries in CMake (#7539)
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-06-24 13:56:18 +00:00
Ayaz Salikhov
8bbbc2051e chore: Check more tools to be available (#7600) 2026-06-24 12:25:03 +00:00
Mayukha Vadari
6736ab39df test: Add test for Permissioned Domain sequence fix (#7591)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-24 12:24:27 +00:00
Ayaz Salikhov
b68e1f7170 fix: Add pragma once checker (#7580) 2026-06-24 12:24:04 +00:00
Timothy Banks
bb7c4d1c9f fix: Additional RPC validation checks on ammRpcInfo account and amm_account fields. (#7324) 2026-06-24 12:23:12 +00:00
Zhiyuan Wang
69d289a388 fix: AMM Quality Leak into Domain BookStep for Permissioned DEX (#6853)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-24 12:15:45 +00:00
Jingchen
6341e75200 refactor: Refactor TaggedCache.ipp to remove const_cast in canonicalize_replace_cache (#5638)
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
2026-06-24 12:15:11 +00:00
Vito Tumas
0addb3f844 Update src/libxrpl/ledger/helpers/TokenHelpers.cpp
Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com>
2026-06-24 13:50:37 +02:00
Vito
1e135ab007 Merge remote-tracking branch 'origin/develop' into tapanito/vault-freeze-check 2026-06-24 12:17:31 +02:00
Vito
c3e8bba585 assertion typo 2026-06-24 12:17:23 +02:00
Vito
cdbc52f785 clang-tidy 2026-06-24 12:14:52 +02:00
Vito
d77da248e7 address review feedback 2026-06-24 12:13:27 +02:00
Vito
b2b240e9d5 refactor: extract amendmentCombinations; document vault-share freeze checks
- Move amendmentCombinations algorithm to jtx::amendmentCombinations in
  test/jtx/utility.h+cpp; it was copy-pasted into both AMM_test and
  AMMMPT_test. AMM_test retains a one-liner wrapper that seeds from its
  local testableAmendments() (strips SAV/Lending).
- Document the isVaultPseudoAccountFrozen sub-step in the Doxygen for
  checkWithdrawFreeze and checkDepositFreeze; the MPT-only transitive
  freeze check occurs between the listed steps 1 and 2 in each function.
- Expand the IgnoreFreeze comment in VaultWithdraw::doApply to explain
  why preclaim validation makes the flag safe to use post-fix330.
2026-06-24 11:12:17 +02:00
Vito
f3d15671ec tests: add vault-share freeze checks in AMM operations
Adds testAMMWithVaultShares to AMMMPT_test verifying that underlying-asset
freeze propagates to vault shares in AMM deposit/withdraw, pre- and
post-fixCleanup3_3_0.

Prerequisite fixes that unblocked the test:
- MPTokenHelpers: move pseudo-account exemption before the recursive
  vault-underlying check in requireAuth so AMM pseudo-accounts are not
  rejected when holding vault shares whose underlying needs auth.
- MPTInvariant: gate isVaultPseudoAccountFrozen on fixCleanup3_3_0;
  pre-amendment AMM withdrawals of vault shares are permitted even when
  the underlying is individually frozen.
- TokenHelpers: remove dead checkIndividualDeepFrozen and forward decl
  for isLPTokenFrozen (both unused after earlier refactor).
2026-06-24 11:11:51 +02:00
Vito
786a163517 tests: invariant test for vault-share freeze gate
Add a test to testMPT() in Invariants_test.cpp that verifies the
ValidMPTTransfer invariant correctly gates isVaultPseudoAccountFrozen
on fixCleanup3_3_0.

The test creates an IOU vault whose shares are held by two accounts,
then freezes the underlying IOU for one account (a1). It simulates a
vault-share transfer by directly modifying the MPToken SLEs:

- post-fixCleanup3_3_0: isVaultPseudoAccountFrozen finds a1's underlying
  IOU frozen → invalidTransfer → "invalid MPToken transfer between
  holders" → tecINVARIANT_FAILED.

- pre-fixCleanup3_3_0: the vault-underlying check is not called;
  the transfer is allowed even though the underlying IOU is frozen
  → tesSUCCESS.
2026-06-24 10:37:43 +02:00
yinyiqian1
5a2c82f699 fix: Reject delegate permission to pseudo accounts (#7597) 2026-06-23 19:55:23 +00:00
Jingchen
0b22050b5e ci: Update workflows and conan to use VS2026 and grpc 1.81.0 (#7550)
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2026-06-23 19:25:38 +00:00
Vito
799f126bf4 removes junk files 2026-06-23 18:48:10 +02:00
Vito
44af7c2ae3 adds explicit pseudo-account freeze handling 2026-06-23 18:47:13 +02:00
Vito
8edf2538a9 tests: adds explict IOU self-withdrawal tests 2026-06-23 15:11:34 +02:00
Vito
884d1591a7 fix: removes redundant global freeze checks 2026-06-23 14:14:29 +02:00
Bart
ff02269c0d refactor: Use dispatch instead of post (#7438)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-06-22 22:35:28 +00:00
Vito
1a3aed2b9f Merge remote-tracking branch 'origin/develop' into tapanito/vault-freeze-check 2026-06-22 20:56:15 +02:00
Mayukha Vadari
dd7401fde2 refactor: Clean up tec object deletion logic (#6588)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-06-22 18:44:42 +00:00
Zhiyuan Wang
19a9ed7767 fix: Move AMMInvariant weakInvariantCheck logic into the transaction (#7032) 2026-06-22 18:42:57 +00:00
Zhiyuan Wang
93eab33dc2 fix: Improve ValidAMM invariant (#7295) 2026-06-22 17:45:42 +00:00
yinyiqian1
997267f845 feat: Remove clear mutable flags for DynamicMPT XLS-94 (#7439) 2026-06-22 17:36:06 +00:00
Ayaz Salikhov
e29b523620 ci: Build and push docker images in forks too (#7588) 2026-06-22 17:00:40 +00:00
Vito
19deac29a8 clang-tidy 2026-06-22 16:49:05 +02:00
Vito
0e3cd2e4f7 fix: failing unit-tests 2026-06-22 16:26:07 +02:00
dependabot[bot]
b1f794f067 ci: [DEPENDABOT] bump actions/checkout from 6.0.3 to 7.0.0 (#7585)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 13:39:38 +00:00
Vito
e0872d9094 Merge remote-tracking branch 'origin/develop' into tapanito/vault-freeze-check 2026-06-22 15:33:29 +02:00
Vito
4acefde7b0 fix: Add missing initializer_list include in AMM_test
clang-tidy include-cleaner flagged amendmentCombinations using
std::initializer_list without a direct include.
2026-06-22 13:52:19 +02:00
Vito
53e5c8c6ae fix: Align pseudo-account withdraw freeze handling for issuer redemption
Restore unconditional IgnoreFreeze in VaultWithdraw::doApply when
fixCleanup3_3_0 is enabled. That accountHolds reads the submitter's
share balance, which recurses into the underlying asset, so freeze
gating must stay in preclaim; a dstAcct==issuer guard there wrongly
blocked self-withdrawal under a regular freeze.

Apply issuer-aware freeze handling to LoanBrokerCoverWithdraw::preclaim
so the issuer can redeem their own token from the broker pseudo-account
even under a global freeze, matching AMM and Vault. Here accountHolds
reads the pseudo-account's holdings, so the issuer-only IgnoreFreeze is
both necessary and sufficient.

Rename the checkWithdrawFreeze source parameter to srcAcct to match its
definition, drop a misleading comment, and hoist the fixCleanup feature
flags into named locals.
2026-06-22 13:52:12 +02:00
Vito
72f96cbd67 undo nix/devshell.nix changes 2026-06-22 12:14:38 +02:00
Vito
0ce3751756 fix: typo in assertion 2026-06-22 12:10:01 +02:00
Vito
7b63288497 fix: Unify AMM Deposit/Withdraw freeze checks with checkDepositFreeze/checkWithdrawFreeze
Migrate AMMDeposit and AMMWithdraw to use the unified freeze helpers
introduced for Vault and LoanBroker, gated on fixCleanup3_3_0.

AMMDeposit: checkDepositFreeze for both pool assets replaces the
two-layer checkAsset + checkAmount freeze logic. If either pool asset
is frozen (depositor or AMM account), all deposits are blocked.

AMMWithdraw: checkWithdrawFreeze per withdrawn amount replaces
checkFrozen(AMM) + checkIndividualFrozen(user). Regular IOU freeze
no longer blocks self-withdrawal; only deep freeze does. The issuer
exemption allows the token issuer to withdraw from a frozen pool;
issuerFreezeHandling() ensures doApply uses IgnoreFreeze so pool
math does not divide by zero.

Rename checkWithdrawFreezes -> checkWithdrawFreeze (singular) and
update all callers. Document both helpers with full freeze semantics.
2026-06-22 12:09:55 +02:00
Michael Legleux
b6a1ad5bb3 fix: Ensure xrpld service directories exist at startup (#7565) 2026-06-18 19:21:12 +00:00
Vito Tumas
34b4bb43af Merge branch 'develop' into tapanito/vault-freeze-check 2026-06-18 20:01:00 +02:00
Vito
2b6b277a1b test: Add testVaultDepositFreeze and testVaultWithdrawFreeze
Extract all IOU freeze and MPT lock tests from testWithIOU and
testWithMPT into two focused test functions covering VaultDeposit
and VaultWithdraw respectively.

Each function tests both IOU (global, depositor regular/deep,
vault-account regular/deep) and MPT (global lock, depositor lock,
vault-account lock) for both pre- and post-fixCleanup3_3_0, plus
clawback-while-frozen assertions.
2026-06-18 16:54:14 +02:00
Vito
cfd3d51338 adds unified freeze checks for CoverDeposit 2026-06-18 15:43:39 +02:00
yinyiqian1
772ea80a25 fix: Use template for granular delegation permissions (#6613)
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-06-17 23:20:54 +00:00
solunolab
480676d0bf docs: Fix some comments to improve readability (#7405)
Signed-off-by: solunolab <solunolab@outlook.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2026-06-17 13:55:00 +00:00
Michael Legleux
f07de6c454 ci: Disable assertions on Release builds (#7443) 2026-06-17 13:54:55 +00:00
Ayaz Salikhov
cb2642be05 build: Add graphviz to Nix images (#7566) 2026-06-17 13:54:46 +00:00