-
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
Permissioned Domains (XLS-80d) #5161
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5161 +/- ##
=========================================
+ Coverage 77.9% 77.9% +0.1%
=========================================
Files 782 786 +4
Lines 66619 66794 +175
Branches 8157 8156 -1
=========================================
+ Hits 51872 52042 +170
- Misses 14747 14752 +5
|
4029ac5
to
4aede12
Compare
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.
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
for (auto const& credential : credentials) | ||
{ | ||
if (!ctx.view.read(keylet::account(credential.getAccountID(sfIssuer)))) | ||
return temBAD_ISSUER; |
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.
Would love to hear @mvadari opinion on this (consistency with XLS-70 implementation): inside DepositPreauth::preclaim
we return tecNO_ISSUER
in a similar situation
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.
This should definitely be a tec
error - it's in preclaim
and it involves reading ledger state.
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.
Behavior aligned with XLS-70
auto sz = credential.getFieldVL(sfCredentialType).size(); | ||
if (!sz || sz > 64) | ||
return temMALFORMED; | ||
} |
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.
Would love to hear @mvadari opinion on this (for consistency with XLS-70), but in DepositPreauth::preflight
we also enforce that all credentials are unique.
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.
Agreed on that.
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.
Behavior aligned with XLS-70
Also, test sorting of permissions.
failing the transaction. Conforms to Credentials spec.
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.
Permissioned Domain object should be added to the deletionBlockers
list in account_objects
|
BEAST_EXPECT(tx[jss::TransactionType] == "PermissionedDomainSet"); | ||
BEAST_EXPECT(tx["Account"] == alice[0].human()); | ||
auto objects = pd::getObjects(alice[0], env); | ||
auto domain = objects.begin()->first; |
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.
domain
variable is unused
std::unordered_set<uint256> duplicates; | ||
for (auto const& credential : credentials) | ||
{ | ||
auto const& issuer(credential[sfIssuer]); |
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.
Shouldn't you use the ~
operator here? Is it guaranteed to have an sfIssuer
field all the time?
params[jss::ledger_index] = jss::validated; | ||
params[jss::permissioned_domain][jss::account] = alice.human(); | ||
params[jss::permissioned_domain][jss::seq] = seq; | ||
auto jv = env.rpc("json", "ledger_entry", to_string(params)); |
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.
I'm not able to figure out the correct format of the ledger_entry
command. I'm confident that the sequence
and account
values are correct in the below input. Am I mis-spelling permissioned_domain value?
Response(status=<ResponseStatus.ERROR: 'error'>, result={'api_version': 2, 'error': 'malformedRequest', 'id': 'RequestMethod.LEDGER_ENTRY_94839', 'ledger_current_index': 234, 'request': {'api_version': 2, 'binary': False, 'command': 'ledger_entry', 'id': 'RequestMethod.LEDGER_ENTRY_94839', 'permissioned_domain': {'account': 'ra5dMgd2j5DhKpW2h9beFsTsq7EKfDs4JJ', 'sequence': 220}}, 'status': 'error', 'type': 'response', 'validated': False}, id='RequestMethod.LEDGER_ENTRY_94839', type=<ResponseType.RESPONSE: 'response'>)
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
.gitignore
, formatting, dropping support for older tooling)API Impact
Requires an amendment.
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)