-
Notifications
You must be signed in to change notification settings - Fork 226
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 description to pass-by-presence objects? #28
Labels
captp
package: captp
eventual-send
package: eventual-send
marshal
package: marshal
SwingSet
package: SwingSet
Comments
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
delay WeakMap until after xs preload
dckc
pushed a commit
to dckc/agoric-sdk
that referenced
this issue
Dec 5, 2019
Previously, each syscall/dispatch API (and lots of internal interfaces, like the run-queue) used an inconsistent variety of ways to pass the two halves of "data that can include capability references": the string of serialized data, plus the array of slots (like 'o+4' and 'p-4'). This defines a type (to the extent that one can define types in Javascript) named "CapData" to hold "capability-bearing data". Instances of this type contain exactly `{ body, slots }`. All API signatures that used to pass two arguments now pass a single CapData-typed argument. It also defines a type named "Message", which contains `{ method, args, result }`, where `method` is a string that names the method to be invoked, `args` is a CapData whose top-level member is an array (of positional arguments), and `result` is either a promise reference or `null`/`undefined`. "Message" is not revealed to Vats, but the various in-kernel run-queues and delivery APIs are now written in terms of Messages rather than distinct method / args / result fields. This depends upon a new version of `@agoric/marshal` which uses CapData in serialize/unserialize, rather than separate string and slots arguments. refs Agoric#28
dckc
pushed a commit
to dckc/agoric-sdk
that referenced
this issue
Dec 5, 2019
See #804 |
As an aid to debugging under benign conditions, done. Closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
captp
package: captp
eventual-send
package: eventual-send
marshal
package: marshal
SwingSet
package: SwingSet
For debugging (as well as general learn-by-experimentation), it would be nice to have a way to attach descriptions to the various pass-by-presence objects we fling around. The current situation is that these arrive as a Presence on the remote side, which is an empty
harden()
ed object with nothing to suggest what it's good for, where it came from, or what methods it might respond to.The simplest improvement would to just make sure that
.toString()
can be (remotely) invoked, and establish a convention of including atoString()
when you construct the object. This requires a roundtrip to do the lookup, and doesn't reveal any information to the kernel, so it's only usable from some other vat.Another approach that we kicked around today would be to define a special symbol (a "registered Symbol", in JS parlance) that we use to attach a descriptive string. The construction-time syntax would look like:
The
description
string is the magic one: it would match something defined inliveSlots.js
so the marshalling code can recognize the property. We could also pass the symbol into userspace the same we passE
.To implement this, we'd need to change:
marshal.js
: the presence of this Symbol shouldn't disqualify the object from pass-by-presence serializationliveSlots.js
: define the symbol, serialize pass-by-presence with an additional property (instead of just{ type: 'export', id }
, it needs to be{ type: 'export', id, description }
)syscall.send
anddispatch.deliver
protocol must change to include the description on the first delivery of the presence recordvatManager.js
needs to track exported presence records (which it doesn't currently track), to make sure we capture the description only on the first time the presence is exported from a vat. We need these to be immutable, and if a non-liveslots userspace decides to change the description each time it exports the same object, the kernel and other vats shouldn't see the changes.kernel.js
and thedump()
function would benefit from including these descriptions in the printable representations of the kernel c-list tablesThe text was updated successfully, but these errors were encountered: