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

move vatParameters to startVat() delivery #4787

Merged
merged 3 commits into from
Mar 12, 2022
Merged

Conversation

warner
Copy link
Member

@warner warner commented Mar 9, 2022

fix(swingset): deliver vatParameters in startVat()

Previously, vatParameters arrived at a vat worker in the setBundle
message to the supervisor (the same one that provided the vat's source
bundle). This changes the code to deliver them inside the
dispatch.startVat() invocation instead.

Liveslots-based vats see no change: both cases hand vatParameters in via the
buildRootObject() call. setup()-based vats must change: the setup()
call no longer contains a vatParameters argument, and vatParameters are
available temporally later than before.

As a result, the comms vat must wait for startVat() to learn its two
configuration settings: identifierBase and sendExplicitSeqNums. Comms now
uses both to initialize its state DB, and reads sendExplicitSeqNums from
the DB for each transit() call.

This paves the way for vatParameters to contain slots, not just inert data.
The VatTranslator that converts startVat KernelDeliveryObjects into
VatDeliveryObjects does not yet perform slot translation, nor does liveslots
treat vatParameters as capdata, but they are now in the right place to
perform those tasks.

refs #4381
closes #4766

@warner warner added the SwingSet package: SwingSet label Mar 9, 2022
@warner warner requested a review from FUDCo March 9, 2022 08:27
@warner warner self-assigned this Mar 9, 2022
@warner
Copy link
Member Author

warner commented Mar 9, 2022

@FUDCo I recommend reviewing one commit at a time, they're pretty independent, but the first two seemed too small for their own PRs.

Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, though it seems like a lot of mechanism just to add one parameter to startVat.

@warner
Copy link
Member Author

warner commented Mar 11, 2022

Looks fine, though it seems like a lot of mechanism just to add one parameter to startVat.

True, but the important thing is that startVat (as a delivery) can have its arguments translated through the c-list (and populates the c-list, and increments the refcounts), which means vatParameters will be able to hold slots, which means they'll be able to hold bundlecaps, which is important for our upgrade story.

use Far('root', ..) instead of 'vref', this matches our conventions for
`buildRootObject` better and will make the device-hooks test easier to write.
For consistency, `kernel.createTestVat()` now sends a `dispatch.startVat` to
these `setup`-based test vats, just like all normal vats.

Some tests were modified to ignore the extra delivery they now observe.

refs #4381
Previously, `vatParameters` arrived at a vat worker in the `setBundle`
message to the supervisor (the same one that provided the vat's source
bundle). This changes the code to deliver them inside the
`dispatch.startVat()` invocation instead.

Liveslots-based vats see no change: both cases hand vatParameters in via the
`buildRootObject()` call. `setup()`-based vats must change: the `setup()`
call no longer contains a `vatParameters` argument, and vatParameters are
available temporally later than before.

As a result, the comms vat must wait for `startVat()` to learn its two
configuration settings: `identifierBase` and `sendExplicitSeqNums`. Comms now
uses both to initialize its state DB, and reads `sendExplicitSeqNums` from
the DB for each `transit()` call.

This paves the way for `vatParameters` to contain slots, not just inert data.
The VatTranslator that converts `startVat` KernelDeliveryObjects into
VatDeliveryObjects does not yet perform slot translation, nor does liveslots
treat `vatParameters` as capdata, but they are now in the right place to
perform those tasks.

refs #4381
closes #4766
@warner warner force-pushed the 4381-startvat-vatparameters branch from 6292fbf to d1f4918 Compare March 12, 2022 01:41
@warner warner added the automerge:rebase Automatically rebase updates, then merge label Mar 12, 2022
@mergify mergify bot merged commit 4c4da6a into master Mar 12, 2022
@mergify mergify bot deleted the 4381-startvat-vatparameters branch March 12, 2022 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

comms: provide sendExplicitSeqNums in vatParameters
2 participants