Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
326 stars 206 forks source link

smart-wallet: handle null slots better #7986

Open samsiegart opened 1 year ago

samsiegart commented 1 year ago

Describe the bug

The dapps make use of makeImportContext from smart-wallet to unmarshal serialized objects from vstorage, as well marshal them back when submitting transactions to the smart wallet. However, this util function throws when it encounters a null slot, which occurs in some inter protocol vstorage query results, breaking the fromCapData function. To circumvent this, the dapps have been patching the util to allow null slots.

Design the Fix

There's a few ways that this could be handled:

cc @dckc and @turadg for input

dckc commented 1 year ago

Design the Fix

There's a few ways that this could be handled:

...

  • Write a different makeImportContext function just for dapps and put it in ui-kit.

I'm leaning that way, since I think the current makeImportContext is not the way to go. In particular, I think when remotables are un-marshalled on the client side, they shouldn't know the board ID whence they came. The correspondence should be in a separate table.

My current thinking is in...

https://github.com/Agoric/agoric-sdk/blob/2d7a2c57b4228e0100bf3dfa70a2e3c34c9db7df/packages/inter-cli/src/lib/boardClient.js#L12

ivanlei commented 11 months ago

Agree on ui-kit approach.