@agoric/vats 0.15.2-dev-9d3d871.0 → 0.15.2-dev-e7e7c67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -15
- package/src/ibc.d.ts +3 -2
- package/src/ibc.d.ts.map +1 -1
- package/src/ibc.js +109 -81
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/network-proposal.js +4 -2
- package/src/types.d.ts +2 -2
- package/src/vat-ibc.d.ts +2 -2
- package/src/vat-network.d.ts +4 -10
- package/src/vat-network.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/vats",
|
|
3
|
-
"version": "0.15.2-dev-
|
|
3
|
+
"version": "0.15.2-dev-e7e7c67.0+e7e7c67",
|
|
4
4
|
"description": "Agoric's Vat library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/assert": "0.6.1-dev-
|
|
26
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
27
|
-
"@agoric/governance": "0.10.4-dev-
|
|
28
|
-
"@agoric/internal": "0.3.3-dev-
|
|
29
|
-
"@agoric/network": "0.1.1-dev-
|
|
30
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
31
|
-
"@agoric/store": "0.9.3-dev-
|
|
32
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
33
|
-
"@agoric/time": "0.3.3-dev-
|
|
34
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
35
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
36
|
-
"@agoric/zone": "0.2.3-dev-
|
|
25
|
+
"@agoric/assert": "0.6.1-dev-e7e7c67.0+e7e7c67",
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-e7e7c67.0+e7e7c67",
|
|
27
|
+
"@agoric/governance": "0.10.4-dev-e7e7c67.0+e7e7c67",
|
|
28
|
+
"@agoric/internal": "0.3.3-dev-e7e7c67.0+e7e7c67",
|
|
29
|
+
"@agoric/network": "0.1.1-dev-e7e7c67.0+e7e7c67",
|
|
30
|
+
"@agoric/notifier": "0.6.3-dev-e7e7c67.0+e7e7c67",
|
|
31
|
+
"@agoric/store": "0.9.3-dev-e7e7c67.0+e7e7c67",
|
|
32
|
+
"@agoric/swingset-vat": "0.32.3-dev-e7e7c67.0+e7e7c67",
|
|
33
|
+
"@agoric/time": "0.3.3-dev-e7e7c67.0+e7e7c67",
|
|
34
|
+
"@agoric/vat-data": "0.5.3-dev-e7e7c67.0+e7e7c67",
|
|
35
|
+
"@agoric/zoe": "0.26.3-dev-e7e7c67.0+e7e7c67",
|
|
36
|
+
"@agoric/zone": "0.2.3-dev-e7e7c67.0+e7e7c67",
|
|
37
37
|
"@endo/far": "^1.0.4",
|
|
38
38
|
"@endo/import-bundle": "^1.0.4",
|
|
39
39
|
"@endo/marshal": "^1.3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"jessie.js": "^0.3.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
47
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-e7e7c67.0+e7e7c67",
|
|
48
48
|
"@endo/bundle-source": "^3.1.0",
|
|
49
49
|
"@endo/init": "^1.0.4",
|
|
50
50
|
"ava": "^5.3.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"typeCoverage": {
|
|
78
78
|
"atLeast": 89.69
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "e7e7c678d24b4b141a1b175ee8103770007fc566"
|
|
81
81
|
}
|
package/src/ibc.d.ts
CHANGED
|
@@ -13,13 +13,14 @@ export function prepareIBCConnectionHandler(zone: import('@agoric/base-zone').Zo
|
|
|
13
13
|
}): PromiseVow<Bytes>;
|
|
14
14
|
onClose(_conn: any, _reason: any, _handler: any): Promise<void>;
|
|
15
15
|
}>;
|
|
16
|
-
export function prepareIBCProtocol(zone: import('@agoric/base-zone').Zone,
|
|
16
|
+
export function prepareIBCProtocol(zone: import('@agoric/base-zone').Zone, powers: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
|
|
17
17
|
isRetryableReason?: ((reason: any) => boolean) | undefined;
|
|
18
18
|
watchPromise?: ((p: PromiseLike<any>, watcher: import("@agoric/vow/src/watch-promise.js").PromiseWatcher, ...args: unknown[]) => void) | undefined;
|
|
19
19
|
} | undefined) => {
|
|
20
20
|
when: <T = any, TResult1 = import("@agoric/vow/src/E.js").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow/src/E.js").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
21
21
|
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = T_1>(specimenP: import("@agoric/vow").ERef<T_1 | import("@agoric/vow").Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: unknown) => import("@agoric/vow").Vow<TResult1_1 | TResult2_1>;
|
|
22
22
|
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
|
|
23
|
+
allVows: (vows: any) => import("@agoric/vow").Vow<any>;
|
|
23
24
|
}>): (ibcdev: any) => {
|
|
24
25
|
protocolHandler: ProtocolHandler;
|
|
25
26
|
bridgeHandler: BridgeHandler;
|
|
@@ -35,7 +36,7 @@ export function prepareIBCProtocol(zone: import('@agoric/base-zone').Zone, { mak
|
|
|
35
36
|
onRevoke(_port: any, localAddr: any, _protocolHandler: any): Promise<void>;
|
|
36
37
|
}>;
|
|
37
38
|
bridgeHandler: import("@agoric/vats").Board<{
|
|
38
|
-
fromBridge(obj: any): Promise<
|
|
39
|
+
fromBridge(obj: any): Promise<import("@agoric/vow").Vow<any> | undefined>;
|
|
39
40
|
}>;
|
|
40
41
|
};
|
|
41
42
|
export function prepareCallbacks(zone: import('@agoric/base-zone').Zone): (dibcBridgeManager: import("@agoric/vats").ScopedBridgeManager) => import("@agoric/vats").Board<{
|
package/src/ibc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibc.d.ts","sourceRoot":"","sources":["ibc.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ibc.d.ts","sourceRoot":"","sources":["ibc.js"],"names":[],"mappings":"AA2DO,kDADK,OAAO,mBAAmB,EAAE,IAAI;;IA+CtC;;;;;;;OAOG;qBANQ,UAAU,eACV,KAAK,YACL,iBAAiB;QAEF,iBAAiB;QAC9B,WAAW,KAAK,CAAC;;GA6CnC;AAMM,yCAHI,OAAO,mBAAmB,EAAE,IAAI,UAChC;;;;;;;;EAAiD;qBAgBlC,eAAe;mBACjB,aAAa;;;;;;;;;;;;;;;EA6lBpC;AAKM,uCADK,OAAO,mBAAmB,EAAE,IAAI;;GAkB3C;4BAnxBa,OAAO,YAAY,EAAE,aAAa;wBAGnC,MAAM;2BAEN,MAAM;8BAEN,MAAM;;;oBAML,YAAY;iBACZ,SAAS;yBACT,YAAY;sBACZ,SAAS;;;aAKT,MAAM;gBACN,MAAM;;;WAGN,SAAS,GAAG,WAAW;oBACvB,MAAM,EAAE;YACR,MAAM;eACN,MAAM;kBACN,YAAY;aACZ,MAAM;;yBAEP,OAAO,aAAa,EAAE,MAAM,CAAC,kBAAkB,CAAC;uBAEhD,KAAK,cAAc,EAAE,cAAc,GAAG,WAAW,CAAC,GAAG;IACjE,SAAa,EAAE,QAAQ,CAAC;IACxB,UAAc,EAAE,UAAU,CAAC;IAC3B,YAAgB,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC"}
|
package/src/ibc.js
CHANGED
|
@@ -34,33 +34,6 @@ const DEFAULT_PACKET_TIMEOUT_NS = 10n * 60n * 1_000_000_000n;
|
|
|
34
34
|
* @property {IBCPortID} destination_port
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
/** @param {import('@agoric/base-zone').Zone} zone */
|
|
38
|
-
const prepareAckWatcher = zone => {
|
|
39
|
-
const makeAckWatcher = zone.exoClass(
|
|
40
|
-
'AckWatcher',
|
|
41
|
-
undefined,
|
|
42
|
-
(protocolUtils, packet) => ({ protocolUtils, packet }),
|
|
43
|
-
{
|
|
44
|
-
onFulfilled(ack) {
|
|
45
|
-
const { protocolUtils, packet } = this.state;
|
|
46
|
-
|
|
47
|
-
const realAck = ack || DEFAULT_ACKNOWLEDGEMENT;
|
|
48
|
-
const ack64 = dataToBase64(realAck);
|
|
49
|
-
protocolUtils
|
|
50
|
-
.downcall('receiveExecuted', {
|
|
51
|
-
packet,
|
|
52
|
-
ack: ack64,
|
|
53
|
-
})
|
|
54
|
-
.catch(e => this.self.onRejected(e));
|
|
55
|
-
},
|
|
56
|
-
onRejected(e) {
|
|
57
|
-
console.error(e);
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
);
|
|
61
|
-
return makeAckWatcher;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
37
|
/**
|
|
65
38
|
* @typedef {object} Counterparty
|
|
66
39
|
* @property {string} port_id
|
|
@@ -187,8 +160,9 @@ export const prepareIBCConnectionHandler = zone => {
|
|
|
187
160
|
* @param {import('@agoric/base-zone').Zone} zone
|
|
188
161
|
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
|
|
189
162
|
*/
|
|
190
|
-
export const prepareIBCProtocol = (zone,
|
|
191
|
-
const
|
|
163
|
+
export const prepareIBCProtocol = (zone, powers) => {
|
|
164
|
+
const { makeVowKit, watch } = powers;
|
|
165
|
+
|
|
192
166
|
const makeIBCConnectionHandler = prepareIBCConnectionHandler(zone);
|
|
193
167
|
|
|
194
168
|
/**
|
|
@@ -431,14 +405,12 @@ export const prepareIBCProtocol = (zone, { makeVowKit, watch, when }) => {
|
|
|
431
405
|
case 'channelOpenTry': {
|
|
432
406
|
// They're (more or less politely) asking if we are listening, so make an attempt.
|
|
433
407
|
const {
|
|
434
|
-
channelID,
|
|
435
408
|
portID,
|
|
436
409
|
counterparty: { port_id: rPortID, channel_id: rChannelID },
|
|
437
410
|
connectionHops: hops,
|
|
438
411
|
order,
|
|
439
412
|
version,
|
|
440
413
|
counterpartyVersion: rVersion,
|
|
441
|
-
asyncVersions,
|
|
442
414
|
} = obj;
|
|
443
415
|
|
|
444
416
|
const localAddr = `/ibc-port/${portID}/${order.toLowerCase()}/${version}`;
|
|
@@ -454,59 +426,19 @@ export const prepareIBCProtocol = (zone, { makeVowKit, watch, when }) => {
|
|
|
454
426
|
// e => console.warn('Manual packet', e, 'failed:', e),
|
|
455
427
|
// );
|
|
456
428
|
|
|
457
|
-
|
|
429
|
+
return watch(
|
|
458
430
|
/** @type {ProtocolImpl} */ (protocolImpl).inbound(
|
|
459
431
|
localAddr,
|
|
460
432
|
remoteAddr,
|
|
461
433
|
),
|
|
434
|
+
this.facets.protocolImplInboundWatcher,
|
|
435
|
+
{
|
|
436
|
+
obj,
|
|
437
|
+
rPortID,
|
|
438
|
+
rChannelID,
|
|
439
|
+
hops,
|
|
440
|
+
},
|
|
462
441
|
);
|
|
463
|
-
|
|
464
|
-
// Tell what version string we negotiated.
|
|
465
|
-
const attemptedLocal = await E(attempt).getLocalAddress();
|
|
466
|
-
const match = attemptedLocal.match(
|
|
467
|
-
// Match: ... /ORDER/VERSION ...
|
|
468
|
-
new RegExp('^(/[^/]+/[^/]+)*/(ordered|unordered)/([^/]+)(/|$)'),
|
|
469
|
-
);
|
|
470
|
-
|
|
471
|
-
const channelKey = `${channelID}:${portID}`;
|
|
472
|
-
if (!match) {
|
|
473
|
-
throw Error(
|
|
474
|
-
`${channelKey}: cannot determine version from attempted local address ${attemptedLocal}`,
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
const negotiatedVersion = match[3];
|
|
478
|
-
|
|
479
|
-
channelKeyToAttempt.init(channelKey, attempt);
|
|
480
|
-
channelKeyToInfo.init(channelKey, obj);
|
|
481
|
-
|
|
482
|
-
try {
|
|
483
|
-
if (asyncVersions) {
|
|
484
|
-
// We have async version negotiation, so we must call back now.
|
|
485
|
-
await util.downcall('tryOpenExecuted', {
|
|
486
|
-
packet: {
|
|
487
|
-
source_port: rPortID,
|
|
488
|
-
source_channel: rChannelID,
|
|
489
|
-
destination_port: portID,
|
|
490
|
-
destination_channel: channelID,
|
|
491
|
-
},
|
|
492
|
-
order,
|
|
493
|
-
version: negotiatedVersion,
|
|
494
|
-
hops,
|
|
495
|
-
});
|
|
496
|
-
} else if (negotiatedVersion !== version) {
|
|
497
|
-
// Too late; the other side gave us a version we didn't like.
|
|
498
|
-
throw Error(
|
|
499
|
-
`${channelKey}: async negotiated version was ${negotiatedVersion} but synchronous version was ${version}`,
|
|
500
|
-
);
|
|
501
|
-
}
|
|
502
|
-
} catch (e) {
|
|
503
|
-
// Clean up after our failed attempt.
|
|
504
|
-
channelKeyToAttempt.delete(channelKey);
|
|
505
|
-
channelKeyToInfo.delete(channelKey);
|
|
506
|
-
void E(attempt).close();
|
|
507
|
-
throw e;
|
|
508
|
-
}
|
|
509
|
-
break;
|
|
510
442
|
}
|
|
511
443
|
|
|
512
444
|
case 'channelOpenAck': {
|
|
@@ -624,8 +556,9 @@ export const prepareIBCProtocol = (zone, { makeVowKit, watch, when }) => {
|
|
|
624
556
|
const conn = channelKeyToConnP.get(channelKey);
|
|
625
557
|
const data = base64ToBytes(data64);
|
|
626
558
|
|
|
627
|
-
watch(conn.send(data),
|
|
628
|
-
|
|
559
|
+
return watch(conn.send(data), this.facets.ackWatcher, {
|
|
560
|
+
packet,
|
|
561
|
+
});
|
|
629
562
|
}
|
|
630
563
|
|
|
631
564
|
case 'acknowledgementPacket': {
|
|
@@ -735,6 +668,101 @@ export const prepareIBCProtocol = (zone, { makeVowKit, watch, when }) => {
|
|
|
735
668
|
return kit;
|
|
736
669
|
},
|
|
737
670
|
},
|
|
671
|
+
ackWatcher: {
|
|
672
|
+
onFulfilled(ack, watcherContext) {
|
|
673
|
+
const { packet } = watcherContext;
|
|
674
|
+
|
|
675
|
+
const realAck = ack || DEFAULT_ACKNOWLEDGEMENT;
|
|
676
|
+
const ack64 = dataToBase64(realAck);
|
|
677
|
+
this.facets.util
|
|
678
|
+
.downcall('receiveExecuted', {
|
|
679
|
+
packet,
|
|
680
|
+
ack: ack64,
|
|
681
|
+
})
|
|
682
|
+
.catch(e => this.facets.ackWatcher.onRejected(e));
|
|
683
|
+
},
|
|
684
|
+
onRejected(e) {
|
|
685
|
+
console.log(e);
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
protocolImplAttemptWatcher: {
|
|
689
|
+
onFulfilled(attemptedLocal, watcherContext) {
|
|
690
|
+
const {
|
|
691
|
+
channelID,
|
|
692
|
+
portID,
|
|
693
|
+
attempt,
|
|
694
|
+
obj,
|
|
695
|
+
asyncVersions,
|
|
696
|
+
rPortID,
|
|
697
|
+
rChannelID,
|
|
698
|
+
order,
|
|
699
|
+
hops,
|
|
700
|
+
version,
|
|
701
|
+
} = watcherContext;
|
|
702
|
+
const { channelKeyToAttempt, channelKeyToInfo } = this.state;
|
|
703
|
+
|
|
704
|
+
const match = attemptedLocal.match(
|
|
705
|
+
// Match: ... /ORDER/VERSION ...
|
|
706
|
+
new RegExp('^(/[^/]+/[^/]+)*/(ordered|unordered)/([^/]+)(/|$)'),
|
|
707
|
+
);
|
|
708
|
+
|
|
709
|
+
const channelKey = `${channelID}:${portID}`;
|
|
710
|
+
if (!match) {
|
|
711
|
+
throw Error(
|
|
712
|
+
`${channelKey}: cannot determine version from attempted local address ${attemptedLocal}`,
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
channelKeyToAttempt.init(channelKey, attempt);
|
|
717
|
+
channelKeyToInfo.init(channelKey, obj);
|
|
718
|
+
|
|
719
|
+
const negotiatedVersion = match[3];
|
|
720
|
+
|
|
721
|
+
try {
|
|
722
|
+
if (asyncVersions) {
|
|
723
|
+
// We have async version negotiation, so we must call back now.
|
|
724
|
+
return this.facets.util.downcall('tryOpenExecuted', {
|
|
725
|
+
packet: {
|
|
726
|
+
source_port: rPortID,
|
|
727
|
+
source_channel: rChannelID,
|
|
728
|
+
destination_port: portID,
|
|
729
|
+
destination_channel: channelID,
|
|
730
|
+
},
|
|
731
|
+
order,
|
|
732
|
+
version: negotiatedVersion,
|
|
733
|
+
hops,
|
|
734
|
+
});
|
|
735
|
+
} else if (negotiatedVersion !== version) {
|
|
736
|
+
// Too late; the other side gave us a version we didn't like.
|
|
737
|
+
throw Error(
|
|
738
|
+
`${channelKey}: async negotiated version was ${negotiatedVersion} but synchronous version was ${version}`,
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
} catch (e) {
|
|
742
|
+
// Clean up after our failed attempt.
|
|
743
|
+
channelKeyToAttempt.delete(channelKey);
|
|
744
|
+
channelKeyToInfo.delete(channelKey);
|
|
745
|
+
void E(attempt).close();
|
|
746
|
+
throw e;
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
protocolImplInboundWatcher: {
|
|
751
|
+
onFulfilled(attempt, watchContext) {
|
|
752
|
+
const { obj } = watchContext;
|
|
753
|
+
|
|
754
|
+
// Tell what version string we negotiated.
|
|
755
|
+
return watch(
|
|
756
|
+
E(attempt).getLocalAddress(),
|
|
757
|
+
this.facets.protocolImplAttemptWatcher,
|
|
758
|
+
{
|
|
759
|
+
...obj,
|
|
760
|
+
...watchContext,
|
|
761
|
+
attempt,
|
|
762
|
+
},
|
|
763
|
+
);
|
|
764
|
+
},
|
|
765
|
+
},
|
|
738
766
|
},
|
|
739
767
|
);
|
|
740
768
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-proposal.d.ts","sourceRoot":"","sources":["network-proposal.js"],"names":[],"mappings":"AAiBO,+CAHI,QAAQ,GAAG,OAAO,kGAoC5B;AAqCM,gOAhBI,eAAe,GAAG;IAC5B,OAAW,EAAE;QAAE,eAAe,EAAE,UAAU,GAAG,CAAC,CAAA;KAAE,CAAC;IACjD,OAAW,EAAE;QAAE,UAAU,EAAE,SAAS,GAAG,CAAC,CAAA;KAAE,CAAC;CACxC;;oBAEqB,YAAY;gBAAU,YAAY;;
|
|
1
|
+
{"version":3,"file":"network-proposal.d.ts","sourceRoot":"","sources":["network-proposal.js"],"names":[],"mappings":"AAiBO,+CAHI,QAAQ,GAAG,OAAO,kGAoC5B;AAqCM,gOAhBI,eAAe,GAAG;IAC5B,OAAW,EAAE;QAAE,eAAe,EAAE,UAAU,GAAG,CAAC,CAAA;KAAE,CAAC;IACjD,OAAW,EAAE;QAAE,UAAU,EAAE,SAAS,GAAG,CAAC,CAAA;KAAE,CAAC;CACxC;;oBAEqB,YAAY;gBAAU,YAAY;;kBAiF1D;AAEM;;;;;;;;;;;;;;;;;;;;;;;;;EAsBL;;;;;;;;;;;;;;;;;;;;iCAtGmB,SAAS,KAAK,UAAU,YAAY,KAAK,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;sBAE5D;IACZ,OAAW,EAAE,KAAK,UAAU,CAAC,CAAC;IAC9B,GAAO,EAAE,KAAK,MAAM,CAAC,CAAC;IACtB,YAAgB,EAAE,KAAK,eAAe,GAAG,SAAS,CAAC,CAAC;CACjD"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { E } from '@endo/far';
|
|
6
6
|
import { BridgeId as BRIDGE_ID } from '@agoric/internal';
|
|
7
7
|
import { prepareVowTools } from '@agoric/vat-data/vow.js';
|
|
8
|
-
import { makeScalarMapStore } from '@agoric/store';
|
|
9
8
|
import { makeHeapZone } from '@agoric/zone';
|
|
9
|
+
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
10
10
|
|
|
11
11
|
const NUM_IBC_PORTS_PER_CLIENT = 3;
|
|
12
12
|
const INTERCHAIN_ACCOUNT_CONTROLLER_PORT_PREFIX = 'icacontroller-';
|
|
@@ -108,7 +108,9 @@ export const setupNetworkProtocols = async (
|
|
|
108
108
|
// don't proceed if loadCriticalVat fails
|
|
109
109
|
await Promise.all(Object.values(vats));
|
|
110
110
|
|
|
111
|
-
produceVatUpgradeInfo.resolve(
|
|
111
|
+
produceVatUpgradeInfo.resolve(
|
|
112
|
+
makeScalarBigMapStore('vatUpgradeInfo', { durable: true }),
|
|
113
|
+
);
|
|
112
114
|
const info = await vatUpgradeInfoP;
|
|
113
115
|
info.init('ibc', ibcRef);
|
|
114
116
|
info.init('network', networkRef);
|
package/src/types.d.ts
CHANGED
|
@@ -87,13 +87,13 @@ export type NamesByAddressAdmin = NameAdmin & {
|
|
|
87
87
|
/** An object that can receive messages from the bridge device */
|
|
88
88
|
export type BridgeHandler = {
|
|
89
89
|
/** Handle an inbound message */
|
|
90
|
-
fromBridge: (obj: any) =>
|
|
90
|
+
fromBridge: (obj: any) => PromiseVow<void>;
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
/** An object which handles messages for a specific bridge */
|
|
94
94
|
export type ScopedBridgeManager = {
|
|
95
95
|
toBridge: (obj: any) => Promise<any>;
|
|
96
|
-
fromBridge: (obj: any) =>
|
|
96
|
+
fromBridge: (obj: any) => PromiseVow<void>;
|
|
97
97
|
initHandler: (handler: ERef<BridgeHandler>) => void;
|
|
98
98
|
setHandler: (handler: ERef<BridgeHandler>) => void;
|
|
99
99
|
};
|
package/src/vat-ibc.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
14
14
|
onRevoke(_port: any, localAddr: any, _protocolHandler: any): Promise<void>;
|
|
15
15
|
}>;
|
|
16
16
|
bridgeHandler: import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
17
|
-
fromBridge(obj: any): Promise<
|
|
17
|
+
fromBridge(obj: any): Promise<import("@agoric/vow").Vow<any> | undefined>;
|
|
18
18
|
}>;
|
|
19
19
|
};
|
|
20
20
|
makeCallbacks: (dibcBridgeManager: import("./types.js").ScopedBridgeManager) => import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
@@ -36,7 +36,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
36
36
|
onRevoke(_port: any, localAddr: any, _protocolHandler: any): Promise<void>;
|
|
37
37
|
}>;
|
|
38
38
|
bridgeHandler: import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
39
|
-
fromBridge(obj: any): Promise<
|
|
39
|
+
fromBridge(obj: any): Promise<import("@agoric/vow").Vow<any> | undefined>;
|
|
40
40
|
}>;
|
|
41
41
|
};
|
|
42
42
|
makeCallbacks: (dibcBridgeManager: import("./types.js").ScopedBridgeManager) => import("@endo/exo/src/exo-makers.js").Guarded<{
|
package/src/vat-network.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
2
|
-
makeLoopbackProtocolHandler: (instancePrefix
|
|
2
|
+
makeLoopbackProtocolHandler: (instancePrefix: any) => import("@endo/exo/src/exo-makers").Guarded<{
|
|
3
3
|
onCreate(_impl: any, _protocolHandler: any): Promise<void>;
|
|
4
4
|
generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;
|
|
5
5
|
onBind(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
6
|
-
onConnect(_port: any, localAddr: any, remoteAddr: any, _chandler: any, protocolHandler: any): Promise<
|
|
7
|
-
remoteInstance: any;
|
|
8
|
-
handler: ConnectionHandler;
|
|
9
|
-
}>;
|
|
6
|
+
onConnect(_port: any, localAddr: any, remoteAddr: any, _chandler: any, protocolHandler: any): Promise<import("@agoric/vow").Vow<any>>;
|
|
10
7
|
onInstantiate(_port: any, _localAddr: any, _remote: any, _protocol: any): Promise<string>;
|
|
11
8
|
onListen(port: any, localAddr: any, listenHandler: any, _protocolHandler: any): Promise<void>;
|
|
12
9
|
onListenRemove(port: Port, localAddr: string, listenHandler: ListenHandler, _protocolHandler: any): Promise<void>;
|
|
@@ -32,14 +29,11 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
32
29
|
/** @param {Parameters<typeof protocol.bind>} args */
|
|
33
30
|
bind: (localAddr: string) => Promise<Port | import("@agoric/vow").Vow<Port>>;
|
|
34
31
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
35
|
-
makeLoopbackProtocolHandler: (instancePrefix
|
|
32
|
+
makeLoopbackProtocolHandler: (instancePrefix: any) => import("@endo/exo/src/exo-makers").Guarded<{
|
|
36
33
|
onCreate(_impl: any, _protocolHandler: any): Promise<void>;
|
|
37
34
|
generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;
|
|
38
35
|
onBind(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
39
|
-
onConnect(_port: any, localAddr: any, remoteAddr: any, _chandler: any, protocolHandler: any): Promise<
|
|
40
|
-
remoteInstance: any;
|
|
41
|
-
handler: ConnectionHandler;
|
|
42
|
-
}>;
|
|
36
|
+
onConnect(_port: any, localAddr: any, remoteAddr: any, _chandler: any, protocolHandler: any): Promise<import("@agoric/vow").Vow<any>>;
|
|
43
37
|
onInstantiate(_port: any, _localAddr: any, _remote: any, _protocol: any): Promise<string>;
|
|
44
38
|
onListen(port: any, localAddr: any, listenHandler: any, _protocolHandler: any): Promise<void>;
|
|
45
39
|
onListenRemove(port: Port, localAddr: string, listenHandler: ListenHandler, _protocolHandler: any): Promise<void>;
|
package/src/vat-network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-network.d.ts","sourceRoot":"","sources":["vat-network.js"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"vat-network.d.ts","sourceRoot":"","sources":["vat-network.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;IAqBI,wEAAwE;;IAGxE,0EAA0E;;IAG1E,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;IANrD,wEAAwE;;IAGxE,0EAA0E;;IAG1E,qDAAqD;;GAGxD"}
|