Skip to content

Commit

Permalink
Merge branch '88-enable-pipelining'
Browse files Browse the repository at this point in the history
This rewrites most everything: the way objects+promises are referenced (both
in vats and the kernel), the way messages manage their result promises, the
kernel-side run-queue, the kernel-side promise tables, the way comms messages
are formatted, the entire comms layer, and all the comms tests. The kernel
now supports pipelining sends all the way into the deciding vat, and the
comms vat will pipeling those sends to the remote deciding machine.

It does not yet implement "forwarding" (replacing one promise with a
different one), nor do promise references get deleted after their promise has
been resolved.

The comms vat must be created with the `enablePipelining` option set to
`true` to get the pipelining behavior.

closes Agoric#88
closes Agoric#34
closes Agoric#79
closes Agoric#45
  • Loading branch information
warner committed Sep 9, 2019
2 parents a8fe25d + 2e24d8d commit c49b7ca
Show file tree
Hide file tree
Showing 92 changed files with 5,314 additions and 5,058 deletions.
20 changes: 18 additions & 2 deletions demo/encouragementBotComms/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,28 @@ export default function setup(syscall, state, helpers) {
D(devices.loopbox).registerInboundHandler(USER, vats.uservattp);
const usersender = D(devices.loopbox).makeSender(USER);
await E(vats.uservattp).registerMailboxDevice(usersender);
await E(vats.usercomms).init(vats.uservattp);
const {
transmitter: txToBotForUser,
setReceiver: setRxFromBotForUser,
} = await E(vats.uservattp).addRemote(BOT);
const rxFromBotForUser = await E(vats.usercomms).addRemote(
BOT,
txToBotForUser,
);
E(setRxFromBotForUser).setReceiver(rxFromBotForUser);

D(devices.loopbox).registerInboundHandler(BOT, vats.botvattp);
const botsender = D(devices.loopbox).makeSender(BOT);
await E(vats.botvattp).registerMailboxDevice(botsender);
await E(vats.botcomms).init(vats.botvattp);
const {
transmitter: txToUserForBot,
setReceiver: setRxFromUserForBot,
} = await E(vats.botvattp).addRemote(USER);
const rxFromUserForBot = await E(vats.botcomms).addRemote(
USER,
txToUserForBot,
);
E(setRxFromUserForBot).setReceiver(rxFromUserForBot);

await E(vats.botcomms).addEgress(
USER,
Expand Down
4 changes: 3 additions & 1 deletion demo/encouragementBotComms/vat-botcomms.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import buildCommsDispatch from '../../src/vats/comms';

export default function setup(syscall, state, helpers) {
return helpers.makeCommsSlots(syscall, state, helpers);
return buildCommsDispatch(syscall, state, helpers);
}
2 changes: 1 addition & 1 deletion demo/encouragementBotComms/vat-botvattp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import setup from '../../src/vat-tp/vattp';
import setup from '../../src/vats/vat-tp/vattp';

export default setup;
4 changes: 3 additions & 1 deletion demo/encouragementBotComms/vat-usercomms.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import buildCommsDispatch from '../../src/vats/comms';

export default function setup(syscall, state, helpers) {
return helpers.makeCommsSlots(syscall, state, helpers);
return buildCommsDispatch(syscall, state, helpers);
}
2 changes: 1 addition & 1 deletion demo/encouragementBotComms/vat-uservattp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import setup from '../../src/vat-tp/vattp';
import setup from '../../src/vats/vat-tp/vattp';

export default setup;
14 changes: 12 additions & 2 deletions demo/encouragementBotCommsBang/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ export default function setup(syscall, state, helpers) {
D(devices.loopbox).registerInboundHandler(USER, vats.uservattp);
const usersender = D(devices.loopbox).makeSender(USER);
await vats.uservattp!registerMailboxDevice(usersender);
await vats.usercomms!init(vats.uservattp);
const {
transmitter: txToBotForUser,
setReceiver: setRxFromBotForUser,
} = await vats.uservattp!addRemote(BOT);
const rxFromBotForUser = await vats.usercomms!addRemote(BOT, txToBotForUser);
setRxFromBotForUser!setReceiver(rxFromBotForUser);

D(devices.loopbox).registerInboundHandler(BOT, vats.botvattp);
const botsender = D(devices.loopbox).makeSender(BOT);
await vats.botvattp!registerMailboxDevice(botsender);
await vats.botcomms!init(vats.botvattp);
const {
transmitter: txToUserForBot,
setReceiver: setRxFromUserForBot,
} = await vats.botvattp!addRemote(USER);
const rxFromUserForBot = await vats.botcomms!addRemote(USER, txToUserForBot);
setRxFromUserForBot!setReceiver(rxFromUserForBot);

await vats.botcomms!addEgress(
USER,
Expand Down
4 changes: 3 additions & 1 deletion demo/encouragementBotCommsBang/vat-botcomms.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import buildCommsDispatch from '../../src/vats/comms';

export default function setup(syscall, state, helpers) {
return helpers.makeCommsSlots(syscall, state, helpers);
return buildCommsDispatch(syscall, state, helpers);
}
2 changes: 1 addition & 1 deletion demo/encouragementBotCommsBang/vat-botvattp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import setup from '../../src/vat-tp/vattp';
import setup from '../../src/vats/vat-tp/vattp';

export default setup;
4 changes: 3 additions & 1 deletion demo/encouragementBotCommsBang/vat-usercomms.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import buildCommsDispatch from '../../src/vats/comms';

export default function setup(syscall, state, helpers) {
return helpers.makeCommsSlots(syscall, state, helpers);
return buildCommsDispatch(syscall, state, helpers);
}
2 changes: 1 addition & 1 deletion demo/encouragementBotCommsBang/vat-uservattp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import setup from '../../src/vat-tp/vattp';
import setup from '../../src/vats/vat-tp/vattp';

export default setup;
Loading

0 comments on commit c49b7ca

Please sign in to comment.