Skip to content
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

reinstantiate PSM with state from chainStorage #6645

Closed
6 tasks done
Tracked by #6644
dckc opened this issue Dec 7, 2022 · 2 comments · Fixed by #7480
Closed
6 tasks done
Tracked by #6644

reinstantiate PSM with state from chainStorage #6645

dckc opened this issue Dec 7, 2022 · 2 comments · Fixed by #7480
Assignees
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol user-story User story that needs to be implemented and tested. vaults_triage DO NOT USE
Milestone

Comments

@dckc
Copy link
Member

dckc commented Dec 7, 2022

What is the Problem Being Solved?

We plan to restart the JS VM from scratch (#6644). The PSM contracts need to be restored, including the anchor assets, fee pool, and governed parameters

Description of the Design

Tasks

  1. SwingSet cosmic-swingset enhancement vaults_triage
    gibson042

Security Considerations

The PSM contract should not have the capability to mint the anchor balance and the fee pool balance after start-up. Perhaps a separate contract or bootstrap function should do the minting and provide the assets to the PSM contract.

Test Plan

  • unit tests with simulated chainStorage

Integration with chain will be tested in #7491

cc @turadg @Chris-Hibbert @ivanlei

@dckc dckc added enhancement New feature or request needs-design Inter-protocol Overarching Inter Protocol vaults-release labels Dec 7, 2022
@dckc dckc self-assigned this Dec 7, 2022
@dckc dckc added the user-story User story that needs to be implemented and tested. label Dec 12, 2022
@rowgraus rowgraus added the vaults_triage DO NOT USE label Dec 20, 2022
@dckc
Copy link
Member Author

dckc commented Jan 18, 2023

  • mint the balance of the anchor asset (e.g. USDC) - needs-design

We figured that out Dec 7:

How to mint USDC for PSM reboot?
Like BLD

@dckc
Copy link
Member Author

dckc commented Jan 26, 2023

take care not to re-do the minting!
(discussion with @warner)

reading from chainStorage conflicts with an architectural goal of not reading from devices, which [somehow?] facilitates parallelism. So more likely: we'll grab all the pre-bulldozer chainStorage state and feed it to the post-bulldozer bootstrap vat in vatParameters.

maybe mintHolder for USDC_axl isn't such a good idea... zcfMint?

re-adding all the PSM denoms will result in the same IAVL state, modulo board IDs. not double denoms

  • explicitly delete IAVL keys whose values have boardIds?
    • maybe delete :published.**
      • EC decision records???
        • copy pre-bulldozer history to a spreadsheet?
    • decline RPCs before the bulldozer?

@ivanlei ivanlei added this to the Vaults RC0 milestone Feb 1, 2023
@turadg turadg changed the title restore PSM state from chainStorage reinstantiate PSM with state from chainStorage Apr 20, 2023
dckc added a commit that referenced this issue Apr 20, 2023
dckc added a commit that referenced this issue Apr 24, 2023
dckc added a commit that referenced this issue Apr 25, 2023
fixes: #6645

 - compute total fees
 - style: keep to jessie-check in startPSM
 - use vatPowers.chainStorageEntries in restorePSM
dckc added a commit that referenced this issue Apr 25, 2023
fixes: #6645

 - compute total fees
 - style: keep to jessie-check in startPSM
 - use vatPowers.chainStorageEntries in restorePSM
dckc added a commit that referenced this issue Apr 25, 2023
fixes: #6645

 - compute total fees
 - style: keep to jessie-check in startPSM
 - use vatPowers.chainStorageEntries in restorePSM
@mergify mergify bot closed this as completed in #7480 Apr 27, 2023
mergify bot added a commit that referenced this issue Apr 27, 2023
…ished state (#7480)

* feat(psm): creatorFacet.makeRestoreMetricsInvitation

* feat: restore PSM state from former VM vstorage contents

fixes: #6645

 - compute total fees
 - style: keep to jessie-check in startPSM
 - use vatPowers.chainStorageEntries in restorePSM

* chore: never mind mintPSMFees

mint the fees within the PSM contract

* refactor: move makeHistoryReviver etc. to board-utils.js

* chore: findOldPSMState matches published governance shape

* fixup! refactor: move makeHistoryReviver etc. to board-utils.js

* refactor: factor out common published.psm.IST prefix

* refactor: length check before startsWith is superfluous

* fixup! refactor: move makeHistoryReviver etc. to board-utils.js

* refactor: move ChainStorageVatParams with other swingset types

* test: move makeHistoryReviver test; move data to fixture module

* refactor: use atomicTransfer

* refactor: clean up shapes

* refactor: default chainStorageEntries to [] earlier

* fixup: prune stray comment

* chore: prune redundant CONTRACT_ELECTORATE

* docs: explain override of governedParams

* refactor: use .name property of startPSM

* test: clean up installs.psm

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol user-story User story that needs to be implemented and tested. vaults_triage DO NOT USE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants