VaultWithdraw destination account bugfix#5572
Conversation
- Unfortunately, to not change behavior, a new "Legacy" authorization type was created. It acts like "StrongAuth" for MPTs and "WeakAuth" for IOUs.
932dd8b to
dec0bf7
Compare
250cea2 to
14cb2e1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5572 +/- ##
=========================================
- Coverage 78.8% 78.8% -0.0%
=========================================
Files 814 814
Lines 71205 71222 +17
Branches 8330 8362 +32
=========================================
- Hits 56111 56089 -22
- Misses 15094 15133 +39
🚀 New features to boost your workflow:
|
cb4a73c to
88d712e
Compare
Co-authored-by: Ed Hennis <ed@ripple.com>
| auto const trustLine = | ||
| view.read(keylet::line(account, issue.account, issue.currency)); | ||
| // If account has no line, and this is a strong check, fail | ||
| if (!trustLine && authType == AuthType::StrongAuth) |
There was a problem hiding this comment.
Shouldn't this be gated by an amendment?
There was a problem hiding this comment.
No, because before this change there was no way to pass AuthType::StrongAuth to this function (i.e. the old behaviour was always as-if AuthType::WeakAuth was used). So the new behaviour will only be enabled in the code changed in this PR, where we change the parameters passed to requireAuth.
thanks @ximinez ! |
Co-authored-by: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com> Co-authored-by: Bronek Kozicki <brok@incorrekt.com> Co-authored-by: Bart <bthomee@users.noreply.github.com> Co-authored-by: Oleksandr <115580134+oleks-rip@users.noreply.github.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com> Fixes #4783 fix (#5572)
High Level Overview of Change
Remove automatic creation of trust line to
Destinationaccount inVaultWithdraw.Context of Change
#5224 added (among other things) a
VaultWithdrawtransaction which allows setting the recipient of the withdrawn funds in theDestinationtransaction field. This technically turns this transaction into a payment, and in some respect the implementation does follow payment rules e.g. enforcement oflsfRequireDestTagorlsfDepositAuthor that MPT transfer has destinationMPToken. However for IOU, it missed verification that the destination account has trust line to the asset issuer. Since the default behaviour ofaccountSendIOUis to create this trust line (if missing), this is whatVaultWithdrawcurrently does. This is incorrect, since theDestinationmight not be interested in holding the asset in question; this basically enables spammy transfers.Thanks to @ximinez who found the issue and implemented the fix.
Type of Change
.gitignore, formatting, dropping support for older tooling)