fixAMMClawbackRounding: adjust last holder's LPToken balance#5513
fixAMMClawbackRounding: adjust last holder's LPToken balance#5513bthomee merged 10 commits intoXRPLF:developfrom
Conversation
d83e7c9 to
8058476
Compare
8058476 to
5a645ff
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5513 +/- ##
=========================================
- Coverage 79.1% 79.0% -0.0%
=========================================
Files 816 816
Lines 71632 71652 +20
Branches 8237 8263 +26
=========================================
- Hits 56648 56639 -9
- Misses 14984 15013 +29
🚀 New features to boost your workflow:
|
gregtatcam
left a comment
There was a problem hiding this comment.
AMMClawback logs a bunch of errors like
ERR:OpenLedger AMM 31 invariant failed: 8A5A159FDA51F5E9841D2C80FD488DD47014FFE4F5948235D7B5AE7B957D248D true 565.685424949238/USD/r9QxhA9RghPZBbUchA9HkrmLKaWvkLXU29 70710678/XRP 199999.9998321968 200000 0.0000000008390160007039478
This is normal but it makes parsing unit-tests output difficult. These errors can be inhibited like this
Env env(*this, features, std::make_unique<CaptureLogs>(&logs));
You can search CaptureLogs for examples.
f13a220 to
ee978e1
Compare
ee978e1 to
61a702d
Compare
…refactoring-1 * upstream/develop: (56 commits) Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) chore: Fix compilation error with clang-20 and cleanup (#5543) test: Remove circular jtx.h dependencies (#5544) Decouple CredentialHelpers from xrpld/app/tx (#5487) fix: crash when trace-logging in tests (#5529) test: switch some unit tests to doctest (#5383) ...
…actoring-2 * ximinez/lending-refactoring-1: (57 commits) Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) chore: Fix compilation error with clang-20 and cleanup (#5543) test: Remove circular jtx.h dependencies (#5544) Decouple CredentialHelpers from xrpld/app/tx (#5487) fix: crash when trace-logging in tests (#5529) ...
…actoring-3 * ximinez/lending-refactoring-2: (57 commits) Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) chore: Fix compilation error with clang-20 and cleanup (#5543) test: Remove circular jtx.h dependencies (#5544) Decouple CredentialHelpers from xrpld/app/tx (#5487) fix: crash when trace-logging in tests (#5529) ...
…actoring-4 * ximinez/lending-refactoring-3: (61 commits) fixup! Rename Transactor preflight functions Rename Transactor preflight functions fixup! Make preflight1 and preflight2 private static Transactor functions Make preflight1 and preflight2 private static Transactor functions Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) ...
…actoring-4 * ximinez/lending-refactoring-3: (61 commits) fixup! Rename Transactor preflight functions Rename Transactor preflight functions fixup! Make preflight1 and preflight2 private static Transactor functions Make preflight1 and preflight2 private static Transactor functions Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) ... Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com> Co-authored-by: Bronek Kozicki <brok@incorrekt.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com> Co-authored-by: Denis Angell <dangell@transia.co> Co-authored-by: Vlad <129996061+vvysokikh1@users.noreply.github.com> Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com> Co-authored-by: yinyiqian1 <yqian@ripple.com> Co-authored-by: Michael Legleux <legleux@users.noreply.github.com> Co-authored-by: Bart <bthomee@users.noreply.github.com> Co-authored-by: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com> Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Co-authored-by: Luc des Trois Maisons <3maisons@gmail.com> Co-authored-by: Valentin Balaschenko <13349202+vlntb@users.noreply.github.com> fix: crash when trace-logging in tests (#5529) Fix compilation error with clang-20 and cleanup (#5543) fix: Link with boost libraries explicitly (#5546) fix: add allowTrustLineLocking flag for account_info (#5525) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) Fix macos runner (#5585) Fix clang-format CI job (#5598) resolved actions/runner#2058.
|
@yinyiqian1 would you like to create a new PR to switch |
Sure. Just created: #5750 |
Overview of
fixAMMClawbackRounding: Due to rounding, the LPTokenBalance of the last LP might not match the LP's trustline balance, this was fixed forAMMWithdrawinfixAMMv1_1by adjusting the LPTokenBalance to be the same as trustline balance.Since
AMMClawbackis also performing a withdrawal, we need to adjust LPTokenBalance as well inAMMClawback.This PR includes:
verifyAndAdjustLPTokenBalancefunction toAMMUtils.AMMWithdrawandAMMClawbackboth call this function to adjust LPTokenBalance.testLastHolderLPTokenBalanceto test the scenario.fixAMMClawbackRounding. Added some minor changes, for example, variablealiceXrpBalanceis updated after each transaction to make checking xrp balance easier.High Level Overview of Change
Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)