-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed 2.2.0-rc2 #5018
Merged
Merged
Proposed 2.2.0-rc2 #5018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am resigning from my role as maintainer of the `rippled` codebase. Please update repository permissions accordingly, prior to merging this pull request. Thanks to everyone who has contributed, especially those whom I had the opportunity to closely collaborate with.
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.
…PLF#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>
* 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.
The fix is to return the actual adjusted lp tokens and amounts by the function.
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().
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.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release #5018 +/- ##
=========================================
+ Coverage 70.9% 71.1% +0.2%
=========================================
Files 796 796
Lines 66792 66997 +205
Branches 10998 10979 -19
=========================================
+ Hits 47378 47633 +255
+ Misses 19414 19364 -50
|
scottschurr
approved these changes
May 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds, passes unit tests, syncs, and shuts down cleanly for me on macOS. 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
This is a release candidate for the 2.2.0 release.
Highlights:
The base branch is
release
. All releases (including betas) go inrelease
. This PR will be merged with--ff-only
(not squashed or rebased, and not using the GitHub UI) to bothrelease
anddevelop
.Context of Change
This introduces
fixAMMv1_1
amendment which fixes several issues with the AMM including: low quality lob offers blocking AMM offers, fixing how transfer fees are handled with the AMM, fixing an issue with an internal function that adjust amounts by lp tokens, and fixing an issue when the lp token balance of the last liquidity provider does not match the LPTokenBalance (due to floating point issues).It also introduces the first step in a physical code reorganization, unit test utilities to test RPC calls, and a global
Rules
object for transaction processing.Type of Change
API Impact
No API impact.