-
Notifications
You must be signed in to change notification settings - Fork 228
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
6701 EC addOracles to a governed fluxAggregator #6975
Conversation
3f54923
to
91d6594
Compare
91d6594
to
e972759
Compare
I'm okay with this. Its intention was to provide control over the oracles to the BLDer DAO. I presume there's enough machinery added to the bootstrap promise spaces so that BLDer DAO proposals can do the same sorts of things that the EC can do? |
quoteMintP, | ||
zcf.saveIssuer(E(quoteMintP).getIssuer(), 'Quote'), | ||
]); | ||
const quoteKit = { |
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 the fluxAggregator has a quoteMint, it seems like that should be publicly visible. I see that it eventually makes it way to the priceAuthorities, which presumably share it, but shouldn't it be available from the fluxAggregator as well?
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 the fluxAggregator has a quoteMint, it seems like that should be publicly visible.
Why?
I see that it eventually makes it way to the priceAuthorities, which presumably share it
Not sure where you're seeing that. Here the PA gets just quoteKit.issuer,
const { priceAuthority } = makeOnewayPriceAuthorityKit({
createQuote: roundsManagerKit.contract.makeCreateQuote(),
notifier: makeNotifierFromSubscriber(answerSubscriber),
quoteIssuer: quoteKit.issuer,
timer: timerPresence,
actualBrandIn: brandIn,
actualBrandOut: brandOut,
});
The other read of quoteKit
in this module is to pass it to makeRoundsManagerKit
, which uses it only for,
const quoteAmount = AmountMath.make(quoteKit.brand, harden(quote));
const quotePayment = await E(quoteKit.mint).mintPayment(quoteAmount);
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.
Sorry, I meant that the issuer should be public. The priceAuthorities provide access to their quoteIssuer (I think). Shouldn't the aggregator do the same? Are there parties to the conversation that know the aggregator and don't talk to individual PAs? If not, then I guess it's not necessary, but it feels like the Aggregator should be the main authority on the Issuer if it's the one that makes 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.
Are there parties to the conversation that know the aggregator and don't talk to individual PAs?
Not on the consumption side, TMK.
const { timer: timerP } = zcf.getTerms(); | ||
|
||
const quoteMintP = | ||
privateArgs.quoteMint || makeIssuerKit('quote', AssetKind.SET).mint; |
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.
Do we want this to be durable/recoverable, even if it didn't come from privateArgs?
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.
Out of scope. Those are concerns for #6853
@@ -52,6 +50,12 @@ export const reserveThenGetNames = async (nameAdmin, names) => | |||
names.map(name => [name]), | |||
); | |||
|
|||
/** | |||
* @param {string} debugName |
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.
Maybe displayName
? debugName
seems pejorative.
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.
these are just jsdocs for params that were already there. The type annotation serves this PR. Changing the param name doesn't. It doesn't seem worth a drive-by either. Since you said "maybe" I take it that's not an approval requirement.
* @param {string[]} methodArgs | ||
* @param {import('@agoric/time').TimestampValue} deadline | ||
*/ | ||
const makeApiInvocationInvitation = ( |
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.
There's no test for the charter? Hmm. Seems like an oversight.
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'm okay with it since we need to test uses of the charter to govern and we do in the smartWallet
integration tests.
* @param {Awaited<ReturnType<typeof coalesceUpdates>>} state | ||
* @param {Brand<'nat'>} brand | ||
*/ | ||
export const purseBalance = (state, 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.
passing state
to a helper seems like an anti-pattern, since state
is mutable. Can this be done by passing state.balances
since the operation is supposed to be read-only?
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.
it could be but since this is a test I've opted for ease of writing and reading.
Is this a blocking request?
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 if it's a lot of work. How much work does it save?
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 objection wasn't on amount of work to make the change. It was that it made calling require more typing.
In this case the function was no longer used so I've removed it.
import { reserveThenDeposit } from '../proposals/utils.js'; | ||
import { provideFluxAggregator } from './fluxAggregator.js'; | ||
|
||
const trace = makeTracer('FluxAgg'); |
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.
const trace = makeTracer('FluxAgg'); | |
const trace = makeTracer('FluxAgg, false'); |
creatorFacet: fa.creatorFacet, | ||
publicFacet: fa.publicFacet, | ||
creatorFacet: governorFacet, | ||
// XXX this is a lot of API to put on every public facet |
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 can pick and choose if it shouldn't all be there.
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 good. I think this came when I ran into some type problems in #6963 . Removed now.
await oracleTimer.tick(); | ||
await oracleTimer.tick(); | ||
await oracleTimer.tick(); | ||
await oracleTimer.tick(); // --- should time out 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.
tickN(6)
would be better and is supposed to do the same thing. I recently noticed that it doesn't seem to be equivalent. Can you see why it makes a difference?
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 file was redundant with test-fluxAggregator
and I removed it in a subsequent PR. I've rebased to remove it 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.
I don't have a strong objection to .contract.js
, but it's a change/addition to our naming scheme. I'd prefer to stick to our existing pattern until we have a decision to switch.
No tests and appears not to be used. Keying by 'terms' was impractical. Instead use `.lookup` by instance name
e972759
to
9b6dbc5
Compare
// Create the price feed. | ||
const aggregator = await E(zoe).startInstance( | ||
priceAggregator, | ||
/** @type {{ creatorFacet: import('@agoric/governance/src/contractGovernor.js').GovernedContractFnFacetAccess<import('@agoric/inter-protocol/src/price/fluxAggregator.contract.js').start>, publicFacet: GovernorPublic, instance: Instance, adminFacet: AdminFacet }} */ |
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.
s/fluxAggregator.contract.js/fluxAggregatorContract.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.
Good eyes. it’s passing CI because it’s wrapping type is not resolved and thus any
. (Unfortunately JSDoc TS doesn't complain about that.) I'll get to fixing this in #6987
part of: #6701
split from #6963 and cleaned up for easier review
Next will be
removeOracles
which requires the caretaker patternDescription
Grants EC the power to
addOracles
to a price feed.Do that required giving the EC the ability to VoteOnApiCall:
Supporting changes:
PR also includes some incidental cleanup:
Security Considerations
Makes the fluxAggregator subject to changes by governance. This is granted only to the EC.
Scaling Considerations
--
Documentation Considerations
removing
aggregators
from the space might impact REPL usage. Users are better off doing alookup
imo.Testing Considerations
New integration test of FA governance with wallet.