-
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
Add deep freeze feature (XLS-77d) #5187
Conversation
Specification: XRPLF/XRPL-Standards#220
to accepting the amendment.
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.
Partial review. I didn't go through all the tests.
9421c37
to
c7c26ac
Compare
ba87028
to
de58a26
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.
Partial review
src/test/app/AMM_test.cpp
Outdated
@@ -4397,6 +4397,48 @@ struct AMM_test : public jtx::AMMTest | |||
0, | |||
std::nullopt, | |||
{features}); | |||
|
|||
// Individually deep frozen account | |||
if (features[featureDeepFreeze]) |
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.
Don't need to repeat the code. Just add a conditional error:
auto const err = features[featureDeepFreeze] ? ter(tecPATH_DRY) : ter(tesSUCCESS)
And then use it in pay
:
env(pay(alice, carol, USD(1)),
path(~USD),
sendmax(XRP(10)),
txflags(tfNoRippleDirect | tfPartialPayment),
err);
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.
Actually, you shouldn't test here and other updated unit-tests if the feature is disabled because trust
is going to fail. You need a separate test for disabled feature in SetTrust
and also add to SetTrust
tests for invalid combination of the flags. Also need to add OfferCreate
and offer crossing, if not added yet, to Offer
.
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.
👍 LGTM
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 think you've got some more changes coming, but everything looks good so far. I left one comment correction that isn't worth using "request changes"
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.
All my concerns are addressed
- spec: XRPLF/XRPL-Standards#220 - implemented deep freeze spec to allow token issuers to prevent currency holders from being able to acquire more of these tokens. - in combination with normal freeze, deep freeze effectively prevents any balance trust line balance change of a currency holder (except direct issuer <-> holder payments). - added 2 new invariant checks to verify that deep freeze cannot be enacted without normal freeze and transfer is not frozen. - made some fixes to existing freeze handling.
- spec: XRPLF/XRPL-Standards#220 - amendment: "DeepFreeze" - implemented deep freeze spec to allow token issuers to prevent currency holders from being able to acquire more of these tokens. - in combination with normal freeze, deep freeze effectively prevents any balance trust line balance change of a currency holder (except direct issuer <-> holder payments). - added 2 new invariant checks to verify that deep freeze cannot be enacted without normal freeze and transfer is not frozen. - made some fixes to existing freeze handling. Co-authored-by: Ed Hennis <[email protected]> Co-authored-by: Howard Hinnant <[email protected]>
High Level Overview of Change
This PR implements Deep Freeze feature described in this specification: XLS-77d
Context of Change
Added new flags and functionality allowing trust lines to be deep-frozen.
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)