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

Comms vat promise resolution handling needs to selectively deliver auxiliary resolves #2249

Closed
FUDCo opened this issue Jan 23, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request SwingSet package: SwingSet

Comments

@FUDCo
Copy link
Contributor

FUDCo commented Jan 23, 2021

The changes to the comms vat landed as part of #2242 treat the collection of promises contained in a notify message as subsidiary to the first promise in the collection, which they are at the point of origination. However, since the comms vat fronts for possible multiple swingsets elsewhere, it may be possible that there are swingsets subscribed to subsidiary promises that are not subscribed to the primary promise. This means that the bundle may need to be taken apart and repackaged in different subsets of conveyance to different remotes. We need to figure out if this is necessary, and if so figure out how to do it, then do it.

@FUDCo FUDCo added enhancement New feature or request SwingSet package: SwingSet labels Jan 23, 2021
@FUDCo FUDCo self-assigned this Jan 23, 2021
@warner
Copy link
Member

warner commented Jan 23, 2021

Hm, maybe the right approach is for the comms vat to:

  • process the incoming notify bundle, update the comms promise table status for each, collect a list of (remoteID, localPromiseID) notifications that need to be sent out (remembering that one of the remoteID might be the kernel)
  • extract the set of remoteIDs from that list, loop over it
    • find all the promiseIDs that this particular remoteID needs to know about
    • use that as the initial contents of the outgoing bundle
    • examine all members of the bundle for resolved data that contains more resolved promises, add them, just like we do in the kernel, and will do in liveslots
    • loop until nothing is left
    • translate all local refs (lrefs) in the bundle into remote-refs (rrefs)
    • delete the c-list entries for all the promises resolved (from this remotes c-list only)
    • send the bundle

Ideally this should mirror what the kernel does. The kernel does its resolutions spread out over multiple cranks (at least one per target vat) but in theory it could do the same sort of batching/preparation as outlined above.

This does raise a question for future refactorors: given how similar the comms vat algorithm must be to the kernel algorithm, should we try to factor out that logic into some shared code? Or should the kernel absorb the comms vat and do its job directly? The big difference is that local cranks are immediate (specifically, no syscalls are emitted outside of a crank, so the kernel doesn't need to worry about messages passing like ships in the night), whereas remote systems are most decidedly asynchronous and all table-deallocation steps must prepare for crossing messages.

@FUDCo FUDCo changed the title Comms vat notification handling may need to do something more complicated Comms vat promise resolution handling needs to selectively deliver auxiliary resolves Mar 11, 2021
@FUDCo
Copy link
Contributor Author

FUDCo commented Apr 10, 2021

Closed by #2752

@FUDCo FUDCo closed this as completed Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SwingSet package: SwingSet
Projects
None yet
Development

No branches or pull requests

2 participants