-
Notifications
You must be signed in to change notification settings - Fork 212
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
Repair vaultUpgrade proposal; also register replacement scaledPriceAuthority #9748
Conversation
3dd31b7
to
d3217eb
Compare
Deploying agoric-sdk with Cloudflare Pages
|
d3217eb
to
0aa860e
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.
Requesting changes but using Comment because I might not be around to re-review
packages/inter-protocol/src/proposals/replace-scaledPriceAuthorities.js
Outdated
Show resolved
Hide resolved
@@ -259,7 +258,7 @@ export const makeOnewayPriceAuthorityKit = opts => { | |||
}; | |||
|
|||
/** @type {PriceAuthority} */ | |||
const priceAuthority = Far('PriceAuthority', { | |||
const priceAuthority = Far('PriceAggregator', { |
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?
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 are multiple objects going by the name "priceAggregator", or being called priceAggregator, and when I see them in a debugger or trace statement, I'd like to be able to distinguish them.
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 does have some appeal. PriceAuthority
is an interface, and PriceAggregator
is an implementation of it. Being more specific about the implementation seems reasonable... even though the argument to Far
is called interface in various contexts.
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 wrote priceAggregator
when I meant priceAuthority
. The latter is the name that is overused, and the former is a name that only applies to this instance.
@@ -110,7 +110,7 @@ export const makeInitialTransform = ( | |||
: quoteP; | |||
}; | |||
|
|||
return Far('PriceAuthority', { | |||
return Far('ScaledPriceAuthority', { |
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 not PriceAuthorityInitial
like on the tin?
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 object is the one that gets registered, and is used by many contracts. There are multiple things that are called "priceAuthority
" in various places in the code (including the priceAuthorityRegistry
). When I look at one of these, its extremely helpful to have its name match its purpose.
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.
priceAuthorityInitial
is a special case for when an initialPrice
is provided in the configuration. You should only see that in testing scenarios. It shouldn't show up in production. The production Far
object comes from packages/zoe/src/contractSupport/priceAuthorityTransform.js
. So ScaledPriceAuthorityWithInitial
would make more sense 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.
Okay, then I'll rotate the terms so the one we see in production will be ScaledPriceAuthority
.
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.
Testing ... Thorough testing in a3p.
I suppose that's in code that pre-dates this PR...
I'd like to look at the relevant sections of the ci log that show this a3p testing. Help me find it, please?
|
||
const [contractKits] = await Promise.all([ | ||
contractKitsP, | ||
instancePrivateArgsP, |
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 instancePrivateArgsP
here?
for (const kitEntry of scaledPAKitEntries) { | ||
trace({ kitEntry }); | ||
|
||
const keyword = kitEntry.label.match(/scaledPriceAuthority-(.*)/)[1]; |
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.
relying on a label for correctness is awkward.
Did you consider filtering by installation?
I suppose you want the keyword from the label... another way to get that is from the children of published.priceAuthority
... oh... but vstorage is write-only on chain. What a pain.
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.
relying on a label for correctness is awkward.
I agree. There seemed few enough vats at present that I could verify this produced the correct list. A slightly longer or more dynamic list and I'd have tried to find a better way.
Did you consider filtering by installation?
I didn't, but it's a good idea. Added.
@@ -259,7 +258,7 @@ export const makeOnewayPriceAuthorityKit = opts => { | |||
}; | |||
|
|||
/** @type {PriceAuthority} */ | |||
const priceAuthority = Far('PriceAuthority', { | |||
const priceAuthority = Far('PriceAggregator', { |
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 does have some appeal. PriceAuthority
is an interface, and PriceAggregator
is an implementation of it. Being more specific about the implementation seems reasonable... even though the argument to Far
is called interface in various contexts.
@@ -110,7 +110,7 @@ export const makeInitialTransform = ( | |||
: quoteP; | |||
}; | |||
|
|||
return Far('PriceAuthority', { | |||
return Far('ScaledPriceAuthority', { |
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.
priceAuthorityInitial
is a special case for when an initialPrice
is provided in the configuration. You should only see that in testing scenarios. It shouldn't show up in production. The production Far
object comes from packages/zoe/src/contractSupport/priceAuthorityTransform.js
. So ScaledPriceAuthorityWithInitial
would make more sense here.
That should be |
87bd81d
to
97fa744
Compare
fc11081
to
0442ba7
Compare
test-docker-build has a huge log. which parts are relevant? |
From my POV, the fact that it gets to upgrading after delay is crucial. That's the piece that was missed in the previous round.
|
replace scaledPriceAuthority
This PR had been trying to add stTIA, stOSMO and stkATOM to the list of brands in A3P, to match those in mainNet, but that was a mistake. This drops those. It was previously adding priceFeeds, but not scaledPriceAuthorities.
0442ba7
to
e69fe85
Compare
Also generalize one test
e69fe85
to
659c016
Compare
closes: #9596 refs: #9748 ## Description When upgrading VaultFactory, restore the VaultDirector's parameters to the values that exist on chain. ### Security Considerations No particular security implications. ### Scaling Considerations Run only on upgrade. No impact. ### Documentation Considerations No user visible impact. ### Testing Considerations being tested manually thoroughly. The change to `typeParamManager.js` has a unit test. ### Upgrade Considerations Make it possible to preserve values that have been updated on chain. It would have been bad to lose the updated value of `ReferencedUI`.
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 plan to take a fresh look once this is in the form of a core-eval rather than chain software upgrade (for example, once upgrade.go is gone)
LMK with the re-review button plz.
The changes here have been incorporated into #10074. |
closes: #9584 closes: #9928 refs: #9827 refs: #9748 refs: #9382 closes: #10031 ## Description We added upgrading the scaledPriceAuthority to the steps in upgrading vaults, auctions, and priceFeeds, and didn't notice that it broke things. The problem turned out to be that the "priceAuthority" object registered with the priceFeedRegistry was an ephemeral object that was not upgraded. This fixes that by re-registering the new priceAuthority. Then, to simplify the process of cleaning up the uncollected cycles reported in #9483, we switched to replacing the scaledPriceAuthorities rather than upgrading them. We also realized that we would need different coreEvals in different environments, since the Oracle addresses and particular assets vary for each (test and mainNet) chain environment. #9748 addressed some of the issues in the original coreEval. #9999 showed what was needed for upgrading priceFeeds, which was completed by #9827. #10021 added some details on replacing scaledPriceAuthorities. ### Security Considerations N/A ### Scaling Considerations Addresses one of our biggest scaling issues. ### Documentation Considerations N/A ### Testing Considerations Thorough testing in a3p, and our testnets. #9886 discusses some testing to ensure Oracles will work with the upgrade. ### Upgrade Considerations See above
closes: #9584
refs: #9483
Description
We added upgrading the scaledPriceAuthority to the steps in upgrading vaults, auctions, and priceFeeds, and didn't notice that it broke things. The problem turned out to be that the "priceAuthority" object registered with the priceFeedRegistry was an ephemeral object that was not upgraded. This fixes that by re-registering the new priceAuthority.
Then, to simplify the process of cleaning up the uncollected cycles reported in #9483, we switch to replacing the scaledPriceAuthorities rather than upgrading them.
Security Considerations
N/A
Scaling Considerations
Addresses one of our biggest scaling concerns.
Documentation Considerations
None
Testing Considerations
Thorough testing in a3p.
Upgrade Considerations
See above.