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

make vat-localchain resumable #9484

Closed
turadg opened this issue Jun 11, 2024 · 1 comment · Fixed by #9488
Closed

make vat-localchain resumable #9484

turadg opened this issue Jun 11, 2024 · 1 comment · Fixed by #9488
Assignees
Labels
enhancement New feature or request

Comments

@turadg
Copy link
Member

turadg commented Jun 11, 2024

What is the Problem Being Solved?

The localchain vat is upgradable, but when it does any outstanding promises will be severed.

Description of the Design

  • Change the type of every return to PromiseVow (@returns {Promise<T>} becomes @returns {PromiseVow<T>} to ensure that callers of that function use either when or watch to extract T)
  • Use watch for the deposit method implementation (but I think we can still consider skipping that one)

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@turadg turadg added the enhancement New feature or request label Jun 11, 2024
@mhofman
Copy link
Member

mhofman commented Jun 11, 2024

To clarify, the localchain vat seem to be resumable today given the following:

  • We maintain the scheduling property where a vat is only upgraded after swingset is quiescent (assumptions about current scheduling and how upgrades are triggered)
  • deposit() deals with a "local to the chain" payment object (assumption about origin of issuers / payments).

Since we'll likely need to stop making these assumptions in the future, consumer of the localchain API should be able to handle a vow return value. Changing the type now helps detect cases where consumers are not ready.

@mergify mergify bot closed this as completed in #9488 Jun 14, 2024
mergify bot added a commit that referenced this issue Jun 14, 2024
closes: #9484 closes: #9497

## Description

 - Changes the type of every return in `localchain.js` to `PromiseVow`
 - Uses `watch` for `.query()` and `.deposit()` methods and returns a `Vow`
 - Updates call sites outside `vat-localchain` to expect and unwrap PromiseVows (using `V`) 

### Upgrade Considerations

These changes better prepare us for upgrades - consumers will know to expect a `PromiseVow`.
mhofman pushed a commit that referenced this issue Jun 20, 2024
closes: #9484 closes: #9497

## Description

 - Changes the type of every return in `localchain.js` to `PromiseVow`
 - Uses `watch` for `.query()` and `.deposit()` methods and returns a `Vow`
 - Updates call sites outside `vat-localchain` to expect and unwrap PromiseVows (using `V`) 

### Upgrade Considerations

These changes better prepare us for upgrades - consumers will know to expect a `PromiseVow`.
mhofman pushed a commit that referenced this issue Jun 22, 2024
closes: #9484 closes: #9497

## Description

 - Changes the type of every return in `localchain.js` to `PromiseVow`
 - Uses `watch` for `.query()` and `.deposit()` methods and returns a `Vow`
 - Updates call sites outside `vat-localchain` to expect and unwrap PromiseVows (using `V`) 

### Upgrade Considerations

These changes better prepare us for upgrades - consumers will know to expect a `PromiseVow`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants