-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: split marshal from its encoder #1259
Conversation
3467d9b
to
7c298e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this separation! My biggest concerns are around maintaining the distinction between "JSON" (string) and "JSON-representable" (data structure) and naming/commenting accordingly (related: #1248). And we also need to resolve the issue around iface
not being guaranteed to exist for every encoded remotable.
12b36ca
to
b68fd00
Compare
@gibson042 thanks for the great suggestions! I think I dealt with all of them. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Remaining comments are all minor, and mostly fixing typos.
ab51707
to
1447b28
Compare
Co-authored-by: Richard Gibson <[email protected]>
NOTE: LOW PRIORITY. NOTHING IS BLOCKED ON THIS.
The
encodePassable.js
module in agoric-sdk has two interesting differences from the current marshal logic.If it is such a great lower level of abstraction for encapsulating most encoding concerns, could we use this abstraction boundary to split marshal up into separately understandable pieces, separating concerns? This PR does approximately that, with the difference that the original
encodePassable
encodes directly to string, where the PR'sencodeToJSON
encodes to a raw JSON tree, leaving it to the caller to stringify it. Leaving aside that difference, splitting marshal in this way would make it easier to experiment with a marshal that use theencodePassable
binary encoding.This separation would make it easier to address issues like
* Agoric/agoric-sdk#4334
* Agoric/agoric-sdk#4310
* Agoric/agoric-sdk#4311
* #997
* Agoric/agoric-sdk#2780
and is a prerequisite for #1260 , which is staged on this one.