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

Contract Upgrade: V28 ProvisionPool and V14 Bank #10395

Closed
Chris-Hibbert opened this issue Nov 1, 2024 · 4 comments · Fixed by #10419
Closed

Contract Upgrade: V28 ProvisionPool and V14 Bank #10395

Chris-Hibbert opened this issue Nov 1, 2024 · 4 comments · Fixed by #10419
Assignees
Labels
contract-upgrade enhancement New feature or request

Comments

@Chris-Hibbert
Copy link
Contributor

Chris-Hibbert commented Nov 1, 2024

What is the Problem Being Solved?

As mentioned in #8158, we need the ability to restart or replace all vats. This issue is focused on upgrading v28-ProvisionPool and v14-bank. They are related because of #8722 and #8724, which were addressed by #9481.

Description of the Design

These upgrades have been tested previously, and are in agoric-3-proposals/upgrade-17. The goal here is to reinstate those in a3p-integration, and stage them in upgrade.go for the next upgrade.

In addition, vat-bank is a client of feeDistributor, which will be separately be upgraded. Let's re-review the tests to be sure that vat-bank continues to send fees after an upgrade.

Security Considerations

vat-bank is a critical vat. provisionPool is involved in creating new smartWallets.

Scaling Considerations

not significant.

Test Plan

Move proposals/78:upgrade-17/provisionPool.test.js from agoric-3-proposals to a3p-integration. Verify that it checks everything relevant.

Upgrade Considerations

See above.

@Chris-Hibbert Chris-Hibbert added enhancement New feature or request contract-upgrade labels Nov 1, 2024
@anilhelvaci
Copy link
Collaborator

Thanks for creating the issue @Chris-Hibbert . A few questions here;

When I read proposals/78:upgrade-17/provisionPool.test.js code I can see that both vat-bank and vat-provisionPool start with incarnation = 0. However, as far as I can understand how upgrade.go is intended to work, staging vat-bank and vat-provisionPool in ugrade.go will result they will enter the testing phase with their incarnation being equal to 1. Which makes me think if logic in provisionPool.test.js will actually make sense when both vats are already upgraded.

@anilhelvaci anilhelvaci self-assigned this Nov 4, 2024
@Chris-Hibbert
Copy link
Contributor Author

[in proposals/78:upgrade-17/provisionPool.test.js] both vat-bank and vat-provisionPool start with incarnation = 0. However, as far as I can understand how upgrade.go is intended to work, staging vat-bank and vat-provisionPool in ugrade.go will result they will enter the testing phase with their incarnation being equal to 1.

Yep. The point of adding them to upgrade.go is that they will actually upgrade, and their incarnations will increment. So the test will need to be updated.

I think it would be great to test both an existing and a new currency.

Why do you think using a core-eval that both adds a new asset then deposits it into provisionPool is not reasonable?

Turadg's suggestion is totally reasonable.

Where should we local this provisionPool.test.js? z:acceptance ?

I don't think this test needs to survive after the next upgrade. It would normally go in n:upgrade-next, but that's still tangled with U18 stuff. I'd make a new directory, like p:upgrade-19, with the intent that that moves to upgrade-next once that has been cleared out.

@anilhelvaci
Copy link
Collaborator

Yep. The point of adding them to upgrade.go is that they will actually upgrade, and their incarnations will increment. So the test will need to be updated.

I think it would be great to test both an existing and a new currency.

Alright I'll start working on updating tests with Turadg's suggestion.

I don't think this test needs to survive after the next upgrade. It would normally go in n:upgrade-next, but that's still tangled with U18 stuff. I'd make a new directory, like p:upgrade-19, with the intent that that moves to upgrade-next once that has been cleared out.

Thanks, I'll put the new tests under p:upgrade-19

@anilhelvaci
Copy link
Collaborator

Change requests to the PR indicates a dependency #10514

anilhelvaci added a commit that referenced this issue Nov 21, 2024
anilhelvaci added a commit that referenced this issue Nov 21, 2024
anilhelvaci added a commit that referenced this issue Nov 26, 2024
anilhelvaci added a commit that referenced this issue Nov 26, 2024
anilhelvaci added a commit that referenced this issue Nov 27, 2024
anilhelvaci added a commit that referenced this issue Nov 27, 2024
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace
anilhelvaci added a commit that referenced this issue Nov 27, 2024
anilhelvaci added a commit that referenced this issue Nov 27, 2024
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace

chore: address change requests
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace

chore: address change requests

fix: rebase fixes
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace

chore: address change requests

fix: rebase fixes

fix: yarn.lock fix
anilhelvaci added a commit that referenced this issue Nov 27, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace

chore: address change requests

fix: rebase fixes

fix: yarn.lock fix

fix: bring back missing upgrade-paRegistry proposal
anilhelvaci added a commit that referenced this issue Dec 2, 2024
anilhelvaci added a commit that referenced this issue Dec 2, 2024
anilhelvaci added a commit that referenced this issue Dec 2, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace

chore: address change requests

fix: rebase fixes

fix: yarn.lock fix

fix: bring back missing upgrade-paRegistry proposal
anilhelvaci added a commit that referenced this issue Dec 3, 2024
anilhelvaci added a commit that referenced this issue Dec 3, 2024
anilhelvaci added a commit that referenced this issue Dec 3, 2024
Make sure the handler returned from E(creatorFacet).makeHandler() is durable and provisionPool is upgradable multiple times.

Refs: #10425
Refs: #10564

fix: remove unnecessary comment

chore: get rid of ephemera, address change requests

Refs: #10395
Refs: #10425

fix: drop trace

chore: address change requests

fix: rebase fixes

fix: yarn.lock fix

fix: bring back missing upgrade-paRegistry proposal
@mergify mergify bot closed this as completed in #10419 Dec 3, 2024
mergify bot added a commit that referenced this issue Dec 3, 2024
…grade (#10419)

closes: #10395
closes: #10425 
closes: #10564



## Description

As mentioned in #8158, we need the ability to restart or replace all vats. This PR focuses on the vats v28-provisionPool and v14-bank. The goal is to make sure after upgrading both of those vats, v28-provisionPool functionality keeps working. We pay special attention to #8722 and #8724 during the tests as those issues were identified as potential problems against v28-provisionPool upgrade.

### Security Considerations

v28-provisionPool and v14-bank are critical vats for the system when it comes to onboarding new users and keeping track of ERTP representations of user assets. Reviewers, please highlight the slightest risk you see.

### Scaling Considerations

v28-provisionPool vat has a linear relationship with the number of users entering the Agoric system. So it is pretty important it keeps working. Reviewers, please highlight the slightest risk you see.

### Documentation Considerations

None.

### Testing Considerations

During the testing, we focused on `provisionPoolAddress`' cosmos level balances as our source of truth. The reasoning behind this is; if the IST balance of the `provisionPoolAddress` it can only mean
- it has received the anchor asset we've sent 
- v28-provisionPool is notified of this balance change
- executed a swap against corresponding PSM
- deposited the payout to IST purse
- v14-bank updated the balances correctly

In our test we send two anchor assets;
* USDC_axl to make sure v28-provisionPool recovered existing purses
* USD_LEMONS to make sure v28-provisionPool is notified of new assets

### Upgrade Considerations

Both v28-provisionPool and v14-bank are staged upgrades in `upgrade.go`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract-upgrade enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants