From 97f888e50781af605b7ba6bdcc39206ffcfe9a01 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Tue, 23 Jul 2024 08:25:52 +0000 Subject: [PATCH] fix(orchestration): chainHub accepts zone --- .../src/examples/stake-bld.contract.js | 6 +- .../src/examples/stake-ica.contract.js | 6 +- packages/orchestration/src/exos/chain-hub.js | 8 +- .../src/proposals/start-stakeAtom.js | 9 +- .../src/proposals/start-stakeOsmo.js | 9 +- .../orchestration/src/utils/start-helper.js | 4 +- .../snapshots/send-anywhere.test.ts.md | 8 ++ .../snapshots/send-anywhere.test.ts.snap | Bin 1102 -> 1215 bytes .../snapshots/staking-combinations.test.ts.md | 73 ++++++++++++++ .../staking-combinations.test.ts.snap | Bin 1664 -> 2471 bytes .../snapshots/unbond.contract.test.ts.md | 91 ++++++++++++++++++ .../snapshots/unbond.contract.test.ts.snap | Bin 981 -> 1887 bytes .../orchestration/test/exos/chain-hub.test.ts | 4 +- .../orchestration/test/staking-ops.test.ts | 28 ++++-- packages/orchestration/test/supports.ts | 6 +- 15 files changed, 228 insertions(+), 24 deletions(-) diff --git a/packages/orchestration/src/examples/stake-bld.contract.js b/packages/orchestration/src/examples/stake-bld.contract.js index 82454422525..f51136e2629 100644 --- a/packages/orchestration/src/examples/stake-bld.contract.js +++ b/packages/orchestration/src/examples/stake-bld.contract.js @@ -43,7 +43,11 @@ export const start = async (zcf, privateArgs, baggage) => { ); const vowTools = prepareVowTools(zone.subZone('vows')); - const chainHub = makeChainHub(privateArgs.agoricNames, vowTools); + const chainHub = makeChainHub( + zone.subZone('chainHub'), + privateArgs.agoricNames, + vowTools, + ); const zoeTools = makeZoeTools(zcf, vowTools); const { localchain, timerService } = privateArgs; diff --git a/packages/orchestration/src/examples/stake-ica.contract.js b/packages/orchestration/src/examples/stake-ica.contract.js index d6b89145368..11dde1662b2 100644 --- a/packages/orchestration/src/examples/stake-ica.contract.js +++ b/packages/orchestration/src/examples/stake-ica.contract.js @@ -84,7 +84,11 @@ export const start = async (zcf, privateArgs, baggage) => { const vowTools = prepareVowTools(zone.subZone('vows')); - const chainHub = makeChainHub(agoricNames, vowTools); + const chainHub = makeChainHub( + zone.subZone('chainHub'), + agoricNames, + vowTools, + ); const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount( zone, diff --git a/packages/orchestration/src/exos/chain-hub.js b/packages/orchestration/src/exos/chain-hub.js index 903fb370c48..e9f52972e4b 100644 --- a/packages/orchestration/src/exos/chain-hub.js +++ b/packages/orchestration/src/exos/chain-hub.js @@ -4,12 +4,12 @@ import { M } from '@endo/patterns'; import { BrandShape } from '@agoric/ertp/src/typeGuards.js'; import { VowShape } from '@agoric/vow'; -import { makeHeapZone } from '@agoric/zone'; import { CosmosChainInfoShape, IBCConnectionInfoShape } from '../typeGuards.js'; /** * @import {NameHub} from '@agoric/vats'; * @import {Vow, VowTools} from '@agoric/vow'; + * @import {Zone} from '@agoric/zone'; * @import {CosmosAssetInfo, CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api.js'; * @import {ChainInfo, KnownChains} from '../chain-info.js'; * @import {Denom} from '../orchestration-api.js'; @@ -171,18 +171,18 @@ const ChainHubI = M.interface('ChainHub', { }); /** - * Make a new ChainHub in the zone (or in the heap if no zone is provided). + * Make a new ChainHub in the zone. * * The resulting object is an Exo singleton. It has no precious state. It's only * state is a cache of queries to agoricNames and whatever info was provided in * registration calls. When you need a newer version you can simply make a hub * hub and repeat the registrations. * + * @param {Zone} zone * @param {Remote} agoricNames * @param {VowTools} vowTools */ -export const makeChainHub = (agoricNames, vowTools) => { - const zone = makeHeapZone(); +export const makeChainHub = (zone, agoricNames, vowTools) => { /** @type {MapStore} */ const chainInfos = zone.mapStore('chainInfos', { keyShape: M.string(), diff --git a/packages/orchestration/src/proposals/start-stakeAtom.js b/packages/orchestration/src/proposals/start-stakeAtom.js index c759790a8d4..f6a245bfc08 100644 --- a/packages/orchestration/src/proposals/start-stakeAtom.js +++ b/packages/orchestration/src/proposals/start-stakeAtom.js @@ -46,8 +46,13 @@ export const startStakeAtom = async ({ const storageNode = await makeStorageNodeChild(chainStorage, VSTORAGE_PATH); const marshaller = await E(board).getPublishingMarshaller(); - const vt = prepareVowTools(makeHeapZone()); - const chainHub = makeChainHub(await agoricNames, vt); + const zone = makeHeapZone(); + const vt = prepareVowTools(zone.subZone('vows')); + const chainHub = makeChainHub( + zone.subZone('chainHub'), + await agoricNames, + vt, + ); const [_, cosmoshub, connectionInfo] = await vt.when( chainHub.getChainsAndConnection('agoric', 'cosmoshub'), diff --git a/packages/orchestration/src/proposals/start-stakeOsmo.js b/packages/orchestration/src/proposals/start-stakeOsmo.js index 0f020a62a89..77bd2d562c8 100644 --- a/packages/orchestration/src/proposals/start-stakeOsmo.js +++ b/packages/orchestration/src/proposals/start-stakeOsmo.js @@ -51,8 +51,13 @@ export const startStakeOsmo = async ({ const storageNode = await makeStorageNodeChild(chainStorage, VSTORAGE_PATH); const marshaller = await E(board).getPublishingMarshaller(); - const vt = prepareVowTools(makeHeapZone()); - const chainHub = makeChainHub(await agoricNames, vt); + const zone = makeHeapZone(); + const vt = prepareVowTools(zone.subZone('vows')); + const chainHub = makeChainHub( + zone.subZone('chainHub'), + await agoricNames, + vt, + ); const [_, osmosis, connectionInfo] = await vt.when( chainHub.getChainsAndConnection('agoric', 'osmosis'), diff --git a/packages/orchestration/src/utils/start-helper.js b/packages/orchestration/src/utils/start-helper.js index e3b2cd7aa9d..7c37457ffa7 100644 --- a/packages/orchestration/src/utils/start-helper.js +++ b/packages/orchestration/src/utils/start-helper.js @@ -61,6 +61,8 @@ export const provideOrchestration = ( asyncFlow: zone.subZone('asyncFlow'), /** system names for orchestration implementation */ orchestration: zone.subZone('orchestration'), + /** system names for chainHub */ + chainHub: zone.subZone('chainHub'), /** system names for vows */ vows: zone.subZone('vows'), /** contract-provided names, and subzones */ @@ -72,7 +74,7 @@ export const provideOrchestration = ( const vowTools = prepareVowTools(zones.vows); - const chainHub = makeChainHub(agoricNames, vowTools); + const chainHub = makeChainHub(zones.chainHub, agoricNames, vowTools); const zoeTools = makeZoeTools(zcf, vowTools); diff --git a/packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.md b/packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.md index 11710ddf60d..5f4dbdca9a3 100644 --- a/packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.md +++ b/packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.md @@ -24,6 +24,14 @@ Generated by [AVA](https://avajs.dev). flowForOutcomeVow: {}, unwrapMap: 'Alleged: weakMapStore', }, + chainHub: { + ChainHub_kindHandle: 'Alleged: kind', + ChainHub_singleton: 'Alleged: ChainHub', + brandDenom: {}, + chainInfos: {}, + connectionInfos: {}, + denom: {}, + }, contract: { 'ChainHub Admin_kindHandle': 'Alleged: kind', 'ChainHub Admin_singleton': 'Alleged: ChainHub Admin', diff --git a/packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.snap b/packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.snap index bbf9e53542d64bc4c6152de2241123e5fe71373e..bab47226e8b51cb8fa66f49fa275be951a16c45b 100644 GIT binary patch literal 1215 zcmV;w1VH;iRzVSIci3MI8Rd_O92D^`l8>(gv{L1cwSvNQg_C;wEa+gghGc zgvPrQdzH&!hLU16We*ogpL&Xs!!~t~THK4j97E^D`FyG`57@j31J9U=YOhqg^6y05e3d6Mds~gISW0@z+|d24aHbL8_P`nOTwr(dy)x zOMQ>FT-Mm^w_L~XG_E-E%>#$qE0o(V3u)$(>#{bpUu_IA#baiRS;DiKcLHIBkaYrt zaDnuOK!(+!4qxfF0_0%~5nOuIk^xf5Ob}CeR)_i0qtX#PfZvF~xwpi? zA7-(9D+9cn0lvxrW)`@d1@2^lhgqPO12%F%KL>o610Lj*tY+d_HAwz(4){9e${~Ibl`>#9O}T2x*{v7vceM`!(w7L58TTGzvY4F4S*TI zEd%(-P%P@IMee=oE*^h|n;?c_e_>hpUEw!2qRhsUWr;qQjTPaZ z>@JFVzPK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EMw@zqd9XVWv&*1my5vZRoQbt82T83jctq z$(d&ABB#acINQu0aeYx=Bm@#y&+?3KV#BNrqnPp!d%pyHQ38H8t86E#oH3_6 zP4Rs(N5~(M{*;(-<#@n^4nEv6wKA|+HnvbarO_{zPlU+zz*qZa;Qcc2bs6~G)F~x& zOiL_b%7 diff --git a/packages/orchestration/test/examples/snapshots/staking-combinations.test.ts.md b/packages/orchestration/test/examples/snapshots/staking-combinations.test.ts.md index 926a50924a3..afcd6ed2fd1 100644 --- a/packages/orchestration/test/examples/snapshots/staking-combinations.test.ts.md +++ b/packages/orchestration/test/examples/snapshots/staking-combinations.test.ts.md @@ -24,6 +24,79 @@ Generated by [AVA](https://avajs.dev). flowForOutcomeVow: {}, unwrapMap: 'Alleged: weakMapStore', }, + chainHub: { + ChainHub_kindHandle: 'Alleged: kind', + ChainHub_singleton: 'Alleged: ChainHub', + brandDenom: { + 'Alleged: BLD brand': 'ubld', + }, + chainInfos: { + agoric: { + chainId: 'agoric-3', + icqEnabled: false, + stakingTokens: [ + { + denom: 'ubld', + }, + ], + }, + cosmoshub: { + chainId: 'cosmoshub-4', + icqEnabled: false, + stakingTokens: [ + { + denom: 'uatom', + }, + ], + }, + }, + connectionInfos: { + 'agoric-3_cosmoshub-4': { + client_id: '07-tendermint-6', + counterparty: { + client_id: '07-tendermint-927', + connection_id: 'connection-649', + }, + id: 'connection-8', + state: 3, + transferChannel: { + channelId: 'channel-5', + counterPartyChannelId: 'channel-405', + counterPartyPortId: 'transfer', + ordering: 0, + portId: 'transfer', + state: 3, + version: 'ics20-1', + }, + }, + 'cosmoshub-4_osmosis-1': { + client_id: '07-tendermint-259', + counterparty: { + client_id: '07-tendermint-1', + connection_id: 'connection-1', + }, + id: 'connection-257', + state: 3, + transferChannel: { + channelId: 'channel-141', + counterPartyChannelId: 'channel-0', + counterPartyPortId: 'transfer', + ordering: 0, + portId: 'transfer', + state: 3, + version: 'ics20-1', + }, + }, + }, + denom: { + ubld: { + baseDenom: 'ubld', + baseName: 'agoric', + brand: Object @Alleged: BLD brand {}, + chainName: 'agoric', + }, + }, + }, contract: { 'ChainHub Admin_kindHandle': 'Alleged: kind', 'ChainHub Admin_singleton': 'Alleged: ChainHub Admin', diff --git a/packages/orchestration/test/examples/snapshots/staking-combinations.test.ts.snap b/packages/orchestration/test/examples/snapshots/staking-combinations.test.ts.snap index 7a30cfbebf4804c81abe39ccf4371186c0a8e28e..406237967cd19ffb5aa5ec256a4d339d32f20cb7 100644 GIT binary patch literal 2471 zcmV;Y30U?)RzVIp@F4KYDR7FRS9R{`5=KkPMkp-5{DF=?YoV zmsCT4`lUjF804|ZAGqN|I47&Crs$hCkzZUQl5(h=Hzju*5>+uY zA{wS7>1s$qswOT`-Oz|3sfsCn%qI4nS6B7QE(X8s0>0t`e&GVT+`w@+aMca`#to!B zz*!IQMGx?85AcSE*;SWwSN($TA07Z+V80hAdx5K7;D#6YrI%4{V^#fky}En99wmsG^4IdN>QeUs?-4~OWTQLcsdVA6)PoGY1M+> zxw2v^o>o>hva+%vKXx$m@C@8zbXx=*m<^{RYH{9BHQK5fnR$a4w3Vj_3&MDNBR)E- z(O6c*gQQ5cvt*fSx`~>#p<)(lj!1G@qg6=W4q24d)j3r=UN%IvM9*-i6)2ll9wjUF zJ6)D(tCTDsB`f9@m>$>0ZqQ6EGqk!vaZ8aqo|vUKV^2Fz*&eDruMwp%OBJ>%5miO0x@H6LPaD8nsB$(*&zZV4Rp)OxxES?yg3F0yc!p-wQeIMM z;jnUEGR)+9)O3zk4cazukY!0JR{2aKeG{BvK^X2>JMBA`Os-Tan>a^A+Hz&l2 z*J-KRVCFIU*~gwy^^&URj@#|bO^c#hR*c*sRo+AAL72C>LBI^cW28h)(U)u@zmykGsj6HJz8f}4#|jab zsZkS#P`T|4!4sNVl5~2O7~)dv$JBjBT|KNAR8xqoZ{k?G%ymy2lDv_?@K>w1cUsfP zMZsPF6^TSFS-rA*m`1=U^|Eb(>+KHUR~<}y;A3I#KoE!ofw3S1^>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?QFqACa-E1 zJ4%H*>%B|^M|gdoA(&}U-C9Fg`t0XU3r$~5V<-z-T5!}f=}F>meo7<~En9QD3rM@8 z(;9T`oj*i?pCdpf3Oo>%_Rg>j_dgQ_UWfwk%FwKf`F0feE(&bz0*o#Ro|ECe54wOW zGHk%LdHd~B|K8Oub#Ix?b4wGWMtL{WS%r!Pp^S8Q$e~K-*kTvi#_0}YU(F~lI*uCU zDU%x3Ok+=rf%v4dg=mGFn%exg*s7Dz-ZWHuV9eG^&2Kie7+jswqF6$`!~1rP zH3OYwMwyvw84X%VJdJQ8u5LvN@xR;+oaqLxbW7?{ zT=M<08@SyK6k-xI=7R2w0guIi6Ed{drAb*OY3kuD87Jh;SX+!yW|Voo$_!!sE!-de zgWR{5<5q|-5(g4-DRmK7*Kdpi_sX!i3-(AH7?oiuS0RWU)>OP57TM8ZIJcbPmSj*! zWH142N&qwgTucC;B!FlSp!Wcmdw^t8iYDs1+1!@|?oR?d30zJB*ONfD7dX`mT6New^!57e+Jv#y4_qlV`)OR7O3;ny?3 zxeRbC1B~gr{@BvpL|M9B?NG zj0^z!0B~tQa_wuI?HFkApi1>jNvxKjXj3ham@YayzlKIou$%F1Iiszg35)>{8bXo=$$f>_gihqThSxQ`uHkhJuWR_<)iBd(iRmW_&Es;hL@O0qVMRJ4m|3)c6#oMZ K9V8hm9{>P+O%Bum diff --git a/packages/orchestration/test/examples/snapshots/unbond.contract.test.ts.md b/packages/orchestration/test/examples/snapshots/unbond.contract.test.ts.md index 1a7163c5994..2a64227520d 100644 --- a/packages/orchestration/test/examples/snapshots/unbond.contract.test.ts.md +++ b/packages/orchestration/test/examples/snapshots/unbond.contract.test.ts.md @@ -24,6 +24,97 @@ Generated by [AVA](https://avajs.dev). flowForOutcomeVow: {}, unwrapMap: 'Alleged: weakMapStore', }, + chainHub: { + ChainHub_kindHandle: 'Alleged: kind', + ChainHub_singleton: 'Alleged: ChainHub', + brandDenom: {}, + chainInfos: { + agoric: { + chainId: 'agoric-3', + icqEnabled: false, + stakingTokens: [ + { + denom: 'ubld', + }, + ], + }, + osmosis: { + chainId: 'osmosis-1', + icqEnabled: true, + stakingTokens: [ + { + denom: 'uosmo', + }, + ], + }, + stride: { + chainId: 'stride-1', + icqEnabled: false, + stakingTokens: [ + { + denom: 'ustrd', + }, + ], + }, + }, + connectionInfos: { + 'agoric-3_osmosis-1': { + client_id: '07-tendermint-1', + counterparty: { + client_id: '07-tendermint-2109', + connection_id: 'connection-1649', + }, + id: 'connection-1', + state: 3, + transferChannel: { + channelId: 'channel-1', + counterPartyChannelId: 'channel-320', + counterPartyPortId: 'transfer', + ordering: 0, + portId: 'transfer', + state: 3, + version: 'ics20-1', + }, + }, + 'agoric-3_stride-1': { + client_id: '07-tendermint-74', + counterparty: { + client_id: '07-tendermint-129', + connection_id: 'connection-118', + }, + id: 'connection-68', + state: 3, + transferChannel: { + channelId: 'channel-59', + counterPartyChannelId: 'channel-148', + counterPartyPortId: 'transfer', + ordering: 0, + portId: 'transfer', + state: 3, + version: 'ics20-1', + }, + }, + 'osmosis-1_stride-1': { + client_id: '07-tendermint-2119', + counterparty: { + client_id: '07-tendermint-1', + connection_id: 'connection-2', + }, + id: 'connection-1657', + state: 3, + transferChannel: { + channelId: 'channel-326', + counterPartyChannelId: 'channel-5', + counterPartyPortId: 'transfer', + ordering: 0, + portId: 'transfer', + state: 3, + version: 'ics20-1', + }, + }, + }, + denom: {}, + }, contract: { orchestration: { unbondAndTransfer: { diff --git a/packages/orchestration/test/examples/snapshots/unbond.contract.test.ts.snap b/packages/orchestration/test/examples/snapshots/unbond.contract.test.ts.snap index fbf713b176456c4563af10a276dffac5d86a43b3..9bf82ebc441f6257cf784eaba05cfb98d3c92f83 100644 GIT binary patch literal 1887 zcmV-l2cY;tRzV`7a}?GZoGaZiqLwKjThFj zV>@xe#j5G9oo#PV_0V0D^&%0oCj=5G5?msI6by=Th>%DQ5fX$0ibM{Pr6>U*KnN#7 z5nQ4uyhQ}lJ=0TDy|!nZ6YOc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mok<`IK-p`=Tm`sET_GP@>AY0J9a9J`MKSA;Y6ZKrGw>O}X z=uk$(()D)c*cDlNH`|ANBn>aO{B*GA%An4s)^E}gPoY~m$d9`0nw0UZHb2TCD`U!r z+<j<+a#GSCt$^n%|^`4a%qK> { const zone = provideDurableZone('root'); - const vt = prepareSwingsetVowTools(zone); + const vt = prepareSwingsetVowTools(zone.subZone('vows')); const { nameHub, nameAdmin } = makeNameHubKit(); - const chainHub = makeChainHub(nameHub, vt); + const chainHub = makeChainHub(zone.subZone('chainHub'), nameHub, vt); return { chainHub, nameAdmin, vt }; }; diff --git a/packages/orchestration/test/staking-ops.test.ts b/packages/orchestration/test/staking-ops.test.ts index 4b9dc90ff53..9e2f5c79e3c 100644 --- a/packages/orchestration/test/staking-ops.test.ts +++ b/packages/orchestration/test/staking-ops.test.ts @@ -229,6 +229,13 @@ const makeScenario = () => { eventLoopIteration, }); const { nameHub: agoricNames } = makeNameHubKit(); + + const chainHub = makeChainHub( + zone.subZone('chainHub'), + agoricNames, + vowTools, + ); + return { baggage, zone, @@ -238,6 +245,7 @@ const makeScenario = () => { timer, icqConnection, vowTools, + chainHub, ...mockZCF(), agoricNames, }; @@ -247,16 +255,16 @@ test('makeAccount() writes to storage', async t => { const s = makeScenario(); const { account, timer } = s; const { - agoricNames, makeRecorderKit, storageNode, zcf, icqConnection, vowTools, + chainHub, zone, } = s; const make = prepareCosmosOrchestrationAccountKit(zone, { - chainHub: makeChainHub(agoricNames, vowTools), + chainHub, makeRecorderKit, timerService: timer, vowTools, @@ -295,16 +303,16 @@ test('withdrawRewards() on StakingAccountHolder formats message correctly', asyn const s = makeScenario(); const { account, calls, timer } = s; const { - agoricNames, makeRecorderKit, storageNode, zcf, icqConnection, vowTools, + chainHub, zone, } = s; const make = prepareCosmosOrchestrationAccountKit(zone, { - chainHub: makeChainHub(agoricNames, vowTools), + chainHub, makeRecorderKit, timerService: timer, vowTools, @@ -339,17 +347,17 @@ test(`delegate; redelegate using invitationMakers`, async t => { const s = makeScenario(); const { account, calls, timer } = s; const { - agoricNames, makeRecorderKit, storageNode, zcf, zoe, icqConnection, vowTools, + chainHub, zone, } = s; const makeAccountKit = prepareCosmosOrchestrationAccountKit(zone, { - chainHub: makeChainHub(agoricNames, vowTools), + chainHub, makeRecorderKit, timerService: timer, vowTools, @@ -429,17 +437,17 @@ test(`withdraw rewards using invitationMakers`, async t => { const s = makeScenario(); const { account, calls, timer } = s; const { - agoricNames, makeRecorderKit, storageNode, zcf, zoe, icqConnection, vowTools, + chainHub, zone, } = s; const makeAccountKit = prepareCosmosOrchestrationAccountKit(zone, { - chainHub: makeChainHub(agoricNames, vowTools), + chainHub, makeRecorderKit, timerService: timer, vowTools, @@ -477,17 +485,17 @@ test(`undelegate waits for unbonding period`, async t => { const s = makeScenario(); const { account, calls, timer } = s; const { - agoricNames, makeRecorderKit, storageNode, zcf, zoe, icqConnection, vowTools, + chainHub, zone, } = s; const makeAccountKit = prepareCosmosOrchestrationAccountKit(zone, { - chainHub: makeChainHub(agoricNames, vowTools), + chainHub, makeRecorderKit, timerService: timer, vowTools, diff --git a/packages/orchestration/test/supports.ts b/packages/orchestration/test/supports.ts index 21603240711..691eada4312 100644 --- a/packages/orchestration/test/supports.ts +++ b/packages/orchestration/test/supports.ts @@ -164,7 +164,11 @@ export const commonSetup = async (t: ExecutionContext) => { await eventLoopIteration(); }; - const chainHub = makeChainHub(agoricNames, vowTools); + const chainHub = makeChainHub( + rootZone.subZone('chainHub'), + agoricNames, + vowTools, + ); /** * Register BLD if it's not already registered.