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

add promise forwarding #50

Closed
warner opened this issue Sep 9, 2019 · 1 comment
Closed

add promise forwarding #50

warner opened this issue Sep 9, 2019 · 1 comment
Assignees
Labels
SwingSet package: SwingSet

Comments

@warner
Copy link
Member

warner commented Sep 9, 2019

As mentioned (briefly) in https://github.com/Agoric/SwingSet/issues/88#issue-466473458 , we still need to implement the "forwarding" type of promise resolution, and figure out notification for it.

On the initiating side, a vat will call syscall.resolve() with a type of "forward" and a value of a Promise. (or we remove the "type" from resolve() and just look at the argument: if it's a Promise, then this is a forwarding instead of a fulfill-to-object or fulfill-to-data).

Within the kernel, the simplest/laziest implementation just sets the Promise Table to state=forwarded(newpromise). All other operations that touch that promise (subscriptions, delivering messages to it) look through to the new promise instead.

When doing the resolution, we must make sure we don't create a cycle. It should probably be illegal for a vat to create a cycle (i.e. the vat gets terminated), but we should make sure it's not possible for one vat to kill another in this way.

On the receiving side, vats should probably be notified when a Promise they've heard about gets resolved/forwarded to some other promise (which they might then be told about for the first time).

The more sophisticated/clever kernel implementation would walk the clists and kernel tables and replace all references to the old promise with the new one. This would let us delete things faster. OTOH, we have to think more carefully about what the vats still know about (non-injective mappings in the clists, as two vat promise IDs now actually map to the same kernel promise).

@warner warner transferred this issue from Agoric/SwingSet Dec 1, 2019
@warner warner added the SwingSet package: SwingSet label Dec 1, 2019
dckc pushed a commit to dckc/agoric-sdk that referenced this issue Dec 5, 2019
dckc pushed a commit to dckc/agoric-sdk that referenced this issue Dec 5, 2019
dckc pushed a commit to dckc/agoric-sdk that referenced this issue Dec 5, 2019
@erights
Copy link
Member

erights commented Feb 26, 2021

Done right? Assigning to you two but closing.

@erights erights closed this as completed Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwingSet package: SwingSet
Projects
None yet
Development

No branches or pull requests

3 participants