spritely/goblins
4
58
Fork
You've already forked goblins
4

Add networked debugging to Questie via CapTP #79

Open
opened 2023年03月07日 15:15:16 +01:00 by flockofbirbs · 1 comment
flockofbirbs commented 2023年03月07日 15:15:16 +01:00 (Migrated from gitlab.com)
Copy link

It is an open question as to how we implement this. Needs some serious thought...

It is an open question as to how we implement this. Needs some serious thought...

Here is the current situation. The trace of (with-vat vat-a (<- bob "Alice")) is currently disconnected near the CapTP boundary. Starting from the entry point, we only see this:

Vat A, 44: (message #<local-object ^call-with-vat>)
├▸ Vat A, 45: (message #<local-promise> "Alice")
└▸ Vat A, 46: (listen #<local-promise>)

I was hoping to at least see a CapTP actor show up here, but alas it does not. So, there's a gap in our local-only tracing that needs to be dealt with.

Starting from the end and working backwards, we see this:

Vat A, 207: (message #<local-object #{swappable: ^setup-completer}#> #<<op:deliver-only> to-desc: #<<desc:export> pos: 2> args: (fulfill "Hello, Alice! My name is Bob.")>)
└▸ Vat A, 208: (message #<local-object resolver> fulfill "Hello, Alice! My name is Bob.")
 └▸ Vat A, 209: (message #<local-object ^resolver> fulfill "Hello, Alice! My name is Bob.")
 └▸ Vat A, 210: (message #<local-object ^resolver> fulfill "Hello, Alice! My name is Bob.")
 └▸ Vat A, 211: (message #<local-object ^on-listener> fulfill "Hello, Alice! My name is Bob.")
 └▸ Vat A, 212: (message #<local-object fulfilled-handler> "Hello, Alice! My name is Bob.")

This at least shows that the promise resolution was caused by an op:deliver-only message.

We need a way to link a local event with a remote one, so that we can stitch together these two partial event trees. Some ideas:

  1. Each side of a CapTP session could have a monotonically increasing message counter so they can keep a side table mapping remote message ids to the relevant local message.
  2. Each side of a CapTP session could likewise have a side table mapping local messages to remote message ids.
  3. The bootstrap object could be extended with methods for querying based on remote message id.

There are some difficulties to making this plan work as Goblins is currently implemented.

  1. The CapTP implementation speaks "high-level" Goblins for message dispatch. For example, op:deliver-only results in (apply <-np target args). The underlying <message> object that this creates is inaccessible to CapTP, so there's no way to create the mapping described in item 1 above. If we could instead speak in terms of low-level messages then we'd have something that is eq? that would be stored in a vat event record and CapTP's debug side table.
  2. Vat event records have no way of recording that a local event is linked to a CapTP event. We need a way for a local vat event to point at a CapTP event so the debug tools can reach out via <- to gather the remotely held debug data. This may require changes at the vat connector level.
Here is the current situation. The trace of `(with-vat vat-a (<- bob "Alice"))` is currently disconnected near the CapTP boundary. Starting from the entry point, we only see this: ``` Vat A, 44: (message #<local-object ^call-with-vat>) ├▸ Vat A, 45: (message #<local-promise> "Alice") └▸ Vat A, 46: (listen #<local-promise>) ``` I was hoping to at least see a CapTP actor show up here, but alas it does not. So, there's a gap in our local-only tracing that needs to be dealt with. Starting from the end and working backwards, we see this: ``` Vat A, 207: (message #<local-object #{swappable: ^setup-completer}#> #<<op:deliver-only> to-desc: #<<desc:export> pos: 2> args: (fulfill "Hello, Alice! My name is Bob.")>) └▸ Vat A, 208: (message #<local-object resolver> fulfill "Hello, Alice! My name is Bob.") └▸ Vat A, 209: (message #<local-object ^resolver> fulfill "Hello, Alice! My name is Bob.") └▸ Vat A, 210: (message #<local-object ^resolver> fulfill "Hello, Alice! My name is Bob.") └▸ Vat A, 211: (message #<local-object ^on-listener> fulfill "Hello, Alice! My name is Bob.") └▸ Vat A, 212: (message #<local-object fulfilled-handler> "Hello, Alice! My name is Bob.") ``` This at least shows that the promise resolution was caused by an `op:deliver-only` message. We need a way to link a local event with a remote one, so that we can stitch together these two partial event trees. Some ideas: 1) Each side of a CapTP session could have a monotonically increasing message counter so they can keep a side table mapping remote message ids to the relevant local message. 2) Each side of a CapTP session could likewise have a side table mapping local messages to remote message ids. 3) The bootstrap object could be extended with methods for querying based on remote message id. There are some difficulties to making this plan work as Goblins is currently implemented. 1) The CapTP implementation speaks "high-level" Goblins for message dispatch. For example, `op:deliver-only` results in `(apply <-np target args)`. The underlying `<message>` object that this creates is inaccessible to CapTP, so there's no way to create the mapping described in item 1 above. If we could instead speak in terms of low-level messages then we'd have something that is `eq?` that would be stored in a vat event record *and* CapTP's debug side table. 2) Vat event records have no way of recording that a local event is linked to a CapTP event. We need a way for a local vat event to point at a CapTP event so the debug tools can reach out via `<-` to gather the remotely held debug data. This may require changes at the vat connector level.
Sign in to join this conversation.
No Branch/Tag specified
main
hashtable-actor
vat-log-resize-metacommand
fix-ocapn-ci
fix-796
support-zero-values
maybe-fix-ocapn-ci
document-wants-partial
prelay-docs
aurie-docs
lazy-captp
fast-sealers-fast-spawn
more-handoff-recieve-checks
ocapn-test-suite
add-keys-values-to-ghash-actor
docs-captp-ref-passing
fix-nested-with-vat
fix-281
captp-crossed-hellos
fix-243
sleepymaps
hootify-tests
move-define-actor-docs
websocket-netlayer
hoot-deprecation-warning
add-new-on-macros
replace-while-with-do
unenclose-syscaller
update-methods
new-devel
aurie-netlayer
devel
document-value-extraction
aurie-churn-fix
io-actor
cwebber-aurie-foundations
ci-code-coverage
0.12-news
gnutls-package
oops-all-goblins
relay-maybe-simplified
fake-indentation-fix
captp-remove-wants-partial-from-op-listen
mvre-wtf
multi-value-return-everywhere
simple-pick
remove-ports-dynamic-wrap
fast-spawn
additional-vat-events
onion-netlayer-temp
klugey-queue-captp-message
rest-of-captp
facet
ghash-pretty-print
fixing-syrup
fake-netlayer
onion-netlayer
string-formatting-errors
remove-waiter-cruft
lmethods
current-scheduler-kludge
hygienic-define-recordable
convert-captp
v0.17.0
v0.16.1
v0.16.0
v0.15.1
v0.15.0
v0.14.0
v0.13.0
v0.12.0
v0.11.0
v0.10
v0.8
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
spritely/goblins#79
Reference in a new issue
spritely/goblins
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?