Skip to content

Permissioned DEX #5404

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

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

Permissioned DEX #5404

wants to merge 32 commits into from

Conversation

shawnxie999
Copy link
Collaborator

@shawnxie999 shawnxie999 commented Apr 16, 2025

High Level Overview of Change

https://github.com/XRPLF/XRPL-Standards/pull/281/files#diff-35a11d4d87e9deea6056a8e974075ece34ffb081689d0afb8a85b6d9bcded756

Context of Change

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)

@shawnxie999 shawnxie999 marked this pull request as ready for review April 16, 2025 14:58
@shawnxie999 shawnxie999 changed the title Perm Dex (DRAFT) Perm Dex Apr 16, 2025
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

Attention: Patch coverage is 92.11470% with 22 lines in your changes missing coverage. Please review.

Project coverage is 78.8%. Comparing base (2a61aee) to head (bd1d225).

Files with missing lines Patch % Lines
src/xrpld/rpc/detail/TransactionSign.cpp 28.6% 5 Missing ⚠️
src/xrpld/rpc/handlers/Unsubscribe.cpp 16.7% 5 Missing ⚠️
src/xrpld/app/paths/PathRequest.cpp 70.0% 3 Missing ⚠️
src/xrpld/app/ledger/OrderBookDB.cpp 95.1% 2 Missing ⚠️
src/xrpld/app/misc/PermissionedDEXHelpers.cpp 93.1% 2 Missing ⚠️
src/xrpld/app/tx/detail/CreateOffer.cpp 96.7% 2 Missing ⚠️
src/xrpld/rpc/BookChanges.h 66.7% 2 Missing ⚠️
src/xrpld/rpc/handlers/Subscribe.cpp 83.3% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5404     +/-   ##
=========================================
+ Coverage     78.6%   78.8%   +0.2%     
=========================================
  Files          816     817      +1     
  Lines        70505   70746    +241     
  Branches      8288    8238     -50     
=========================================
+ Hits         55448   55752    +304     
+ Misses       15057   14994     -63     
Files with missing lines Coverage Δ
include/xrpl/protocol/Book.h 100.0% <100.0%> (ø)
include/xrpl/protocol/ErrorCodes.h 100.0% <ø> (ø)
include/xrpl/protocol/UintTypes.h 100.0% <ø> (ø)
include/xrpl/protocol/detail/ledger_entries.macro 100.0% <ø> (ø)
include/xrpl/protocol/detail/transactions.macro 100.0% <ø> (ø)
src/libxrpl/protocol/Book.cpp 100.0% <100.0%> (ø)
src/libxrpl/protocol/ErrorCodes.cpp 85.7% <ø> (ø)
src/libxrpl/protocol/Indexes.cpp 96.9% <100.0%> (+0.1%) ⬆️
src/libxrpl/protocol/InnerObjectFormats.cpp 100.0% <100.0%> (ø)
src/xrpld/app/paths/Flow.cpp 96.4% <ø> (ø)
... and 25 more

... and 5 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oleks-rip
Copy link
Collaborator

Please fix the clang-format and clang builds

@yinyiqian1
Copy link
Collaborator

Would you mind adding the spec link to the PR? If the implementation differs from the spec, could you please clarify the differences?

@shawnxie999 shawnxie999 requested a review from a team as a code owner May 13, 2025 14:49
@shawnxie999 shawnxie999 changed the title Permission DEX Permissioned DEX May 13, 2025
Copy link
Collaborator

@oleks-rip oleks-rip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@gregtatcam gregtatcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@shawnxie999 shawnxie999 added Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. Perf Attn Needed Attention needed from RippleX Performance Team labels May 15, 2025
@bthomee bthomee added this to the 2.5.0 (Q2 2025) milestone May 16, 2025
@bthomee bthomee requested a review from a1q123456 May 16, 2025 10:33
Copy link
Collaborator

@godexsoft godexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPC changes look reasonable for Clio.

Copy link
Collaborator

@a1q123456 a1q123456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some minor cosmetic issues, please take a look.

@@ -120,10 +124,16 @@ OrderBookDB::update(std::shared_ptr<ReadView const> const& ledger)
book.in.account = sle->getFieldH160(sfTakerPaysIssuer);
book.out.currency = sle->getFieldH160(sfTakerGetsCurrency);
book.out.account = sle->getFieldH160(sfTakerGetsIssuer);
book.domain = (*sle)[~sfDomainID];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to do something like book.domain = sle->at(~sfDomainID); to avoid this syntax

Copy link
Collaborator Author

@shawnxie999 shawnxie999 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current syntax is fine and widely used across the codebase. Is there a reason why is one preferred over the other?

@@ -278,7 +326,8 @@ OrderBookDB::processTxn(
{
auto listeners = getBookListeners(
{data->getFieldAmount(sfTakerGets).issue(),
data->getFieldAmount(sfTakerPays).issue()});
data->getFieldAmount(sfTakerPays).issue(),
(*data)[~sfDomainID]});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as line 127

@shawnxie999 shawnxie999 requested a review from a1q123456 May 20, 2025 16:01
Copy link

@mathbunnyru mathbunnyru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you have a bug because std::nullopt is a default param.

src/libxrpl/protocol/Book.cpp:51:

Book
reversed(Book const& book)
{
    return Book(book.out, book.in);
}

Note: there might be other places as well, so it's better to be safe and don't have default param.

@shawnxie999 shawnxie999 requested a review from mathbunnyru May 23, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Amendment API Change Perf Attn Needed Attention needed from RippleX Performance Team Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants