Skip to content
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

Add MPT support to DEX #5285

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

gregtatcam
Copy link
Collaborator

High Level Overview of Change

Add MPT support to DEX

Context of Change

Implements XLS-82d

Adds MPT support for the following transactions:

  • Payment
  • OfferCreate
  • CheckCash
  • All AMM transactions
  • Pathfinding

Retires FlowCross feature.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

Test Plan

Extended MPToken unit-test to test for basic MPT interactions with DEX.

Significant number of unit-tests must be added to test all aspects of MPT interactions with DEX. Essentially all current unit-tests designed to test IOU interactions with DEX must be replicated for MPT. This is work in progress.

@gregtatcam gregtatcam force-pushed the feature/mpt-v2e branch 3 times, most recently from 0f1e958 to 5134103 Compare February 12, 2025 14:47
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 85.52328% with 314 lines in your changes missing coverage. Please review.

Project coverage is 78.1%. Comparing base (3a55a64) to head (5134103).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/xrpld/app/paths/detail/MPTEndpointStep.cpp 74.4% 86 Missing ⚠️
src/libxrpl/protocol/STParsedJSON.cpp 52.0% 24 Missing ⚠️
src/xrpld/app/paths/PathRequest.cpp 78.7% 19 Missing ⚠️
src/xrpld/rpc/BookChanges.h 0.0% 18 Missing ⚠️
src/xrpld/app/tx/detail/CashCheck.cpp 84.4% 17 Missing ⚠️
src/xrpld/app/tx/detail/AMMCreate.cpp 85.5% 11 Missing ⚠️
src/xrpld/app/tx/detail/AMMWithdraw.cpp 88.2% 10 Missing ⚠️
src/xrpld/app/tx/detail/InvariantCheck.cpp 82.0% 9 Missing ⚠️
src/xrpld/app/tx/detail/Transactor.cpp 55.0% 9 Missing ⚠️
include/xrpl/protocol/AmountConversions.h 77.1% 8 Missing ⚠️
... and 32 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5285     +/-   ##
=========================================
- Coverage     78.2%   78.1%   -0.1%     
=========================================
  Files          790     793      +3     
  Lines        67639   68233    +594     
  Branches      8161    8256     +95     
=========================================
+ Hits         52865   53260    +395     
- Misses       14774   14973    +199     
Files with missing lines Coverage Δ
include/xrpl/protocol/AMMCore.h 100.0% <ø> (ø)
include/xrpl/protocol/Asset.h 97.3% <100.0%> (+2.5%) ⬆️
include/xrpl/protocol/Feature.h 100.0% <ø> (ø)
include/xrpl/protocol/Indexes.h 100.0% <ø> (ø)
include/xrpl/protocol/MPTAmount.h 87.9% <100.0%> (-12.1%) ⬇️
include/xrpl/protocol/MPTIssue.h 100.0% <100.0%> (ø)
include/xrpl/protocol/STObject.h 92.9% <ø> (ø)
include/xrpl/protocol/TER.h 100.0% <ø> (ø)
include/xrpl/protocol/detail/ledger_entries.macro 100.0% <ø> (ø)
include/xrpl/protocol/detail/transactions.macro 100.0% <ø> (ø)
... and 92 more

... and 7 files with indirect coverage changes

Impacted file tree graph

@shawnxie999
Copy link
Collaborator

haven't reviewed the changes but one invariant would be good to have is to ensure that the amount changed for OutstandingBalance in MPTokenIssuance should equal the net change of all the MPTokens modified in the transaction

@gregtatcam gregtatcam force-pushed the feature/mpt-v2e branch 5 times, most recently from 8e91fa9 to 9962c46 Compare March 5, 2025 17:00
* Payment
* OfferCreate
* CheckCash
* All AMM transactions
* Pathfinding

Retire FlowCross feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants