Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cosmic-swingset): enforce consensusMode, not by sniffing $DEBUG #4515

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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