Skip to content

Commit

Permalink
Cherry-pick core proposal and deploy-script-support changes (#8747)
Browse files Browse the repository at this point in the history
For upgrade-14
  • Loading branch information
mhofman committed Jan 19, 2024
2 parents d15d120 + 8ae111d commit db8db21
Show file tree
Hide file tree
Showing 25 changed files with 623 additions and 921 deletions.
3 changes: 2 additions & 1 deletion packages/agoric-cli/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
dappBranch = ['-b', opts.dappBranch];
}

const shallow = ['--depth', '1', '--shallow-submodules'];
const exitStatus = await pspawn(
'git',
['clone', '--origin=upstream', dappURL, DIR, ...dappBranch],
['clone', '--origin=upstream', ...shallow, dappURL, DIR, ...dappBranch],
{
stdio: 'inherit',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { makeHelpers } from '@agoric/deploy-script-support';

/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */
export const defaultProposalBuilder = async ({ publishRef, install }) =>
harden({
sourceSpec: './init-proposal.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { makeHelpers } from '@agoric/deploy-script-support';

/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */
export const defaultProposalBuilder = async ({ publishRef, install }) =>
harden({
sourceSpec: './upgrade-proposal.js',
Expand Down
1 change: 1 addition & 0 deletions packages/cosmic-swingset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@agoric/swing-store": "^0.9.2-u13.0",
"@agoric/swingset-vat": "^0.32.3-u13.0",
"@agoric/telemetry": "^0.6.3-u13.0",
"@endo/bundle-source": "2.5.2-upstream-rollup",
"@endo/far": "0.2.18",
"@endo/import-bundle": "0.3.4",
"@endo/init": "0.5.56",
Expand Down
17 changes: 10 additions & 7 deletions packages/cosmic-swingset/src/chain-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,15 @@ export default async function main(progname, args, { env, homedir, agcc }) {
const argv = {
bootMsg,
};
const vatHref = await importMetaResolve(
env.CHAIN_BOOTSTRAP_VAT_CONFIG ||
argv.bootMsg.params.bootstrap_vat_config,
import.meta.url,
);
const vatconfig = new URL(vatHref).pathname;
const getVatConfig = async () => {
const vatHref = await importMetaResolve(
env.CHAIN_BOOTSTRAP_VAT_CONFIG ||
argv.bootMsg.params.bootstrap_vat_config,
import.meta.url,
);
const vatconfig = new URL(vatHref).pathname;
return vatconfig;
};

// Delay makeShutdown to override the golang interrupts
const { registerShutdown } = makeShutdown();
Expand Down Expand Up @@ -463,7 +466,7 @@ export default async function main(progname, args, { env, homedir, agcc }) {
clearChainSends,
replayChainSends,
bridgeOutbound: doOutboundBridge,
vatconfig,
vatconfig: getVatConfig,
argv,
env,
verboseBlocks: true,
Expand Down
19 changes: 19 additions & 0 deletions packages/cosmic-swingset/src/helpers/json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-check

/**
* Parses JSON and, if necessary, throws exceptions that include the location
* of the offending file.
*
* @param {string} source
* @param {string} location
*/
export const parseLocatedJson = (source, location) => {
try {
return JSON.parse(source);
} catch (error) {
if (error instanceof SyntaxError) {
throw SyntaxError(`Cannot parse JSON from ${location}, ${error}`);
}
throw error;
}
};
Loading

0 comments on commit db8db21

Please sign in to comment.