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

Permissioned Domains (XLS-80d) #5161

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

Conversation

oleks-rip
Copy link
Collaborator

High Level Overview of Change

Implements the object, transactions, and tests required by the spec: XLS-80d

Context of Change

New feature. Follows existing patterns for adding a new ledger object and related transactions.

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

Requires an amendment.

  • 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)

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 95.54455% with 9 lines in your changes missing coverage. Please review.

Project coverage is 77.9%. Comparing base (0ec17b6) to head (99fef88).

Files with missing lines Patch % Lines
src/xrpld/app/tx/detail/PermissionedDomainSet.cpp 93.2% 5 Missing ⚠️
...c/xrpld/app/tx/detail/PermissionedDomainDelete.cpp 90.9% 3 Missing ⚠️
src/xrpld/rpc/handlers/LedgerEntry.cpp 95.2% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #5161    +/-   ##
========================================
  Coverage     77.9%   77.9%            
========================================
  Files          782     786     +4     
  Lines        66622   66800   +178     
  Branches      8136    8138     +2     
========================================
+ Hits         51902   52067   +165     
- Misses       14720   14733    +13     
Files with missing lines Coverage Δ
include/xrpl/protocol/Feature.h 100.0% <ø> (ø)
include/xrpl/protocol/Indexes.h 100.0% <ø> (ø)
include/xrpl/protocol/detail/ledger_entries.macro 100.0% <100.0%> (ø)
include/xrpl/protocol/detail/transactions.macro 100.0% <100.0%> (ø)
src/libxrpl/protocol/Indexes.cpp 98.0% <100.0%> (+0.1%) ⬆️
src/xrpld/app/misc/CredentialHelpers.cpp 94.6% <100.0%> (+1.0%) ⬆️
src/xrpld/app/tx/detail/DepositPreauth.cpp 93.0% <100.0%> (-0.7%) ⬇️
src/xrpld/app/tx/detail/InvariantCheck.cpp 87.5% <100.0%> (+1.0%) ⬆️
src/xrpld/app/tx/detail/InvariantCheck.h 100.0% <ø> (ø)
src/xrpld/app/tx/detail/PermissionedDomainDelete.h 100.0% <100.0%> (ø)
... and 7 more

... and 4 files with indirect coverage changes

Impacted file tree graph

@Bronek Bronek self-requested a review October 24, 2024 14:42
@oleks-rip oleks-rip mentioned this pull request Oct 26, 2024
13 tasks
@oleks-rip oleks-rip force-pushed the pd_xls80 branch 2 times, most recently from 4029ac5 to 4aede12 Compare November 7, 2024 05:35
Copy link
Collaborator

@Bronek Bronek left a comment

Choose a reason for hiding this comment

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

You need to fix mac errors; these are happening because clang 15 does not fully implement construction of aggregates in the context where std::construct_at needs them to work, which is ret.emplace_back in src/test/jtx/impl/permissioned_domains.cpp, trying to create AuthorizeCredentials defined in src/test/jtx/deposit.h

Here's small repro with this compiler version, to help you experiment with workarounds https://godbolt.org/z/MKfYfsvan

Bronek

This comment was marked as outdated.

@oleks-rip oleks-rip force-pushed the pd_xls80 branch 2 times, most recently from 188fd2b to e8ca019 Compare November 13, 2024 18:58
Copy link
Collaborator

@mvadari mvadari left a comment

Choose a reason for hiding this comment

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

Permissioned Domain object should be added to the deletionBlockers list in account_objects

@oleks-rip
Copy link
Collaborator Author

Permissioned Domain object should be added to the deletionBlockers list in account_objects

It is https://github.com/XRPLF/rippled/pull/5161/files#diff-f9abeaf1d1e3337a016d4887673dea0904141a1effb933e0929da383ebacb348R228

@oleks-rip oleks-rip force-pushed the pd_xls80 branch 3 times, most recently from 391e266 to 99fef88 Compare November 21, 2024 23:52
@@ -503,7 +503,8 @@ Env::autofill(JTx& jt)
}
catch (parse_error const&)
{
test.log << "parse failed:\n" << pretty(jv) << std::endl;
if (!parseFailureExpected_)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the objective of this change? Just making it easier to identify errors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It add too much of false-positive unnecessary output to UT logs which complicates looking for real problem.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be additional BEAST_EXPECT logic to ensure that an error is actually thrown here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is added in the test, This one is ENV fixing.

// helpers
// Make json for PermissionedDomainSet transaction
Json::Value
setTx(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
setTx(
set(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then you need to rename deleteTx to delete which will conflict with keyword

if (isUnique_)
{
unsigned i = 0;
for (auto const& cred : sorted)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just use a normal for loop with i here? Easier to ensure that all the indices are kept straight.

Copy link
Collaborator Author

@oleks-rip oleks-rip Nov 26, 2024

Choose a reason for hiding this comment

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

using .size() of general container in the loop is bad idea as many of them non const. Adding size variable or something will lead to the similar code.

Comment on lines +1166 to +1185
if (tx.getTxnType() != ttPERMISSIONED_DOMAIN_SET || result != tesSUCCESS)
return true;
Copy link
Collaborator

@mvadari mvadari Nov 25, 2024

Choose a reason for hiding this comment

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

Is this needed? Potentially is harder to remember to update if e.g. there's another transaction later that updates PDs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe Mark put it here to be consistent with other finalize functions (they have such a check)

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.

5 participants