Skip to content

Commit

Permalink
Merge branch 'master' into JeancarloBarrios/adding-flake
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios authored Feb 19, 2025
2 parents ce6e9b2 + f2f2ac5 commit 49f56c7
Show file tree
Hide file tree
Showing 28 changed files with 307 additions and 192 deletions.
6 changes: 6 additions & 0 deletions .github/actions/post-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ inputs:
runs:
using: composite
steps:
- name: collect coverage
shell: bash
if: ${{ github.repository_owner == 'agoric' }} && (success() || failure())
continue-on-error: true
run: |
./scripts/ci/collect-testruns.sh
- name: upload coverage prepare
shell: bash
id: coverage-prep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ const produceFeesAndWait = async (vstorage, feeAmount) => {
await retryUntilCondition(
() => vstorage.readLatestHead('published.reserve.metrics'),
metrics =>
AmountMath.isEqual(
AmountMath.isGTE(
// @ts-expect-error metrics has these fields.
metrics.allocations.Fee,
AmountMath.add(metricsBefore.allocations.Fee, feeAmount),
),
'Fee not received',
`At least ${feeAmount.value} amount of fee not received`,
{ log: console.log, setTimeout, ...config.retryOptions },
);
};
Expand Down
2 changes: 1 addition & 1 deletion a3p-integration/scripts/build-submission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shift || true
sdkroot=$(git rev-parse --show-toplevel)
(
cd "$sdkroot"
yarn agoric run --verbose "packages/builders/scripts/$builderScript" "$@"
npm exec agoric run -- --verbose "packages/builders/scripts/$builderScript" "$@"
)

# Create and populate the submission directory.
Expand Down
1 change: 0 additions & 1 deletion golang/cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"engines": {
"node": "^18.12 || ^20.9"
},
"packageManager": "[email protected]",
"scripts": {
"test": "exit 0",
"build:all": "make",
Expand Down
4 changes: 4 additions & 0 deletions multichain-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ The `agoric` software revision includes the vats necessary for building and test
- vat-transfer
- vat-orchestration

## Resource Requirements

The Kubernetes deployments in `config.yaml` and `config.fusdc.yaml` are configured to request approximately 6.5 CPU cores and 9.5 GiB of memory from the host machine. Make sure your local Kubernetes environment (Docker Desktop or similar) has sufficient resources allocated.

## Initial Setup

Install the relevant dependencies:
Expand Down
2 changes: 1 addition & 1 deletion multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"patch-package": "^8.0.0",
"starshipjs": "2.4.1",
"ts-blank-space": "^0.4.4",
"typescript": "~5.8.0-beta"
"typescript": "~5.8.1-rc"
},
"resolutions": {
"axios": "1.6.7",
Expand Down
18 changes: 9 additions & 9 deletions multichain-testing/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4925,7 +4925,7 @@ __metadata:
patch-package: "npm:^8.0.0"
starshipjs: "npm:2.4.1"
ts-blank-space: "npm:^0.4.4"
typescript: "npm:~5.8.0-beta"
typescript: "npm:~5.8.1-rc"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -5468,13 +5468,13 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:~5.8.0-beta":
version: 5.8.0-dev.20250130
resolution: "typescript@npm:5.8.0-dev.20250130"
"typescript@npm:~5.8.1-rc":
version: 5.8.1-rc
resolution: "typescript@npm:5.8.1-rc"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/20852f1703f109576c925a6710d6d0001656ecc77d60fca4ea94ecd562290cef4aa529f919f45f6ab3c8334d3746a938ecca700ed7d2fd563d7cbc3dbf75f2bf
checksum: 10c0/7692b2584d0bddbab2b9a76457908276cb968935b9e1a89b7429939b1c02c7c47b5b23f1e989e18bf441fc545a311f02e143e7594a3914e240554637011a7d70
languageName: node
linkType: hard

Expand All @@ -5488,13 +5488,13 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A~5.8.0-beta#optional!builtin<compat/typescript>":
version: 5.8.0-dev.20250130
resolution: "typescript@patch:typescript@npm%3A5.8.0-dev.20250130#optional!builtin<compat/typescript>::version=5.8.0-dev.20250130&hash=5786d5"
"typescript@patch:typescript@npm%3A~5.8.1-rc#optional!builtin<compat/typescript>":
version: 5.8.1-rc
resolution: "typescript@patch:typescript@npm%3A5.8.1-rc#optional!builtin<compat/typescript>::version=5.8.1-rc&hash=5786d5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/8cc5b8c72a84ff58ca8c2e3bdd25ea50e98aed8b6c079ddfa43f14744cd20d97529edd61ca930e99deb9c9d6321650fd69030169bbbd546187c426fcff83d360
checksum: 10c0/45267f3c53240100da1d53ec8ebaa008f019055fe339c79baf596bab180aab2821751781bfc3202d5f6180fe01200aed9ebf45dec84490ef3a9d90359326c075
languageName: node
linkType: hard

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"type-coverage": "^2.27.1",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.1",
"typescript": "~5.8.0-beta",
"typescript": "~5.8.1-rc",
"typescript-eslint": "^8.22.0"
},
"resolutions": {
Expand All @@ -49,7 +49,6 @@
},
"scripts": {
"clean": "yarn lerna run --no-bail clean",
"check-dependencies": "node ./scripts/check-mismatched-dependencies.cjs",
"docs": "run-s docs:build docs:update-functions-path",
"docs:build": "typedoc --tsconfig tsconfig.build.json",
"docs:markdown-for-agoric-documentation-repo": "run-s docs:markdown-build 'docs:update-functions-path md'",
Expand Down
6 changes: 3 additions & 3 deletions packages/SwingSet/src/kernel/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { makeUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
import { kser, kslot, makeError } from '@agoric/kmarshal';
import { assertKnownOptions } from '../lib/assertOptions.js';
import { foreverPolicy } from '../lib/runPolicies.js';
import { makeVatManagerFactory } from './vat-loader/manager-factory.js';
import { makeVatManagerMaker } from './vat-loader/manager-factory.js';
import { makeVatWarehouse } from './vat-warehouse.js';
import makeDeviceManager from './deviceManager.js';
import makeKernelKeeper, {
Expand Down Expand Up @@ -1557,7 +1557,7 @@ export default function buildKernel(
gcAndFinalize,
meterControl: makeDummyMeterControl(),
});
const vatManagerFactory = makeVatManagerFactory({
const makeVatManager = makeVatManagerMaker({
allVatPowers,
kernelKeeper,
vatEndowments,
Expand Down Expand Up @@ -1652,7 +1652,7 @@ export default function buildKernel(
}

const vatLoader = makeVatLoader({
vatManagerFactory,
makeVatManager,
kernelSlog,
makeSourcedConsole,
kernelKeeper,
Expand Down
71 changes: 26 additions & 45 deletions packages/SwingSet/src/kernel/vat-loader/manager-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { makeLocalVatManagerFactory } from './manager-local.js';
import { makeNodeSubprocessFactory } from './manager-subprocess-node.js';
import { makeXsSubprocessFactory } from './manager-subprocess-xsnap.js';

export function makeVatManagerFactory({
export function makeVatManagerMaker({
allVatPowers,
kernelKeeper,
vatEndowments,
Expand All @@ -18,14 +18,12 @@ export function makeVatManagerFactory({
vatEndowments,
gcTools,
});

const nodeSubprocessFactory = makeNodeSubprocessFactory({
startSubprocessWorker: startSubprocessWorkerNode,
kernelKeeper,
kernelSlog,
testLog: allVatPowers.testLog,
});

const xsWorkerFactory = makeXsSubprocessFactory({
startXSnap,
kernelKeeper,
Expand Down Expand Up @@ -69,58 +67,41 @@ export function makeVatManagerFactory({
* @param {import('@agoric/swingset-liveslots').LiveSlotsOptions} options.liveSlotsOptions
* @returns { Promise<import('../../types-internal.js').VatManager> }
*/
async function vatManagerFactory(
vatID,
{ managerOptions, liveSlotsOptions },
) {
async function makeVatManager(vatID, options) {
const { managerOptions, liveSlotsOptions } = options;
validateManagerOptions(managerOptions);
const { workerOptions, enableSetup } = managerOptions;
const { type } = workerOptions;

if (type !== 'local' && 'setup' in managerOptions) {
console.warn(`TODO: stop using setup() with ${type}`);
}
if (enableSetup) {
if (managerOptions.setup) {
return localFactory.createFromSetup(vatID, managerOptions);
} else {
return localFactory.createFromBundle(
vatID,
managerOptions.bundle,
managerOptions,
liveSlotsOptions,
);
}
} else if (type === 'local') {
return localFactory.createFromBundle(
vatID,
managerOptions.bundle,
managerOptions,
liveSlotsOptions,
);
if (type !== 'local' && (enableSetup || 'setup' in managerOptions)) {
console.warn(`TODO: stop using enableSetup and setup() with ${type}`);
}

if (type === 'node-subprocess') {
return nodeSubprocessFactory.createFromBundle(
vatID,
managerOptions.bundle,
managerOptions,
liveSlotsOptions,
);
if (enableSetup && managerOptions.setup) {
return localFactory.createFromSetup(vatID, managerOptions);
}

if (type === 'xsnap') {
assert(managerOptions.bundle, 'xsnap requires Bundle');
return xsWorkerFactory.createFromBundle(
vatID,
managerOptions.bundle,
managerOptions,
liveSlotsOptions,
);
/** @type {Pick<typeof xsWorkerFactory, 'createFromBundle'>} */
let factory;
if (enableSetup || type === 'local') {
factory = localFactory;
} else if (type === 'node-subprocess') {
factory = nodeSubprocessFactory;
} else if (type === 'xsnap') {
assert(managerOptions.bundle, 'worker type xsnap requires a bundle');
factory = xsWorkerFactory;
} else {
throw Error(`unknown vat worker type ${type}`);
}

throw Error(`unknown type ${type}, not 'local' or 'xsnap'`);
return factory.createFromBundle(
vatID,
// @ts-expect-error managerOptions.bundle might be undefined
managerOptions.bundle,
managerOptions,
liveSlotsOptions,
);
}

return harden(vatManagerFactory);
return harden(makeVatManager);
}
6 changes: 3 additions & 3 deletions packages/SwingSet/src/kernel/vat-loader/vat-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function makeVatRootObjectSlot() {
export function makeVatLoader(stuff) {
const {
overrideVatManagerOptions = {},
vatManagerFactory,
makeVatManager,
kernelSlog,
makeSourcedConsole,
kernelKeeper,
Expand Down Expand Up @@ -127,7 +127,7 @@ export function makeVatLoader(stuff) {
};

const finish = starting && kernelSlog.startup(vatID);
const manager = await vatManagerFactory(vatID, {
const manager = await makeVatManager(vatID, {
managerOptions,
liveSlotsOptions,
});
Expand All @@ -150,7 +150,7 @@ export function makeVatLoader(stuff) {
...overrideVatManagerOptions,
};
const liveSlotsOptions = {};
const manager = await vatManagerFactory(vatID, {
const manager = await makeVatManager(vatID, {
managerOptions,
liveSlotsOptions,
});
Expand Down
35 changes: 10 additions & 25 deletions packages/agoric-cli/scripts/get-sdk-package-names.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
#! /usr/bin/env node
// @ts-check
/* eslint-env node */
import { spawn } from 'child_process';
import { execFileSync } from 'child_process';
import { basename } from 'path';
import { listWorkspaces } from '../src/lib/packageManager.js';

const ps = spawn('yarn', ['workspaces', '--silent', 'info'], {
stdio: ['ignore', 'pipe', 'inherit'],
shell: true,
});
const workspaces = listWorkspaces({ execFileSync });

// Get Buffers of output.
const chunks = [];
ps.stdout.on('data', data => chunks.push(data));
const packageNames = workspaces.map(w => w.name);

// Wait for the process to exit.
ps.on('close', code => {
if (code !== 0) {
throw Error(`yarn info exited with code ${code}`);
}

// Get the output.
const json = Buffer.concat(chunks).toString('utf8');
// process.stderr.write(json);

// Write the module.
const workspaces = Object.keys(JSON.parse(json)).sort();
process.stdout.write(`\
// Write the module.
process.stdout.write(`\
// DO NOT EDIT - automatically generated by ${basename(
new URL(import.meta.url).pathname,
)}
new URL(import.meta.url).pathname,
)}
// prettier-ignore
export default ${JSON.stringify(workspaces, null, 2)};
export default ${JSON.stringify(packageNames.sort(), null, 2)};
`);
});
2 changes: 1 addition & 1 deletion packages/agoric-cli/src/bin-agops.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const progname = path.basename(process.argv[1]);
const program = new Command();
program.name(progname).version('unversioned');

program.addCommand(makeOracleCommand(logger));
program.addCommand(makeGovCommand(logger));
program.addCommand(makePerfCommand(logger));
program.addCommand(makePsmCommand(logger));
Expand Down Expand Up @@ -69,6 +68,7 @@ const procIO = {
setTimeout,
};

program.addCommand(makeOracleCommand(procIO, logger));
program.addCommand(makeReserveCommand(logger, procIO));
program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch }));
program.addCommand(makeInterCommand(procIO, { fetch }));
Expand Down
Loading

0 comments on commit 49f56c7

Please sign in to comment.