-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(swingset): add "upgrade events" management
Host applications are responsible for calling `upgradeSwingset(kernelStorage)` before creating the controller, at least when the kernel package version has been changed, to perform any necessary upgrades to the kernel state. Previously, if the upgrades needed to inject messages into the run-queue (e.g. the `dispatch.notify` messages used to remediate leftover problems from #9039), `upgradeSwingset` would inject them automatically, which could intermingle their cranks with anything still in the run-queue when the upgrade occurs (like if the previous block had leftover work to do). With this commit, these messages are instead held internally by the kernel, in a new kvStore key (`upgradeEvents`), so the host can choose when to inject them, for instance *after* it has drained the run-queue of any leftover work. This introduces a new host-app responsibility: when `upgradeEvents()` indicates that modifications have been made, the app must call `controller.injectQueuedUpgradeEvents()` some time before the next `hostStorage.commit()`. That will add the remediation messages to the acceptance queue, so the next `controller.run()` will execute them.
- Loading branch information
Showing
8 changed files
with
158 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters