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
We noticed that deviceSlots.js is still using the old-fashioned way to construct Presences. Newer code (in liveSlots.js) uses HandledPromise mechanisms to create promise/presence pairs. One consequence is that the presence objects handed to device code have spurious extra debug properties:
This showed up in #1309 in some code which wanted to use an "options bag", which defaults to an empty object (which is pass-by-reference between vats, and shows up as a Presence). I was trying to guard against typos in the options by checking for unrecognized properties on the options bag:
When I had a vat method include an options={} default value, the device received a Presence, and handed an object with a _importID_NN property to this code, which triggered that check. The liveslots/HandledPromise approach would probably not have. I fixed the problem by removing the default from everywhere except the last step, so marshal is not being asked to pass empty objects when callers omit the options. But someone could easily run into this again later if the dynamic vat creation code gets refactored.
So the task is to update deviceSlots.js to use the same code as liveSlots.js. One potential wrinkle is that devices don't really support promises as well as regular vats, because they don't manage state in quite the same way (no transcript-replay -based orthogonal persistence).
We don't have a lot of devices, and they're only created/modified by a small set of people, so this is low-priority.
The text was updated successfully, but these errors were encountered:
What is the Problem Being Solved?
We noticed that
deviceSlots.js
is still using the old-fashioned way to construct Presences. Newer code (inliveSlots.js
) usesHandledPromise
mechanisms to create promise/presence pairs. One consequence is that the presence objects handed to device code have spurious extra debug properties:agoric-sdk/packages/SwingSet/src/kernel/deviceSlots.js
Lines 23 to 27 in 4fe3c83
This showed up in #1309 in some code which wanted to use an "options bag", which defaults to an empty object (which is pass-by-reference between vats, and shows up as a Presence). I was trying to guard against typos in the options by checking for unrecognized properties on the options bag:
agoric-sdk/packages/SwingSet/src/kernel/dynamicVat.js
Lines 42 to 47 in fb07411
When I had a vat method include an
options={}
default value, the device received a Presence, and handed an object with a_importID_NN
property to this code, which triggered that check. The liveslots/HandledPromise approach would probably not have. I fixed the problem by removing the default from everywhere except the last step, somarshal
is not being asked to pass empty objects when callers omit the options. But someone could easily run into this again later if the dynamic vat creation code gets refactored.So the task is to update
deviceSlots.js
to use the same code asliveSlots.js
. One potential wrinkle is that devices don't really support promises as well as regular vats, because they don't manage state in quite the same way (no transcript-replay -based orthogonal persistence).We don't have a lot of devices, and they're only created/modified by a small set of people, so this is low-priority.
The text was updated successfully, but these errors were encountered: