-
Notifications
You must be signed in to change notification settings - Fork 221
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
wallet action, inter protocol data is wrapped in 2 JSON.stringify layers #7999
Comments
related conversation: endojs/endo#1402 (comment) |
a related PR was closed for lack of motivation: this perhaps adds some motivation |
ExplorersThe contract explorer bounty is yet another context where I don't look forward to explaining the double-quoting convention. ProtobufCosmos Explorers already have to deal with protobuf. Not to mention indexing / query stuff such as subquery: In the OCapN context, I did a little playing around with protobuf encoding for passables: Single-level JSONI just worked up an idea that I had recently: Comms / DeliverInbound formatAnother option would be the format used in the Comms Message format used in DeliverInbound messages:
for example: |
In endojs/endo#1804 (review) , @mhofman writes:
What would that look like for the offer example above? Would it involve passing a complex object (requiring lots of allocations) through the swingset kernel rather than a |
Potentially, unless we have an optimization of not parsing a subset of the json, which is what @gibson042 and I mentioned we needed help from the parser for. In this PR you effectively implement that optimization for a subset of CapData json shapes. I'd prefer to take the approach of specifying the new CapDate tree format, and separating the concern of avoiding the parsing of the body tree as a future optional optimization. |
Describe the bug
The
.action
field ofMsgWalletSpendAction
isJSON.stringify(capData)
wherecapData
includes a.body
that is alreadyJSON.stringify
ed.Senders pay by the byte, so the extra quoting costs.
To Reproduce
Steps to reproduce the behavior:
inter bid by-price --price 7 --give 0.003IST --generate-only --from k1 >spend-action.json
Expected behavior
One layer of JSON.stringify should suffice.
For example, send the
.body
and.slots
as separate protobuf message fields.Platform Environment
agoric-upgrade-10 mainnet
The text was updated successfully, but these errors were encountered: