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

Retire promises that reference only "new" other promises #1125

Closed
FUDCo opened this issue May 21, 2020 · 1 comment
Closed

Retire promises that reference only "new" other promises #1125

FUDCo opened this issue May 21, 2020 · 1 comment
Assignees
Labels
SwingSet package: SwingSet

Comments

@FUDCo
Copy link
Contributor

FUDCo commented May 21, 2020

Paraphrased from the discussion in #1049:

Drop references that have no already exported promises:

This is the "95% solution". The general idea is that resolutions which only reference brand new promises cannot introduce cycles that involve previously-existing promises, and wouldn't cause a recursion problem. Dean said a lot of ERTP/Zoe functions will return a record full of (new) Promises, and this would let their result promises be retired.

For the sending side (vat does syscall.fulfill*), the vat looks at the liveslots tables to see whether the referenced promises are already present or not. It's not immediately obvious how we'll implement this: Dean suggested measuring the size of the tables before+after serialization and seeing if it changed, but we use the same table for both objects and promises. Perhaps we modify the tables to maintain a count of just promise allocation. Or we introduce a generation number and a WeakMap that maps each Promise to an integer, and then after serialization we look at generationMap.get(slotToVal.get(promiseSlot)) > previousGeneration to see if anything is new.

On the receiving side (kernel does dispatch.notifyFulfill*), it's a bit easier, because all the kernel is doing is a linear mapping of slot IDs (kpid and koid) into vat-side references (vpid and void), and it can just ask the c-list if the kernel-id is present before asking it to provide a new one.

@FUDCo FUDCo added the SwingSet package: SwingSet label May 21, 2020
@FUDCo FUDCo self-assigned this May 21, 2020
@warner
Copy link
Member

warner commented Feb 8, 2021

This is done, we now have the 100% solution (retire all resolved promises, not just the "easy" ones)

@warner warner closed this as completed Feb 8, 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

2 participants