Conversation
gregtatcam
left a comment
There was a problem hiding this comment.
I got compile error on MAC M1 Sequoia 15.1.1, apple clang 16.0.0
xrpl/json/json_value.h:705:5: error: constexpr function's return type 'Value' is not a literal type
705 | operator()(T&& t) const
xrpl/json/json_value.h:148:7: note: 'Value' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
148 | class Value
gregtatcam
left a comment
There was a problem hiding this comment.
There are a few warnings, of which the most common is:
xrpl/protocol/STIssue.h:49:5: warning: definition of implicit copy constructor for 'STIssue' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
49 | operator=(STIssue const& rhs) = default;
And once the compile error is fixed (remove constexpr in to_json_fn::operator() return value), there are VaultDelete unit-tests failures.
This is fixed now. The |
2bcc6ad to
17af6e7
Compare
Also remove potential ODR violation from json_value.h
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5224 +/- ##
=========================================
+ Coverage 78.3% 78.5% +0.3%
=========================================
Files 800 813 +13
Lines 69026 70085 +1059
Branches 8275 8282 +7
=========================================
+ Hits 54019 55037 +1018
- Misses 15007 15048 +41
🚀 New features to boost your workflow:
|
|
I am marking this as
|
Before #5224, pseudoaccount ID was calculated using prefix expressed in std::uint16_t. The refactoring to move the pseudoaccount ID calculation to View.cpp had accidentally changed the prefix type to int (derived from `auto i = 0`) which in turn changed the length of the input to `sha512Half` from 2 bytes to 4, altering the result. This resulted in a different ID of the pseudoaccount calculated from the function after the refactoring, breaking the ledger. This impacts AMMCreate, even when SingleAssetVault amendment is not active.
Before #5224, the pseudoaccount ID was calculated using prefix expressed in `std::uint16_t`. The refactoring to move the pseudoaccount ID calculation to View.cpp had accidentally changed the prefix type to `int` (derived from `auto i = 0`) which in turn changed the length of the input to `sha512Half` from 2 bytes to 4, altering the result. This resulted in a different ID of the pseudoaccount calculated from the function after the refactoring, breaking the ledger. This impacts AMMCreate, even when the `SingleAssetVault` amendment is not active. This change restores the prefix type to `std::uint16_t`.
| constexpr std::uint32_t tfClearAccountCreateAmount = 0x00010000; | ||
| constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreateAmount); | ||
|
|
||
| // VaultCreate flags: |
There was a problem hiding this comment.
Hello, a previous version of the specification contained the following transaction flags. Can you confirm that these are no longer included in the feature implementation? (please ignore the case-sensitivity)
TF_FREEZE = 0x0001
TF_UNFREEZE = 0x0002
There was a problem hiding this comment.
These are no longer in the XLS-65d specification
|
|
||
| /** A ledger object representing a single asset vault. | ||
|
|
||
| \sa keylet::mptoken |
There was a problem hiding this comment.
typo in the documentation: this should have been keylet::vault
This change adds support for `DomainID` to existing transactions `MPTokenIssuanceCreate` and `MPTokenIssuanceSet`. In #5224 `DomainID` was added as an access control mechanism for `SingleAssetVault`. The actual implementation of this feature lies in `MPToken` and `MPTokenIssuance`, hence it makes sense to enable the use of `DomainID` also in `MPTokenIssuanceCreate` and `MPTokenIssuanceSet`, following same rules as in Vault: * `MPTokenIssuanceCreate` and `MPTokenIssuanceSet` can only set `DomainID` if flag `MPTRequireAuth` is set. * `MPTokenIssuanceCreate` requires that `DomainID` be a non-zero, uint256 number. * `MPTokenIssuanceSet` allows `DomainID` to be zero (or empty) in which case it will remove `DomainID` from the `MPTokenIssuance` object. The change is amendment-gated by `SingleAssetVault`. This is a non-breaking change because `SingleAssetVault` amendment is `Supported::no`, i.e. at this moment considered a work in progress, which cannot be enabled on the network.
#5224 added (among other things) a `VaultWithdraw` transaction that allows setting the recipient of the withdrawn funds in the `Destination` transaction field. This technically turns this transaction into a payment, and in some respect the implementation does follow payment rules, e.g. enforcement of `lsfRequireDestTag` or `lsfDepositAuth`, or that MPT transfer has destination `MPToken`. However for IOUs, it missed verification that the destination account has a trust line to the asset issuer. Since the default behavior of `accountSendIOU` is to create this trust line (if missing), this is what `VaultWithdraw` currently does. This is incorrect, since the `Destination` might not be interested in holding the asset in question; this basically enables spammy transfers. This change, therefore, removes automatic creation of a trust line to the `Destination` account in `VaultWithdraw`.
This change adds invariants for SingleAssetVault #5224 (XLS-065), which had been intentionally skipped earlier to keep the SAV PR size manageable.
This change adds invariants for SingleAssetVault #5224 (XLS-065), which had been intentionally skipped earlier to keep the SAV PR size manageable.
This change adds invariants for SingleAssetVault #5224 (XLS-065), which had been intentionally skipped earlier to keep the SAV PR size manageable.
|
/ai-reviewer |
High Level Overview of Change
This is implementation of XLS-65 Single Asset Vault. First draft was implemented by @thejohnfreeman in #5147
Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)