Skip to content

Permission 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 20 commits into
base: develop
Choose a base branch
from
Open

Permission DEX #5404

wants to merge 20 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 93.81818% with 17 lines in your changes missing coverage. Please review.

Project coverage is 78.3%. Comparing base (405f461) to head (36b7899).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/xrpld/rpc/detail/TransactionSign.cpp 28.6% 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.5% 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.1%   78.3%   +0.2%     
=========================================
  Files          795     796      +1     
  Lines        68598   68838    +240     
  Branches      8283    8230     -53     
=========================================
+ Hits         53580   53886    +306     
+ Misses       15018   14952     -66     
Files with missing lines Coverage Δ
include/xrpl/protocol/Book.h 100.0% <100.0%> (ø)
include/xrpl/protocol/ErrorCodes.h 100.0% <ø> (ø)
include/xrpl/protocol/detail/ledger_entries.macro 100.0% <ø> (ø)
include/xrpl/protocol/detail/transactions.macro 100.0% <ø> (ø)
src/libxrpl/protocol/ErrorCodes.cpp 85.7% <ø> (ø)
src/libxrpl/protocol/Indexes.cpp 98.1% <100.0%> (+0.1%) ⬆️
src/libxrpl/protocol/InnerObjectFormats.cpp 100.0% <100.0%> (ø)
src/xrpld/app/paths/Flow.cpp 96.4% <ø> (ø)
src/xrpld/app/paths/Pathfinder.cpp 89.3% <100.0%> (+0.8%) ⬆️
src/xrpld/app/paths/Pathfinder.h 100.0% <ø> (ø)
... and 21 more

... and 8 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

namespace test {
namespace jtx {

class PermissionedDEX
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most of the helper functions here just create/update transaction's JSON. This one is highly specialized and don't belong here, better implement it in cpp file with the tests that used it. Hardcoded accounts and transactions will make explicit and implicit conflicts if someone wants to use this object in other tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This class will be used across multiple test files. It's intentional to hardcode these accounts and transactions, otherwise, there will be a lot of redundant initialization that takes a lot space for every unit test. This object is not meant to be used with other kind of tests which will conflict with it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, then at least please rename the accounts to not commonly used names in the tests, like add prefix to them or something

 gw("permdex-gateway")
, alice("permdex-alice")
 , bob("permdex-bob")
 ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@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 changed the title (DRAFT) Perm Dex Permission DEX Apr 24, 2025
@shawnxie999 shawnxie999 requested a review from gregtatcam April 24, 2025 15:03
@shawnxie999 shawnxie999 added Feature Request Used to indicate requests to add new features Amendment API Change and removed Feature Request Used to indicate requests to add new features labels Apr 24, 2025
@@ -226,6 +239,31 @@ class Path_test : public beast::unit_test::suite
return std::make_tuple(std::move(paths), std::move(sa), std::move(da));
}

uint256
setupDomain(jtx::Env& env, std::vector<jtx::Account> const& accounts)
Copy link
Collaborator

Choose a reason for hiding this comment

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

there's some duplicate code in permission_dex.cpp, can we add a common function for setupDomain in permission_dex and call that function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

Successfully merging this pull request may close these issues.

3 participants