-
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
Specify a bundle to use when upgrading auctions #9937
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
await E.when( | ||
installationP, | ||
installation => | ||
E(E(agoricNamesAdmin).lookupAdmin('installation')).update( | ||
'auctioneer', | ||
installation, | ||
), | ||
err => console.error(`🚨 failed to update vaultFactory installation`, err), | ||
); |
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.
Using the promise space is supposed to take care of agoricNames for you:
await E.when( | |
installationP, | |
installation => | |
E(E(agoricNamesAdmin).lookupAdmin('installation')).update( | |
'auctioneer', | |
installation, | |
), | |
err => console.error(`🚨 failed to update vaultFactory installation`, err), | |
); | |
produceInstallation.reset(); | |
produceInstallation.resolve(installationP); |
combined with:
installation: {
produce: { auction: produceInstallation },
},
I'm not 100% sure these are equivalent. thinking it over.
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.
Reviewing the code for makePromiseSpaceForNameHub
, I see that
- using the promise space updates agoricNames as a side-effect, so they stay in sync, but
- updating agoricNames directly does _not _ update the promise space, so if someone later tries to use
installation.consume.auctioneer
, they'll get the old installation
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 will fix the code in upgradeVaults 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.
This turned into a major clean-up.
@dckc this means upgrade-vaults.js
needs a fresh review.
} = powers; | ||
}, | ||
{ options }, | ||
) => { |
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 struggling to understand this change. Is it just formatting?
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's mostly formatting. The old code had access to the name powers
within the body. That was used in some proposals in order to pass all the powers to sub-proposals. That isn't happening here, so I reverted to the more conventional (for proposals) format of expanding powers
in the parameter list, rather than passing it through and expanding it in the body.
It was just (bad?) luck that the differ matches the expansion of powers in the param list with the identical one in the body.
I would have accepted a suggestion that it was unrelated to this PR, but now that I'm changing the expansion of powers in order to get installation.produce.VaultFactory
, I'll leave it in as cleanup related to that.
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 think it's worth keeping the installation promise space in sync with agoricNames
function newAuctioneerFromNewBundle(details) { | ||
for (const detail of details) { | ||
// contract vat names are based on bundleID | ||
const originalAuctionVatName = 'zcf-b1-a5683-auctioneer'; |
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.
seems like this should be hoisted out of the loop.
not critical
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 point.
await E.when( | ||
installationP, | ||
installation => | ||
E(E(agoricNamesAdmin).lookupAdmin('installation')).update( |
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 would expect agoricNamesAdmin
to disappear from the permit of the auction part. I wonder why I don't see 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.
upgradeVaults.js
still uses it for the auction instance at line 226. Should that use promise space instead?
add-auction.js
added it in b6e0739
, but dropped it in 37505e3
.
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.
upgradeVaults.js still uses it for the auction instance at line 226. Should that use promise space instead?
yes.
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.
done
economicCommitteeCreatorFacet: electorateCreatorFacet, | ||
auctioneerKit: legacyKitP, | ||
}, | ||
produce: { newAuctioneerKit, auctionsUpgradeComplete }, |
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.
in discussion, we agreed newAuctioneerKit
should go away in favor of the auctionsUpgradeComplete
sync point and replacing auctioneerKit
( with reset, resolve ).
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.
done
@@ -179,14 +193,23 @@ export const ADD_AUCTION_MANIFEST = harden({ | |||
auctioneer: 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.
don't need to consume the auctioneer installation
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.
done
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.
looks good.
const installationP = E(zoe).installBundleID(bundleID); | ||
produceVaultInstallation.reset(); | ||
produceVaultInstallation.resolve(installationP); |
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 publishRef
/ install
stuff in builders/scripts/*.js
is supposed to take care of this installBundleId
and reset
/ resolve
.
But the only cost to doing it this way is 1 cross-vat call and a bit of allocation / GC. And there's benefit in clarity.
And it looks like the reset
is missing from the other code path:
agoric-sdk/packages/deploy-script-support/src/coreProposalBehavior.js
Lines 169 to 171 in aedfac6
installationEntries.map(([key, value]) => { | |
produceInstallations[key].resolve(value); | |
return E(installAdmin).update(key, value); |
let installationP; | ||
const installationP = E(zoe).installBundleID(bundleID); | ||
produceVaultInstallation.reset(); | ||
produceVaultInstallation.resolve(installationP); | ||
|
||
await auctionsUpgradeComplete; | ||
auctionsUpgradeCompleteProducer.reset(); |
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's a little surprising that the vaults upgrade is producing auctionsUpgradeComplete
. Now I remember: this is why. A bit more docs might be nice.
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 think your earlier suggestion of a naming convention is good.
My theory here is that names like fooProcessCompletion should be considered to be single-use flags and should be cleaned up once consumed.
refs: #9940 ## Description #9937 unintentionally upgraded the vaultFactory with the instance of the old auction. This change asks the promise space for the auction instance after the new auction startup is complete. ### Security Considerations None. ### Scaling Considerations None. ### Documentation Considerations None. ###Testing Considerations This will be tested on Ollinet and emerynet before deployment. I tested locally on a3p by watching the logs to see that the vaults synced to the new auction schedule. ###Upgrade Considerations upgrade vaults and auctions so they work together.
closes: #9936 ## Description Upload new auction code for the coreEval. ### Security Considerations N/A ### Scaling Considerations none ### Documentation Considerations none ### Testing Considerations Added a test that the new vat has a different bundle ID. I couldn't find any accessible behavioral differences to test. ### Upgrade Considerations verify that upgrade happened.
closes: #9936
Description
Upload new auction code for the coreEval.
Security Considerations
N/A
Scaling Considerations
none
Documentation Considerations
none
Testing Considerations
Added a test that the new vat has a different bundle ID. I couldn't find any accessible behavioral differences to test.
Upgrade Considerations
verify that upgrade happened.