-
Notifications
You must be signed in to change notification settings - Fork 214
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(addAssetToVault): support issuerName separate from keyword #8229
Conversation
* @property {string} [issuerName] | ||
* @property {string} oracleBrand |
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 allow oracleBrand to be different than issuerName?
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 don't recall. Perhaps no reason. I suppose the thought at the time of writing was: why constrain them to be the same?
@michaelfig ? maybe you have a more clear idea of the constraints?
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.
oh... are you suggesting that oracleBrand
suffices instead of adding an issuerName
property? I suppose that could work, though it seems like a stretch.
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.
if they don't truly need to be different my suggestion would be to rename the oracleBrand
property to issuerName
.
Whether they need to be different… they are different brands but I think it's a source of unnecessary confusion to have different strings, since their different namespaces suffice.
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.
My 2c - in the event there were ever multiple oracle options for a single asset (say, redemption rate, twap, etc), provided as separate PriceAuthorities, it seems like it'd be beneficial to have issuerName
and oracleBrand
decoupled
Do we also need to update |
d69413d
to
38edd99
Compare
@0xpatrickdev did some testing and found a problem
Looks like we have more keyword/issuerName conflation in provisionPool. :-/ https://github.com/Agoric/agoric-sdk/blob/mainnet1B/packages/vats/src/provisionPoolKit.js#L347 p.s. for follow-up, see #8238 |
2b75c1b
to
8fc0c23
Compare
9600d4e
to
7b29446
Compare
* @property {string} [proposedName] | ||
* @property {string} keyword | ||
* @property {string} oracleBrand | ||
* @property {string} [issuerName] | ||
* @property {string} [oracleBrand] |
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.
The new changes since last testing period look good to me (note: just from reading the code, i have yet to try a deployment). I might suggest adding these comments, or something along these lines, to add more clarity around the parameters:
* @property {string} [proposedName] | |
* @property {string} keyword | |
* @property {string} oracleBrand | |
* @property {string} [issuerName] | |
* @property {string} [oracleBrand] | |
* @property {string} keyword - the issuer keyword record for the contract instance | |
* @property {string} [issuerName] - defaults to `keyword` if not provided | |
* @property {string} [proposedName] - defaults to `issuerName` if not provided | |
* @property {string} [oracleBrand] - defaults to `issuerName` if not provided |
(keyword took me a minute to grok, but it's seemingly just for the use case i described)
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.
No blockers but please consider the suggestions before merging.
@@ -10,6 +10,8 @@ import { | |||
/** @typedef {import('@agoric/vat-data').Baggage} Baggage */ | |||
|
|||
/** | |||
* NOTE: "keyword" connotes initial caps constraint, which doesn't apply here. |
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.
consider explaining why the imperfect name remains
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.
Hm. I considered it, but I don't see a concise explanation.
Changing the name wouldn't require upgrading the existing contract vats. It would just require remembering that the old ones use a different name. It might even be possible to support a new name
property and deprecate the keyword
property.
I suppose the real reason the keyword
name remains is: changing it isn't necessary to address #8235.
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.
require remembering that the old ones use a different name
That seems reason enough to me.
the keyword name remains is: changing it isn't necessary
Fair. Though with this PR that imperfect name is tech debt. We should at least document the rationale to take on the debt.
keyword: kwd, | ||
issuerName = kwd, | ||
oracleBrand = issuerName, |
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 have a nice and clear progressive override below. Why not use it here?
keyword: kwd, | |
issuerName = kwd, | |
oracleBrand = issuerName, | |
keyword, | |
issuerName = keyword, | |
oracleBrand = issuerName, |
assert.typeof(proposedName, 'string'); | ||
assert.typeof(decimalPlaces, 'number'); |
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.
moving this line looks superfluous to me. If you are going to move it, consider some rational ordering like alphabetical (as you have in the destructuring for this fn
@dckc - This PR appears to be stuck. It's had a merge label for > 24 hours |
65c0d76
to
54e5094
Compare
- default proposedName to issuerName The type for proposedName is optional but there was a runtime typecheck for string. - default oracleBrand to issuerName
54e5094
to
f0b1559
Compare
@Mergifyio refresh |
✅ Pull request refreshed |
fixes: #8235
refs: #8176, #8177
Description
In
addAssetToVault
, we conflatedkeyword
(needed for registration with the reserve and auction) withissuerName
(for use inagoricNames
). This adds toInterchainAssetOptions
anissuerName
property that defaults to the value ofkeyword
.Security, Documentation Considerations
Allows higher fidelity between
agoricNames
and well-known names of assets.Scaling Considerations
n/a/
Testing Considerations
Manual testing with
issuerName: 'atom'
andissuerName: 'stars'
succeeded. We could keep theissuerName: 'stars'
tweak. But first, I'd like to see what ci thinks of this.Upgrade Considerations
doesn't affect existing vats.