-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat: add the ability to override param values #9829
Conversation
6aa71aa
to
e0a0cdc
Compare
Deploying agoric-sdk with Cloudflare Pages
|
fc11081
to
0442ba7
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.
This says "closes: #9596"; the test plan there says "Test if a3p-integration. Verify that the values are restored." I don't see that here. Did that turn out to be prohibitively expensive?
Also, I need to know more about (what looks like) busy-waiting before approving.
while (AmountMath.isEmpty(value.current.MinInitialDebt.value)) { | ||
({ value, updateCount } = await notifier.getUpdateSince(updateCount)); | ||
trace( | ||
`minInitialDebt was empty, retried`, | ||
value.current.MinInitialDebt.value, | ||
); | ||
} |
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 looks busy-waiting. it that on purpose? add a comment about why that's ok?
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 not quite busy waiting. Each time through, it asks for the next update (getUpdateSince(updateCount)
). The expectation is that the zero'th might be empty, but the successive update should have a value. It might be better to back off just once and then give up, rather than waiting in a loop.
@@ -85,6 +85,32 @@ export const upgradeVaults = async (powers, { options }) => { | |||
} | |||
} | |||
|
|||
const restoreDirectorParams = async () => { |
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 seems to get/query the params, not restore them. Or am I mis-reading 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.
You are correct. I'll rename this to readCurrentDirectorParams
. Restoring them happens because they're included in newPrivateArgs
, which is passed to upgradeContract
.
I did test manually once by changing the |
8539ce5
to
0d8b1c7
Compare
@Mergifyio refresh |
✅ Pull request refreshed |
When upgrading a contract, some parameter values originally defined based on terms must be overridden by values supplied via privateArgs. This provides a path to supply those overrides when creating the new paramManager. The vaultFactory uses this new feature to pass values through. The proposal to upgrade vaultFactory gets the current values as updated by governance and passes them in when upgrading.
0d8b1c7
to
ef2963a
Compare
@Mergifyio refresh |
✅ Pull request refreshed |
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
.