Commit Graph

14178 Commits

Author SHA1 Message Date
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
Pratik Mankawde
7e0ff536f5 refactor: Rerevert "Explicitly trim the heap after cache sweeps (#6022)"
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-06-17 13:31:43 +01:00
Pratik Mankawde
044ca7719d release: Bump version to 3.3.0-b0
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-06-17 12:58:01 +01:00
Pratik Mankawde
cccce1c32e Merge remote-tracking branch 'origin/release/3.2.x' into pratik/merge_3.2.x
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-06-17 12:53:02 +01:00
Ayaz Salikhov
5de434436e ci: Make clang-tidy workflow adjustments to stay in sync with Clio (#7563) 2026-06-17 10:02:17 +00:00
Ayaz Salikhov
45ddc1d868 build: Add git-lfs to Nix images (#7561) 2026-06-16 23:13:33 +00:00
Ayaz Salikhov
7b9d55326d build: Add zip to Nix images (#7551) 2026-06-16 17:35:33 +00:00
Ayaz Salikhov
0364e4dc41 docs: Rewrite build environment docs (#7533)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-06-16 13:24:12 +00:00
Ayaz Salikhov
3c43f4614f release: Bump version to 3.2.0 3.2.0 2026-06-15 19:46:56 -04:00
dependabot[bot]
6b63f0ff61 ci: [DEPENDABOT] bump codecov/codecov-action from 6.0.1 to 7.0.0 (#7426)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-15 19:46:49 -04:00
Bart
0ac8e6cf1e release: Bump version to 3.2.0-rc6 2026-06-15 22:24:03 +01:00
Vito Tumas
ed5f13481a fix: Disable transaction invariants 2026-06-15 22:24:03 +01:00
Vito Tumas
781ef175c9 perf: Dispatch "hasInvalidAmount()" on type tag instead of dynamic_cast 2026-06-15 22:24:03 +01:00