-
Notifications
You must be signed in to change notification settings - Fork 229
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
chore: update installations when restarting or upgrading #10999
Changes from 3 commits
5666c30
eca2d40
63f4706
83a6001
8372897
2d369bc
d1241a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -74,7 +74,7 @@ export const upgradeAssetReserve = async ( | |||||
}; | ||||||
|
||||||
export const getManifestForUpgradingAssetReserve = ( | ||||||
_powers, | ||||||
{ restoreRef }, | ||||||
{ assetReserveRef }, | ||||||
) => ({ | ||||||
manifest: { | ||||||
|
@@ -89,5 +89,8 @@ export const getManifestForUpgradingAssetReserve = ( | |||||
}, | ||||||
}, | ||||||
}, | ||||||
installations: { | ||||||
assetReserve: restoreRef(assetReserveRef), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I suggest
Suggested change
We can see this in published.agoricNames.installation on mainnet (or any of our running networks, I'm pretty sure). There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I decided to import |
||||||
}, | ||||||
options: { assetReserveRef }, | ||||||
}); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -39,7 +39,10 @@ export const upgradePriceAuthorityRegistry = async ( | |||||
}; | ||||||
|
||||||
const par = 'paRegistry'; | ||||||
export const getManifestForUpgradingRegistry = (_powers, { registryRef }) => ({ | ||||||
export const getManifestForUpgradingRegistry = ( | ||||||
{ restoreRef }, | ||||||
{ registryRef }, | ||||||
) => ({ | ||||||
manifest: { | ||||||
[upgradePriceAuthorityRegistry.name]: { | ||||||
consume: { | ||||||
|
@@ -51,6 +54,9 @@ export const getManifestForUpgradingRegistry = (_powers, { registryRef }) => ({ | |||||
brand: { consume: { [Stable.symbol]: par } }, | ||||||
}, | ||||||
}, | ||||||
installations: { | ||||||
priceAuthority: restoreRef(registryRef), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait... now I'm getting things mixed up. priceAuthorityRegistry is not a contract vat. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dropped. I hate the names for priceAuthority/Registry/fluxAggregator! |
||||||
}, | ||||||
options: { | ||||||
registryRef, | ||||||
}, | ||||||
|
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 will create a new installation handle, which is a little tricky...
This
upgrade-wallet-factory2-proposal.js
is designed to upgrade the wallet factory contract instance. That instance's installation handle will still be the installation handle that it was started with. I'm not sure we want to make that installation handle harder to find by removing it from agoricNames. It's not like we plan to start more smartWallet contract instances.I suppose we can get the original handle back using
E(Zoe).getInstallationForInstance(instance)
, so maybe there's not much harm 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 think that's what I intend. Without this change, the installation registered (in AoricNames and bootstrap space) would remain the old one, and if someone used that to start a new instance, they'd get the old one. I think each contract name in those tables should lead to the most recent installation, i.e. the one you would want to use.
Admittedly this doesn't make as much sense for singleton vats like walletFactory, but if I wanted to do a null-upgrade, this is the installation I'd want to use.
That seems like a bug to me. I think @erights and I talked about this at some point and agreed that
E(Zoe).getInstallationForInstance(instance)
should return info about the current installation. It is currently never updated. Perhaps it should return an ordered list of installations, but the current one should be there, as that's the one that someone might want to verify.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.
upgrade doesn't use installations. it uses bundle hashes.
I suppose you can get a bundle hash from an installation, so I suppose that argues for updating the installation