You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 aWeakMap
that maps eachPromise
to an integer, and then after serialization we look atgenerationMap.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
andkoid
) into vat-side references (vpid
andvoid
), and it can just ask the c-list if the kernel-id is present before asking it to provide a new one.The text was updated successfully, but these errors were encountered: