Skip to content

Commit

Permalink
Merge branch 'master' into muneeb/code-owners-file
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanlei authored Sep 26, 2024
2 parents e482662 + 9f30228 commit cba2a54
Show file tree
Hide file tree
Showing 14 changed files with 350 additions and 25 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ module.exports = {
tsconfigRootDir: __dirname,
extraFileExtensions: ['.cjs'],
},
plugins: ['@typescript-eslint', 'prettier'],
extends: ['@agoric', 'plugin:ava/recommended'],
plugins: ['@typescript-eslint', 'prettier', 'require-extensions'],
extends: [
'@agoric',
'plugin:ava/recommended',
'plugin:require-extensions/recommended',
],
// XXX false positive: Unused eslint-disable directive (no problems were reported from 'max-len')
reportUnusedDisableDirectives: true,

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/mergify-ready.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for fixup commits
id: fixup-commits
run: |
if [[ $(git rev-list "$BASE_SHA".."$HEAD_SHA" --grep="^\(fixup\|amend\|squash\)! " | wc -l) -eq 0 ]]; then
if ! git merge-base --is-ancestor "$BASE_SHA" "$HEAD_SHA"; then
echo "PR is not up to date with target branch, skipping fixup commit check"
elif [[ $(git rev-list "$BASE_SHA".."$HEAD_SHA" --grep="^\(fixup\|amend\|squash\)! " | wc -l) -eq 0 ]]; then
echo "No fixup/amend/squash commits found in commit history"
else
echo "fixup/amend/squash commits found in commit history"
Expand Down
2 changes: 1 addition & 1 deletion multichain-testing/scripts/pod-readiness.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execa } from 'execa';
import { sleep } from '../tools/sleep.ts';
import { sleep } from '../tools/sleep.js';

const checkPodsReadiness = async (): Promise<boolean> => {
const { stdout } = await execa('kubectl', ['get', 'pods']);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.5.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-require-extensions": "^0.1.3",
"lerna": "^5.6.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/orchestration/src/exos/exo-interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { IBCConnectionID } from '@agoric/vats';
import type { Vow } from '@agoric/vow';
import type { IcaAccount } from '../cosmos-api.ts';
import type { ICAChannelAddressOpts } from '../utils/address';
import type { ICQConnection } from './icq-connection-kit';
import type { IcaAccount } from '../cosmos-api.js';
import type { ICAChannelAddressOpts } from '../utils/address.js';
import type { ICQConnection } from './icq-connection-kit.js';

/**
* Authority to make a Cosmos interchain account or an interchain query connection.
Expand Down
2 changes: 0 additions & 2 deletions packages/swing-store/docs/swingstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ If, for some reason, the host wants to abandon execution, it can call `hostStora

`hostStorage.kvStore` is also available to let the host add items to a separate portion of the kvStore, using keys which start with a `host.` prefix. It can use this to coordinate with a separately-committed host database (e.g. to remember how much work has been given to the kernel, and how much has been successfully executed). This portion of the kvStore is unreachable by the kernel.

`hostStorage.setExportCallback()` is used to register an export callback after swingstore creation, see [data-export.md](./data-export.md) for details. Most applications will instead provide `options.exportCallback` to `openSwingStore()`.

`hostStorage.repairMetadata()` was used to repair a historical flaw in the database format, and is not needed by new installations.

## KernelStorage
Expand Down
14 changes: 4 additions & 10 deletions packages/swing-store/src/swingStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { doRepairMetadata } from './repairMetadata.js';
* commit: () => Promise<void>, // commit changes made since the last commit
* close: () => Promise<void>, // shutdown the store, abandoning any uncommitted changes
* diskUsage?: () => number, // optional stats method
* setExportCallback: (cb: (updates: KVPair[]) => void) => void, // Set a callback invoked by swingStore when new serializable data is available for export
* repairMetadata: (exporter: import('./exporter.js').SwingStoreExporter) => Promise<void>,
* }} SwingStoreHostStorage
*/
Expand Down Expand Up @@ -274,14 +273,10 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
)
`);

let exportCallback;
function setExportCallback(cb) {
typeof cb === 'function' || Fail`callback must be a function`;
exportCallback = cb;
}
if (options.exportCallback) {
setExportCallback(options.exportCallback);
}
const { exportCallback } = options;
exportCallback === undefined ||
typeof exportCallback === 'function' ||
Fail`export callback must be a function`;

const sqlAddPendingExport = db.prepare(`
INSERT INTO pendingExports (key, value)
Expand Down Expand Up @@ -600,7 +595,6 @@ export function makeSwingStore(dirPath, forceReset, options = {}) {
commit,
close,
diskUsage,
setExportCallback,
};
const debug = {
serialize,
Expand Down
2 changes: 1 addition & 1 deletion packages/xsnap/build.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODDABLE_URL=https://github.com/agoric-labs/moddable.git
MODDABLE_COMMIT_HASH=f6c5951fc055e4ca592b9166b9ae3cbb9cca6bf0
XSNAP_NATIVE_URL=https://github.com/agoric-labs/xsnap-pub
XSNAP_NATIVE_COMMIT_HASH=eef9b67da5517ed18ff9e0073b842db20924eae3
XSNAP_NATIVE_COMMIT_HASH=105bc6862050695b1723fa76df91564fe8111a37
4 changes: 2 additions & 2 deletions packages/xsnap/src/xsnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ const makeSnapshotLoaderWithPipe = async (
* @property {AsyncIterable<Uint8Array>} [snapshotStream]
* @property {string} [snapshotDescription]
* @property {boolean} [snapshotUseFs]
* @property {'ignore' | 'inherit'} [stdout]
* @property {'ignore' | 'inherit'} [stderr]
* @property {'ignore' | 'inherit' | 'pipe'} [stdout]
* @property {'ignore' | 'inherit' | 'pipe'} [stderr]
* @property {number} [meteringLimit]
* @property {Record<string, string>} [env]
*/
Expand Down
24 changes: 24 additions & 0 deletions packages/xsnap/test/fixture-xsnap-kill-parent-in-handlecommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import console from 'console';
import * as proc from 'child_process';
import * as os from 'os';
import fs from 'fs';
import process from 'node:process';
import { tmpName } from 'tmp';
import '@endo/init';
import { xsnap } from '../src/xsnap.js';
import { options } from './message-tools.js';

const io = { spawn: proc.spawn, os: os.type(), fs, tmpName };

async function handleCommand(_message) {
process.kill(process.pid, 'SIGKILL');
return new Uint8Array();
}

const vat = await xsnap({ ...options(io), handleCommand });
await vat.evaluate(
'function handleCommand(message) { issueCommand(new Uint8Array().buffer); };',
);
await vat.issueStringCommand('0');
console.error('Error: parent was not killed!');
await vat.close();
Loading

0 comments on commit cba2a54

Please sign in to comment.