Open dckc opened 1 month ago
We could also enhance the StorageNode API to perform serialization locally:
const capDataP = E(boardMarshaller).toCapData(objectGraph);
await E(storageNode).serializeAndSetValue(capDataP);
(which would likely have smaller overall message size by avoiding the double encoding necessary to send an already serialized representation, but may be more difficult to effect because it would require upgrading the bridge vat)
What is the Problem Being Solved?
While looking at performance of a PSM trade (#6039), we noticed two round trips in each wallet state update - one for
serialize
and one forsetValue
:I re-discovered this pattern in
10231
Description of the Design
Have the board marshaller return
JSON.stringify(capData)
rather thancapData
. Then the smart wallet can doand
stringValueP
can be forwarded to the bridge vat without a round trip back thru the smart wallet.There's a proof of concept in...
Security Considerations
Scaling Considerations
fewer round trips should scale better
Test Plan
Upgrade Considerations
This would be deployed in an upgrade of
walletFactory
.It would be nice to update any other clients that exhibit this pattern, but this issue is scoped to the smart wallet, which is where we see the problem happen most often.