Skip to content
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

smart-wallet PSM trade performs 17 account-state storage updates #6038

Closed
warner opened this issue Aug 23, 2022 · 4 comments
Closed

smart-wallet PSM trade performs 17 account-state storage updates #6038

warner opened this issue Aug 23, 2022 · 4 comments
Labels
bug Something isn't working performance Performance related issues wallet
Milestone

Comments

@warner
Copy link
Member

warner commented Aug 23, 2022

Describe the bug

@dckc and I were examining a slogfile containing a single smart-wallet AMM trade. In the current tree (commit afabe7f) this needed 171 deliveries, consisting of 84 dispatch.delivers and 87 dispatch.notify (promise resolutions). Once we increased the per-block computron limit (by about 10x), this took a total of 1.575 seconds to complete.

Many of those deliveries are to update the chain storage data. The chain storage nodes are owned by v1-bootstrap, so we can grep the slogfile for toBridge to find where various vats are asking v1-bootstrap to perform a syscall to send a message through the bridge to the cosmos side. I counted one toBridge call to update storage:published.psm.IST.AUSD.metrics, three to bank (1: set ibc/usdc1234 = 4000440, 2: set ibc/usdc1234 = 0, 3: set uist = 4000039), and 17 to update storage:published.wallet.agoricNNN (the address performing the trade).

% grep toBridge block30.slog|grep '"type":"deliver"' | cut -c-220|grep published.wallet.agoric1hfcw2ryh8duca65
{"type":"deliver","crankNum":1433,"vatID":"v1","deliveryNum":153,"replay":false,"kd":["message","ko34",{"methargs":{"body":"[\"toBridge\",[\"storage\",{\"key\":\"published.wallet.agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96
{"type":"deliver","crankNum":1449,"vatID":"v1","deliveryNum":154,"replay":false,"kd":["message","ko34",{"methargs":{"body":"[\"toBridge\",[\"storage\",{\"key\":\"published.wallet.agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96
{"type":"deliver","crankNum":1481,"vatID":"v1","deliveryNum":155,"replay":false,"kd":["message","ko34",{"methargs":{"body":"[\"toBridge\",[\"storage\",{\"key\":\"published.wallet.agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96
...

The bodies of the toBridge calls (and the setValue calls which prompted them) grew somewhat over the course of those 17 (the 142/893/139/137 are the non-account ones described above, while the account ones grew from 8872 to 15655):

# [vatID, targetObjectID, methodName, methargs.body.length]
["v1","ko34","toBridge",142]
["v1","ko34","toBridge",8872]
["v1","ko34","toBridge",8852]
["v1","ko34","toBridge",8852]
["v1","ko34","toBridge",893]
["v1","ko34","toBridge",9833]
["v1","ko34","toBridge",10328]
["v1","ko34","toBridge",139]
["v1","ko34","toBridge",137]
["v1","ko34","toBridge",11310]
["v1","ko34","toBridge",11805]
["v1","ko34","toBridge",12787]
["v1","ko34","toBridge",13282]
["v1","ko34","toBridge",13283]
["v1","ko34","toBridge",13747]
["v1","ko34","toBridge",14444]
["v1","ko34","toBridge",15153]
["v1","ko34","toBridge",15151]
["v1","ko34","toBridge",15655]
["v1","ko34","toBridge",15655]
["v1","ko34","toBridge",15655]

The KernelDeliveryObject (as recorded in the slogfile) for the last value written into the account storage key was:

["message","ko34",{"methargs":{"body":"[\"toBridge\",[\"storage\",{\"key\":\"published.wallet.agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96n6d8\",\"method\":\"append\",\"value\":\"{\\\"body\\\":\\\"{\\\\\\\"contacts\\\\\\\":[[\\\\\\\"Self\\\\\\\",{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: contact\\\\\\\",\\\\\\\"index\\\\\\\":0},\\\\\\\"address\\\\\\\":\\\\\\\"agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96n6d8\\\\\\\",\\\\\\\"depositBoardId\\\\\\\":\\\\\\\"board04719\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":1}}]],\\\\\\\"dapps\\\\\\\":[],\\\\\\\"issuers\\\\\\\":[[\\\\\\\"AUSD\\\\\\\",{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: AUSD brand\\\\\\\",\\\\\\\"index\\\\\\\":1},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: AUSD issuer\\\\\\\",\\\\\\\"index\\\\\\\":2},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":4}}],[\\\\\\\"BLD\\\\\\\",{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: BLD brand\\\\\\\",\\\\\\\"index\\\\\\\":3},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: BLD issuer\\\\\\\",\\\\\\\"index\\\\\\\":4},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board00613\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":5}}],[\\\\\\\"IST\\\\\\\",{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: IST brand\\\\\\\",\\\\\\\"index\\\\\\\":5},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: IST issuer\\\\\\\",\\\\\\\"index\\\\\\\":6},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board05311\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":6}}],[\\\\\\\"zoe invite\\\\\\\",{\\\\\\\"assetKind\\\\\\\":\\\\\\\"set\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: Zoe Invitation brand\\\\\\\",\\\\\\\"index\\\\\\\":7},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"set\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: Zoe Invitation issuer\\\\\\\",\\\\\\\"index\\\\\\\":8},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board06120\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":2}}]],\\\\\\\"offers\\\\\\\":[{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"id\\\\\\\":\\\\\\\"unknown#1661288219007\\\\\\\",\\\\\\\"installation\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"installationPetname\\\\\\\":\\\\\\\"unnamed-2\\\\\\\",\\\\\\\"instance\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"instanceHandleBoardId\\\\\\\":\\\\\\\"board00917\\\\\\\",\\\\\\\"instancePetname\\\\\\\":\\\\\\\"unnamed-1\\\\\\\",\\\\\\\"invitationDetails\\\\\\\":{\\\\\\\"description\\\\\\\":\\\\\\\"swap\\\\\\\",\\\\\\\"handle\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-3\\\\\\\"},\\\\\\\"installation\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-2\\\\\\\"},\\\\\\\"instance\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-1\\\\\\\"}},\\\\\\\"invitationMaker\\\\\\\":{\\\\\\\"method\\\\\\\":\\\\\\\"makeSwapInvitation\\\\\\\"},\\\\\\\"meta\\\\\\\":{\\\\\\\"creationStamp\\\\\\\":1661288219007,\\\\\\\"id\\\\\\\":\\\\\\\"1661288219007\\\\\\\"},\\\\\\\"proposalForDisplay\\\\\\\":{\\\\\\\"exit\\\\\\\":{\\\\\\\"onDemand\\\\\\\":null},\\\\\\\"give\\\\\\\":{\\\\\\\"In\\\\\\\":{\\\\\\\"amount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"value\\\\\\\":4000440},\\\\\\\"purse\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: Virtual Purse\\\\\\\",\\\\\\\"index\\\\\\\":9},\\\\\\\"pursePetname\\\\\\\":\\\\\\\"AUSD\\\\\\\"}},\\\\\\\"want\\\\\\\":{\\\\\\\"Out\\\\\\\":{\\\\\\\"amount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"value\\\\\\\":4000000},\\\\\\\"purse\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: Virtual Purse\\\\\\\",\\\\\\\"index\\\\\\\":10},\\\\\\\"pursePetname\\\\\\\":\\\\\\\"Agoric stable local currency\\\\\\\"}}},\\\\\\\"proposalTemplate\\\\\\\":{\\\\\\\"give\\\\\\\":{\\\\\\\"In\\\\\\\":{\\\\\\\"pursePetname\\\\\\\":\\\\\\\"AUSD\\\\\\\",\\\\\\\"value\\\\\\\":4000440}},\\\\\\\"want\\\\\\\":{\\\\\\\"Out\\\\\\\":{\\\\\\\"pursePetname\\\\\\\":\\\\\\\"Agoric stable local currency\\\\\\\",\\\\\\\"value\\\\\\\":4000000}}},\\\\\\\"rawId\\\\\\\":\\\\\\\"1661288219007\\\\\\\",\\\\\\\"requestContext\\\\\\\":{\\\\\\\"dappOrigin\\\\\\\":\\\\\\\"unknown\\\\\\\",\\\\\\\"origin\\\\\\\":\\\\\\\"unknown\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"accept\\\\\\\"}],\\\\\\\"payments\\\\\\\":[{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: payment actions\\\\\\\",\\\\\\\"index\\\\\\\":11},\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":1},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":10},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-5\\\\\\\"}},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":10},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-5\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"pending\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":10},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-5\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"pending\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":10},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-5\\\\\\\"},\\\\\\\"status\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"}},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":2},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":10},\\\\\\\"payment\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: AUSD payment\\\\\\\",\\\\\\\"index\\\\\\\":12},\\\\\\\"status\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"}},{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: payment actions\\\\\\\",\\\\\\\"index\\\\\\\":13},\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":1},\\\\\\\"depositedAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":1},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"0\\\\\\\"}},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"depositedAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"0\\\\\\\"}},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":11},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-6\\\\\\\"}},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":11},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-6\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"pending\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-4\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":11},\\\\\\\"payment\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"deposited\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":2},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board0074\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":11},\\\\\\\"payment\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"deposited\\\\\\\"},{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: payment actions\\\\\\\",\\\\\\\"index\\\\\\\":14},\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":5},\\\\\\\"depositedAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":5},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"4000039\\\\\\\"}},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"},\\\\\\\"depositedAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"4000039\\\\\\\"}},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"displayPayment\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"},\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-7\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board05311\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":12},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-8\\\\\\\"}},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-7\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board05311\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":12},\\\\\\\"payment\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-8\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"pending\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"unnamed\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"unnamed-7\\\\\\\"},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board05311\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":12},\\\\\\\"payment\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"deposited\\\\\\\"},\\\\\\\"issuer\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":6},\\\\\\\"issuerBoardId\\\\\\\":\\\\\\\"board05311\\\\\\\",\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":12},\\\\\\\"payment\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"undefined\\\\\\\"},\\\\\\\"status\\\\\\\":\\\\\\\"deposited\\\\\\\"}],\\\\\\\"purses\\\\\\\":[{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: purse.actions\\\\\\\",\\\\\\\"index\\\\\\\":15},\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":7},\\\\\\\"brandBoardId\\\\\\\":\\\\\\\"board05815\\\\\\\",\\\\\\\"brandPetname\\\\\\\":\\\\\\\"zoe invite\\\\\\\",\\\\\\\"currentAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"zoe invite\\\\\\\"},\\\\\\\"value\\\\\\\":[]},\\\\\\\"currentAmountSlots\\\\\\\":{\\\\\\\"body\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"brand\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"slot\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"iface\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Alleged: Zoe Invitation brand\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"index\\\\\\\\\\\\\\\":0},\\\\\\\\\\\\\\\"value\\\\\\\\\\\\\\\":[]}\\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"zoe invite\\\\\\\"}]},\\\\\\\"depositBoardId\\\\\\\":\\\\\\\"board04719\\\\\\\",\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"set\\\\\\\"},\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":3},\\\\\\\"purse\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: Zoe Invitation Purse purse\\\\\\\",\\\\\\\"index\\\\\\\":16},\\\\\\\"pursePetname\\\\\\\":\\\\\\\"Default Zoe invite purse\\\\\\\",\\\\\\\"value\\\\\\\":[]},{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: purse.actions\\\\\\\",\\\\\\\"index\\\\\\\":17},\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":1},\\\\\\\"brandBoardId\\\\\\\":\\\\\\\"board0425\\\\\\\",\\\\\\\"brandPetname\\\\\\\":\\\\\\\"AUSD\\\\\\\",\\\\\\\"currentAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"1117999560\\\\\\\"}},\\\\\\\"currentAmountSlots\\\\\\\":{\\\\\\\"body\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"brand\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"slot\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"iface\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Alleged: AUSD brand\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"index\\\\\\\\\\\\\\\":0},\\\\\\\\\\\\\\\"value\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"bigint\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"digits\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"1117999560\\\\\\\\\\\\\\\"}}\\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"AUSD\\\\\\\"}]},\\\\\\\"depositBoardId\\\\\\\":\\\\\\\"board04719\\\\\\\",\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":7},\\\\\\\"purse\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":9},\\\\\\\"pursePetname\\\\\\\":\\\\\\\"AUSD\\\\\\\",\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"1117999560\\\\\\\"}},{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: purse.actions\\\\\\\",\\\\\\\"index\\\\\\\":18},\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":3},\\\\\\\"brandBoardId\\\\\\\":\\\\\\\"board04312\\\\\\\",\\\\\\\"brandPetname\\\\\\\":\\\\\\\"BLD\\\\\\\",\\\\\\\"currentAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"BLD\\\\\\\"},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"13000000\\\\\\\"}},\\\\\\\"currentAmountSlots\\\\\\\":{\\\\\\\"body\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"brand\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"slot\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"iface\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Alleged: BLD brand\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"index\\\\\\\\\\\\\\\":0},\\\\\\\\\\\\\\\"value\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"bigint\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"digits\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"13000000\\\\\\\\\\\\\\\"}}\\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"BLD\\\\\\\"}]},\\\\\\\"depositBoardId\\\\\\\":\\\\\\\"board04719\\\\\\\",\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":8},\\\\\\\"purse\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: Virtual Purse\\\\\\\",\\\\\\\"index\\\\\\\":19},\\\\\\\"pursePetname\\\\\\\":\\\\\\\"Agoric staking token\\\\\\\",\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"13000000\\\\\\\"}},{\\\\\\\"actions\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"iface\\\\\\\":\\\\\\\"Alleged: purse.actions\\\\\\\",\\\\\\\"index\\\\\\\":20},\\\\\\\"brand\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":5},\\\\\\\"brandBoardId\\\\\\\":\\\\\\\"board02314\\\\\\\",\\\\\\\"brandPetname\\\\\\\":\\\\\\\"IST\\\\\\\",\\\\\\\"currentAmount\\\\\\\":{\\\\\\\"brand\\\\\\\":{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"},\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"12349000039\\\\\\\"}},\\\\\\\"currentAmountSlots\\\\\\\":{\\\\\\\"body\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"brand\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"slot\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"iface\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Alleged: IST brand\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"index\\\\\\\\\\\\\\\":0},\\\\\\\\\\\\\\\"value\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"@qclass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"bigint\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"digits\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"12349000039\\\\\\\\\\\\\\\"}}\\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"kind\\\\\\\":\\\\\\\"brand\\\\\\\",\\\\\\\"petname\\\\\\\":\\\\\\\"IST\\\\\\\"}]},\\\\\\\"depositBoardId\\\\\\\":\\\\\\\"board04719\\\\\\\",\\\\\\\"displayInfo\\\\\\\":{\\\\\\\"assetKind\\\\\\\":\\\\\\\"nat\\\\\\\",\\\\\\\"decimalPlaces\\\\\\\":6},\\\\\\\"meta\\\\\\\":{\\\\\\\"id\\\\\\\":9},\\\\\\\"purse\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"slot\\\\\\\",\\\\\\\"index\\\\\\\":10},\\\\\\\"pursePetname\\\\\\\":\\\\\\\"Agoric stable local currency\\\\\\\",\\\\\\\"value\\\\\\\":{\\\\\\\"@qclass\\\\\\\":\\\\\\\"bigint\\\\\\\",\\\\\\\"digits\\\\\\\":\\\\\\\"12349000039\\\\\\\"}}]}\\\",\\\"slots\\\":[\\\"unknown:1\\\",\\\"board0425\\\",\\\"board0074\\\",\\\"board04312\\\",\\\"board00613\\\",\\\"board02314\\\",\\\"board05311\\\",\\\"board05815\\\",\\\"board06120\\\",\\\"unknown:6\\\",\\\"unknown:10\\\",\\\"unknown:18\\\",\\\"unknown:19\\\",\\\"unknown:20\\\",\\\"unknown:22\\\",\\\"unknown:4\\\",\\\"unknown:3\\\",\\\"unknown:24\\\",\\\"unknown:15\\\",\\\"unknown:8\\\",\\\"unknown:25\\\"]}\"}]]","slots":[]},"result":"kp475"}]

Which turns into a bridge-device invocation of:

  • target: storage
  • method: append
  • key: published.wallet.agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96n6d8
  • value: a 15532-byte JSON-encoded string

The value, once decoded, yields:

  • body: a 11581-byte JSON-encoded string
  • slots: ["unknown:1","board0425","board0074","board04312","board00613","board02314","board05311","board05815","board06120","unknown:6","unknown:10","unknown:18","unknown:19","unknown:20","unknown:22","unknown:4","unknown:3","unknown:24","unknown:15","unknown:8","unknown:25"]

The body, once decoded, yields:

wallet state body ```json { "contacts": [ [ "Self", { "actions": { "@qclass": "slot", "iface": "Alleged: contact", "index": 0 }, "address": "agoric1hfcw2ryh8duca65gadgttvn4sdgxvafs96n6d8", "depositBoardId": "board04719", "meta": { "id": 1 } } ] ], "dapps": [], "issuers": [ [ "AUSD", { "assetKind": "nat", "brand": { "@qclass": "slot", "iface": "Alleged: AUSD brand", "index": 1 }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "issuer": { "@qclass": "slot", "iface": "Alleged: AUSD issuer", "index": 2 }, "issuerBoardId": "board0074", "meta": { "id": 4 } } ], [ "BLD", { "assetKind": "nat", "brand": { "@qclass": "slot", "iface": "Alleged: BLD brand", "index": 3 }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "issuer": { "@qclass": "slot", "iface": "Alleged: BLD issuer", "index": 4 }, "issuerBoardId": "board00613", "meta": { "id": 5 } } ], [ "IST", { "assetKind": "nat", "brand": { "@qclass": "slot", "iface": "Alleged: IST brand", "index": 5 }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "issuer": { "@qclass": "slot", "iface": "Alleged: IST issuer", "index": 6 }, "issuerBoardId": "board05311", "meta": { "id": 6 } } ], [ "zoe invite", { "assetKind": "set", "brand": { "@qclass": "slot", "iface": "Alleged: Zoe Invitation brand", "index": 7 }, "displayInfo": { "assetKind": "set" }, "issuer": { "@qclass": "slot", "iface": "Alleged: Zoe Invitation issuer", "index": 8 }, "issuerBoardId": "board06120", "meta": { "id": 2 } } ] ], "offers": [ { "actions": { "@qclass": "undefined" }, "id": "unknown#1661288219007", "installation": { "@qclass": "undefined" }, "installationPetname": "unnamed-2", "instance": { "@qclass": "undefined" }, "instanceHandleBoardId": "board00917", "instancePetname": "unnamed-1", "invitationDetails": { "description": "swap", "handle": { "kind": "unnamed", "petname": "unnamed-3" }, "installation": { "kind": "unnamed", "petname": "unnamed-2" }, "instance": { "kind": "unnamed", "petname": "unnamed-1" } }, "invitationMaker": { "method": "makeSwapInvitation" }, "meta": { "creationStamp": 1661288219007, "id": "1661288219007" }, "proposalForDisplay": { "exit": { "onDemand": null }, "give": { "In": { "amount": { "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "value": 4000440 }, "purse": { "@qclass": "slot", "iface": "Alleged: Virtual Purse", "index": 9 }, "pursePetname": "AUSD" } }, "want": { "Out": { "amount": { "brand": { "kind": "brand", "petname": "IST" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "value": 4000000 }, "purse": { "@qclass": "slot", "iface": "Alleged: Virtual Purse", "index": 10 }, "pursePetname": "Agoric stable local currency" } } }, "proposalTemplate": { "give": { "In": { "pursePetname": "AUSD", "value": 4000440 } }, "want": { "Out": { "pursePetname": "Agoric stable local currency", "value": 4000000 } } }, "rawId": "1661288219007", "requestContext": { "dappOrigin": "unknown", "origin": "unknown" }, "status": "accept" } ], "payments": [ { "actions": { "@qclass": "slot", "iface": "Alleged: payment actions", "index": 11 }, "assetKind": "nat", "brand": { "@qclass": "slot", "index": 1 }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 10 }, "payment": { "kind": "unnamed", "petname": "unnamed-5" } }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 10 }, "payment": { "kind": "unnamed", "petname": "unnamed-5" }, "status": "pending" }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 10 }, "payment": { "kind": "unnamed", "petname": "unnamed-5" }, "status": "pending" }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 10 }, "payment": { "kind": "unnamed", "petname": "unnamed-5" }, "status": { "@qclass": "undefined" } }, "issuer": { "@qclass": "slot", "index": 2 }, "issuerBoardId": "board0074", "meta": { "id": 10 }, "payment": { "@qclass": "slot", "iface": "Alleged: AUSD payment", "index": 12 }, "status": { "@qclass": "undefined" } }, { "actions": { "@qclass": "slot", "iface": "Alleged: payment actions", "index": 13 }, "assetKind": "nat", "brand": { "@qclass": "slot", "index": 1 }, "depositedAmount": { "brand": { "@qclass": "slot", "index": 1 }, "value": { "@qclass": "bigint", "digits": "0" } }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "depositedAmount": { "brand": { "kind": "brand", "petname": "AUSD" }, "value": { "@qclass": "bigint", "digits": "0" } }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "AUSD" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 11 }, "payment": { "kind": "unnamed", "petname": "unnamed-6" } }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 11 }, "payment": { "kind": "unnamed", "petname": "unnamed-6" }, "status": "pending" }, "issuer": { "kind": "unnamed", "petname": "unnamed-4" }, "issuerBoardId": "board0074", "meta": { "id": 11 }, "payment": { "@qclass": "undefined" }, "status": "deposited" }, "issuer": { "@qclass": "slot", "index": 2 }, "issuerBoardId": "board0074", "meta": { "id": 11 }, "payment": { "@qclass": "undefined" }, "status": "deposited" }, { "actions": { "@qclass": "slot", "iface": "Alleged: payment actions", "index": 14 }, "assetKind": "nat", "brand": { "@qclass": "slot", "index": 5 }, "depositedAmount": { "brand": { "@qclass": "slot", "index": 5 }, "value": { "@qclass": "bigint", "digits": "4000039" } }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "IST" }, "depositedAmount": { "brand": { "kind": "brand", "petname": "IST" }, "value": { "@qclass": "bigint", "digits": "4000039" } }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "IST" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "displayPayment": { "assetKind": "nat", "brand": { "kind": "brand", "petname": "IST" }, "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "issuer": { "kind": "unnamed", "petname": "unnamed-7" }, "issuerBoardId": "board05311", "meta": { "id": 12 }, "payment": { "kind": "unnamed", "petname": "unnamed-8" } }, "issuer": { "kind": "unnamed", "petname": "unnamed-7" }, "issuerBoardId": "board05311", "meta": { "id": 12 }, "payment": { "kind": "unnamed", "petname": "unnamed-8" }, "status": "pending" }, "issuer": { "kind": "unnamed", "petname": "unnamed-7" }, "issuerBoardId": "board05311", "meta": { "id": 12 }, "payment": { "@qclass": "undefined" }, "status": "deposited" }, "issuer": { "@qclass": "slot", "index": 6 }, "issuerBoardId": "board05311", "meta": { "id": 12 }, "payment": { "@qclass": "undefined" }, "status": "deposited" } ], "purses": [ { "actions": { "@qclass": "slot", "iface": "Alleged: purse.actions", "index": 15 }, "brand": { "@qclass": "slot", "index": 7 }, "brandBoardId": "board05815", "brandPetname": "zoe invite", "currentAmount": { "brand": { "kind": "brand", "petname": "zoe invite" }, "value": [] }, "currentAmountSlots": { "body": "{\"brand\":{\"@qclass\":\"slot\",\"iface\":\"Alleged: Zoe Invitation brand\",\"index\":0},\"value\":[]}", "slots": [ { "kind": "brand", "petname": "zoe invite" } ] }, "depositBoardId": "board04719", "displayInfo": { "assetKind": "set" }, "meta": { "id": 3 }, "purse": { "@qclass": "slot", "iface": "Alleged: Zoe Invitation Purse purse", "index": 16 }, "pursePetname": "Default Zoe invite purse", "value": [] }, { "actions": { "@qclass": "slot", "iface": "Alleged: purse.actions", "index": 17 }, "brand": { "@qclass": "slot", "index": 1 }, "brandBoardId": "board0425", "brandPetname": "AUSD", "currentAmount": { "brand": { "kind": "brand", "petname": "AUSD" }, "value": { "@qclass": "bigint", "digits": "1117999560" } }, "currentAmountSlots": { "body": "{\"brand\":{\"@qclass\":\"slot\",\"iface\":\"Alleged: AUSD brand\",\"index\":0},\"value\":{\"@qclass\":\"bigint\",\"digits\":\"1117999560\"}}", "slots": [ { "kind": "brand", "petname": "AUSD" } ] }, "depositBoardId": "board04719", "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "meta": { "id": 7 }, "purse": { "@qclass": "slot", "index": 9 }, "pursePetname": "AUSD", "value": { "@qclass": "bigint", "digits": "1117999560" } }, { "actions": { "@qclass": "slot", "iface": "Alleged: purse.actions", "index": 18 }, "brand": { "@qclass": "slot", "index": 3 }, "brandBoardId": "board04312", "brandPetname": "BLD", "currentAmount": { "brand": { "kind": "brand", "petname": "BLD" }, "value": { "@qclass": "bigint", "digits": "13000000" } }, "currentAmountSlots": { "body": "{\"brand\":{\"@qclass\":\"slot\",\"iface\":\"Alleged: BLD brand\",\"index\":0},\"value\":{\"@qclass\":\"bigint\",\"digits\":\"13000000\"}}", "slots": [ { "kind": "brand", "petname": "BLD" } ] }, "depositBoardId": "board04719", "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "meta": { "id": 8 }, "purse": { "@qclass": "slot", "iface": "Alleged: Virtual Purse", "index": 19 }, "pursePetname": "Agoric staking token", "value": { "@qclass": "bigint", "digits": "13000000" } }, { "actions": { "@qclass": "slot", "iface": "Alleged: purse.actions", "index": 20 }, "brand": { "@qclass": "slot", "index": 5 }, "brandBoardId": "board02314", "brandPetname": "IST", "currentAmount": { "brand": { "kind": "brand", "petname": "IST" }, "value": { "@qclass": "bigint", "digits": "12349000039" } }, "currentAmountSlots": { "body": "{\"brand\":{\"@qclass\":\"slot\",\"iface\":\"Alleged: IST brand\",\"index\":0},\"value\":{\"@qclass\":\"bigint\",\"digits\":\"12349000039\"}}", "slots": [ { "kind": "brand", "petname": "IST" } ] }, "depositBoardId": "board04719", "displayInfo": { "assetKind": "nat", "decimalPlaces": 6 }, "meta": { "id": 9 }, "purse": { "@qclass": "slot", "index": 10 }, "pursePetname": "Agoric stable local currency", "value": { "@qclass": "bigint", "digits": "12349000039" } } ] } ```

(incidentally, cat block30.slog |jq -c 'select(.type=="deliver" and .kd[0]=="message")' |grep toBridge |jq -c '.kd'|tail -1 |jq '.[2].methargs.body | fromjson | .[1][1].value|fromjson|.body |fromjson' is the command to get that last bit)

I'm still doing the calculation to see just how much time it took to perform those updates.

We're thinking that:

  • we shouldn't update this same key 17 times
    • I don't know how to implement it, but we might want some sort of Nagle-ing, to coalesce all those changes into a single write
  • I'm suspicious of the value growing over time. Is this recording history? Deliberately? If it's growing by accident then we should fix it. If it's deliberately growing without bound, we need to consider the long-term sustainability of that.
  • I'm suspicious of all the unknown:NN values in the update, it makes me think that some valToSlot table isn't surviving properly, so brands or purses or something are not being recognized the second time around, so something new is being allocated for it, and that's effectively leaking something
  • the size is unfortunately multiplied by multiple layers of JSON encoding. Since JSON is an escape-based language (rather than length-prefixed), the escape character must itself be escaped on each layer of encoding, leading rapidly to a world where most of the body is backslashes and the message size doubles on each re-encoding.
    • @dtribble has a new encoding scheme for marshal which would remove one later of JSONing, and would remove some of the double-quotes (by expressing compound objects with specially-prefixed strings rather than @qclass-bearing objects). That would help, although I don't know by how much.
@warner warner added the bug Something isn't working label Aug 23, 2022
@dckc dckc changed the title smart-wallet AMM trade performs 17 account-state storage updates smart-wallet PSM trade performs 17 account-state storage updates Aug 23, 2022
@dckc dckc added performance Performance related issues wallet labels Aug 23, 2022
@warner
Copy link
Member Author

warner commented Aug 23, 2022

Oh, the .payments[0].displayPayment.displayPayment.displayPayment part doesn't look right.

@warner
Copy link
Member Author

warner commented Aug 23, 2022

@dckc mentioned that there's half a dozen Notifiers for various parts of the account, and then one sort of meta-Notifier that follows all of them, and it's the meta-Notifier that writes out state updates to chainStorage. If it turns out that the time we're spending doing these updates is significant, we might want to consider a scheme where there are zero smaller notifiers, and the smart wallet is responsible for knowing when its operation is complete, and then prodding the one meta-Notifier to write out a single update with all the changes in it.

@warner
Copy link
Member Author

warner commented Aug 23, 2022

Of the 84 cranks that were dispatch.deliver(methodname), plus the 87 that were dispatch.notify, the count and total time spent on each was:

count method total time avg each
87x (notify) 0.574 s 0.007 s
21x toBridge 0.165 s 0.008 s
18x setValue 0.134 s 0.007 s
1x handleOffer 0.130 s 0.130 s
7x deposit 0.057 s 0.008 s
3x withdraw 0.042 s 0.014 s
3x burn 0.021 s 0.007 s
1x exitSeat 0.018 s 0.018 s
3x getId 0.017 s 0.006 s
2x replaceAllocations 0.017 s 0.008 s
1x makeInvitation 0.014 s 0.014 s
3x getAllegedBrand 0.013 s 0.004 s
1x mintAndEscrow 0.013 s 0.013 s
1x fromBridge 0.012 s 0.012 s
3x getCurrentAmount 0.012 s 0.004 s
4x getUpdateSince 0.012 s 0.003 s
1x makeSwapInvitation 0.008 s 0.008 s
1x mintPayment 0.007 s 0.007 s
1x inbound 0.006 s 0.006 s
1x getAllocationNotifierJig 0.005 s 0.005 s
1x serialize 0.005 s 0.005 s
1x offer 0.004 s 0.004 s
1x getValue 0.004 s 0.004 s
1x getInvitationDetails 0.003 s 0.003 s
1x hasExited 0.003 s 0.003 s
1x getPublicFacet 0.003 s 0.003 s
1x getOfferResult 0.003 s 0.003 s
1x getPayouts 0.003 s 0.003 s

We spent a total of 730ms doing dispatch.deliver deliveries, plus the 574ms doing notifies, for a total of 1.304 s doing cranks. So we spent 271ms doing kernel-side work (run-queue processing, routing: things outside of a delivery).

thing time percentage
non-crank 271 ms 17 %
notifies 574 ms 36 %
toBridge 165 ms 10 %
setValue 134 ms 8.5 %
handleOffer 130 ms 8.3 %

@dckc
Copy link
Member

dckc commented Sep 10, 2022

The new smart wallet does more like 6 per trade, and they're moderate in size.

psm-trade-viz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance Performance related issues wallet
Projects
None yet
Development

No branches or pull requests

3 participants