fix(ocap-kernel): deserialize CapData rejections in queueMessage RPC handler#928
Merged
fix(ocap-kernel): deserialize CapData rejections in queueMessage RPC handler#928
Conversation
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
4aca412 to
0b1de28
Compare
Vat rejections are serialized as CapData objects before leaving the vat runtime. Previously, callers of Kernel.queueMessage (the RPC handler and SubclusterManager) each had their own isCapData/kunser call-site patches to convert them back into plain Errors. Consolidate the deserialization into Kernel.queueMessage itself so all callers see plain Error objects without needing individual workarounds. ([#928](#928))
0b1de28 to
2c83090
Compare
…zation
All callers of kernel.queueMessage now receive plain Error objects for
vat rejections instead of raw CapData. Update 8 test files across
evm-wallet-experiment, kernel-node-runtime, and kernel-test to assert
rejects.toThrow() instead of rejects.toMatchObject({ body: ... }).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vat rejections are serialized as CapData objects before leaving the vat
runtime. Previously, callers of Kernel.queueMessage (the RPC handler and
SubclusterManager) each had their own isCapData/kunser call-site patches
to convert them back into plain Errors. Consolidate the deserialization
into Kernel.queueMessage itself so all callers see plain Error objects
without needing individual workarounds.
Note
Medium Risk
Changes the error propagation contract of
Kernel.queueMessageto unwrap CapData rejections into plainErrors, which can affect all callers and tests that previously inspected serialized rejection shapes.Overview
Kernel message errors now surface as plain
Errors.Kernel.queueMessage()catches CapData-shaped rejections from the run queue and deserializes them viakunserbefore throwing, while non-CapData failures are rethrown unchanged.This removes duplicate CapData-unwrapping logic from
SubclusterManagerand updates RPC/unit/e2e/integration tests to assertrejects.toThrow(...)(or regex) instead of matching on a serialized{ body: ... }rejection payload. The ocap-kernel changelog is updated to document the fix.Reviewed by Cursor Bugbot for commit b672c99. Bugbot is set up for automated code reviews on this repo. Configure here.