-
Notifications
You must be signed in to change notification settings - Fork 206
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
await scaledPriceAuthority #8452
Conversation
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.
missing call to scaledPriceFeedName
seems important
@@ -12,8 +12,11 @@ import { Stable } from '@agoric/internal/src/tokens.js'; | |||
import { TimeMath } from '@agoric/time/src/timeMath.js'; | |||
import { makePromiseKit } from '@endo/promise-kit'; | |||
|
|||
import { instanceNameFor } from './price-feed-proposal.js'; |
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.
yay for reducing coupling here!
These go into separate bundles, so including price-feed in addAssetToVault was awkward. This should reduce bundle sizes.
@@ -135,6 +138,7 @@ export const registerScaledPriceAuthority = async ( | |||
priceAuthorityAdmin, | |||
priceAuthority, | |||
}, | |||
instance: { produce: produceInstance }, |
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.
comment / security concern: small increase in authority - authority to produce/replace any agoricNames.instance. But since we can't know issuerName
in advance, this is the least authority we can grant within the expressiveness of our permits.
@@ -211,9 +215,11 @@ export const registerScaledPriceAuthority = async ( | |||
}), | |||
); | |||
|
|||
const label = `scaledPriceAuthority-${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.
scaledPriceFeedName
is nicely factored out but... oops! not used here.
though not a correctness issue, important for maintenance / documentation
// don't add the collateral offering to vaultFactory until its price feed is available | ||
// eslint-disable-next-line no-restricted-syntax -- allow this computed property | ||
await consumeInstance[oracleInstanceName]; | ||
await consumeInstance[oracleBrandFeedName(oracleBrand, 'USD')]; | ||
// await also the real brand |
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.
suggestion: editorial:
// await also the real brand | |
// await also the negotiable brand |
@@ -420,8 +433,8 @@ export const getManifestForAddAssetToVault = ( | |||
priceAuthorityAdmin: true, | |||
priceAuthority: true, | |||
}, | |||
produce: { | |||
scaledPriceAuthorityKits: true, |
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.
vestigial. nice clean-up
Without this, the auctioneer can have race in which it tries to read this before it's registered
180c78b
to
579fbf1
Compare
|
||
The intended flow is that: | ||
1. a negotiable brand is created (e.g. ATOM) | ||
2. a price provider says “i can give you quotes for that” and runs price-feed-proposal. That makes “oracleBrands” (which are inert and have a separate identity so that they don’t have the authority to say they’re the real quote for it). |
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 presume 'inert' means no payments or purses. If that's the case, please say so explicitly. Is there any way for holders of the issuer or the brand to reliably detect that it is inert?
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.
Right, there's no mint or issuer. But there's no way to inspect the brand to find out.
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.
not a correctness issue, I guess
Description
In devnet-21 we observed an error,
It hasn't been reproduced but it's due to a race condition that we should prevent. This prevents it by providing a signal as to when the scaledPriceAuthority (in the real
stATOM
brand) is available, and awaits that before calling code that may use it.Security Considerations
Publishing the instance in agoricName. This is okay just as the authority feeds are there.
Scaling Considerations
--
Documentation Considerations
Testing Considerations
Forgoing a test that induces the race condition but this code will be tested. The publishing is tested by the await.
Upgrade Considerations
Not on-chain code.