Skip to content

Commit

Permalink
fix(cosmic-swingset)!: Exclude non-consensus configuration from boots…
Browse files Browse the repository at this point in the history
…trap vat arguments

Fix #9946
  • Loading branch information
gibson042 committed Aug 29, 2024
1 parent c895d84 commit dcf11e2
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion packages/cosmic-swingset/src/chain-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,31 @@ const toNumber = specimen => {
return number;
};

/**
* A boot message consists of cosmosInitAction fields that are subject to
* consensus. See cosmosInitAction in {@link ../../../golang/cosmos/app/app.go}.
*
* @param {any} initAction
*/
const makeBootMsg = initAction => {
const {
type,
blockTime,
blockHeight,
chainID,
params,
supplyCoins,
} = initAction;
return {
type,
blockTime,
blockHeight,
chainID,
params,
supplyCoins,
};
};

/**
* @template {unknown} [T=unknown]
* @param {(req: string) => string} call
Expand Down Expand Up @@ -365,7 +390,7 @@ export default async function main(progname, args, { env, homedir, agcc }) {
};

const argv = {
bootMsg: initAction,
bootMsg: makeBootMsg(initAction),
};
const getVatConfig = async () => {
const vatHref = await importMetaResolve(
Expand Down

0 comments on commit dcf11e2

Please sign in to comment.