Skip to content

Commit

Permalink
fix(cosmic-swingset): enforce consensusMode, not by sniffing $DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 9, 2022
1 parent 8c0a220 commit 960aa17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/cosmic-swingset/src/chain-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ export default async function main(progname, args, { env, homedir, agcc }) {
stateDir: stateDBDir,
});

const consensusMode = env.DEBUG === undefined;
// We want to make it hard for a validator to accidentally disable
// consensusMode.
const consensusMode = true;
const s = await launch(
stateDBDir,
mailboxStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmic-swingset/src/launch-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export async function launch(
meterProvider = DEFAULT_METER_PROVIDER,
slogFile = undefined,
slogSender,
consensusMode = false,
consensusMode = true,
) {
console.info('Launching SwingSet kernel');

Expand Down
3 changes: 3 additions & 0 deletions packages/cosmic-swingset/src/sim-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {
stateDir: stateDBdir,
});

// We don't want to force a sim chain to use consensus mode.
const consensusMode = false;
const s = await launch(
stateDBdir,
mailboxStorage,
Expand All @@ -102,6 +104,7 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {
metricsProvider,
SLOGFILE,
slogSender,
consensusMode,
);

const { savedHeight, savedActions, savedChainSends } = s;
Expand Down

0 comments on commit 960aa17

Please sign in to comment.