-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix AMM missing XRP Asset Metadata #5012
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 #5012 +/- ##
=======================================
Coverage 70.9% 70.9%
=======================================
Files 796 796
Lines 66792 66798 +6
Branches 11002 10998 -4
=======================================
+ Hits 47379 47385 +6
Misses 19413 19413
|
@@ -71,6 +73,12 @@ STCurrency::isEquivalent(const STBase& t) const | |||
bool | |||
STCurrency::isDefault() const | |||
{ | |||
if (auto const rules = getCurrentTransactionRules()) |
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 changes semantics of this call. Post-amendment STCurrency
and STIssue
will not have the default value. Is this really the right behavior?
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.
here is what Ed said about default value
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.
Is isDefault()
used for the metadata insertion only? If not then is returning always false
consistent with other uses?
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.
Yes i believe isDefault() is only used for metadata
for (Json::Value const& metaNode : meta[sfAffectedNodes.jsonName]) | ||
{ | ||
// Ensure XRP asset is shown in PriceData regardless of the | ||
// fixAMMMetadata 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.
Why is this not amendment guarded?
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 is not a problem with Oracle I believe, since the asset is an inner object
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.
Why it should not be amendment guarded if it's an inner object?
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.
Inner object default values will not omitted. Metadata would only check the outer object
Does it make sense to add another virtual method to |
I'm not sure if that would be needed. |
Can you confirm it's only used for the metadata? Does |
That is really a scary question for a Rippel employee to ask! 😨 The |
FWIW, I am uncomfortable with this change. Both |
I agree with this. Here is what we did:
|
Having read #4965 (comment) I think I was mistaken. The semantics of |
I disagree as STAmount clearly defines the But alas I really don't have any firm position on how its handled in ripple(d). |
I think the condition that you are citing here just happens to match the definition of "no useful data here", in the context of |
@@ -360,6 +360,7 @@ extern uint256 const fixEmptyDID; | |||
extern uint256 const fixXChainRewardRounding; | |||
extern uint256 const fixPreviousTxnID; | |||
extern uint256 const fixAMMRounding; | |||
extern uint256 const fixAMMMetadata; |
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.
Having read #4965 (comment) I think this is a good fix, but I would like the amendment to use a different name. The use of AMM
in name is misleading, this is a currency metadata fix (i.e. a lower abstraction level), which just happens to show up in AMM (but also in Oracle, as the unit tests demonstrate).
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.
Could be also named as asset metadata, rather than currency metadata.
High Level Overview of Change
In the
NewFields
of a AMM object after aAMMCreate
transaction,Asset
would be omitted if it is XRP, which is incorrect. A new amendment fixAMMMetadata fixes this problemContext of Change
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)