Skip to content

Commit

Permalink
fix(swingset): dynamic vats do not get control over their own metering
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Jun 29, 2020
1 parent 4ffd025 commit c6e4118
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/SwingSet/src/kernel/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ export default function buildKernel(kernelEndowments) {
runWithoutGlobalMeter(transformTildot, ...args),
});

// dynamic vats don't get control over their own metering
const dynamicVatPowers = harden({
Remotable,
getInterfaceOf,
transformTildot: (...args) =>
runWithoutGlobalMeter(transformTildot, ...args),
});

const syscallManager = harden({
kdebug,
send,
Expand Down Expand Up @@ -789,13 +797,13 @@ export default function buildKernel(kernelEndowments) {
)
.then(vatNS => {
const buildFn = vatNS.default;
const setup = (syscall, state, helpers, vatPowers0) => {
const setup = (syscall, state, helpers, _vatPowers0) => {
return helpers.makeLiveSlots(
syscall,
state,
buildFn,
helpers.vatID,
vatPowers0,
dynamicVatPowers,
);
};
const manager = buildVatManager(vatID, `dynamicVat${vatID}`, setup);
Expand Down

0 comments on commit c6e4118

Please sign in to comment.