What are you trying to do?
Disable test account deployment when starting a local sandbox network by setting TEST_ACCOUNTS=false:
TEST_ACCOUNTS=false aztec start --sandbox
The expectation is that no test accounts are deployed, but they are deployed anyway.
Code Reference
The bug is in yarn-project/aztec/src/cli/aztec_start_action.ts. In the sandbox branch, testAccounts is unconditionally hardcoded to true regardless of any environment variable:
// aztec_start_action.ts — sandbox branch
const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
const nodeOptions = extractNamespacedOptions(options, 'node');
sandboxOptions.testAccounts = true; // ← always true, TEST_ACCOUNTS env var is never consulted
This value is then passed directly to createSandbox:
const { node, pxe, stop } = await createSandbox(
{
...
testAccounts: sandboxOptions.testAccounts, // always true
...
},
userLog,
);
Meanwhile, the shell wrapper (aztec-up/bin/aztec) correctly respects the env var:
export TEST_ACCOUNTS=${TEST_ACCOUNTS:-true} # honours a pre-set value
But the TypeScript layer overrides it before it can be used.
Note: the non-sandbox node path (start_node.ts) correctly reads TEST_ACCOUNTS via getConfigEnvVars() — this bug is specific to the sandbox branch.
Aztec Version
v1.2.1
Additional Context
Proposed fix
- Add a
--sandbox.testAccounts option to the SANDBOX section of aztec_start_options.ts, bound to the TEST_ACCOUNTS env var with a default of true:
{
flag: '--sandbox.testAccounts',
description: 'Deploy test accounts on sandbox start',
envVar: 'TEST_ACCOUNTS',
...booleanConfigHelper(true),
},
- Remove the hardcoded override in
aztec_start_action.ts:
// delete this line:
sandboxOptions.testAccounts = true;
With this change sandboxOptions.testAccounts will be populated by Commander from the env var (defaulting to true), exactly like --sandbox.noPXE already works for NO_PXE.
A failing spec that captures the regression lives in yarn-project/aztec/src/cli/aztec_start_action.test.ts.
What are you trying to do?
Disable test account deployment when starting a local sandbox network by setting
TEST_ACCOUNTS=false:The expectation is that no test accounts are deployed, but they are deployed anyway.
Code Reference
The bug is in
yarn-project/aztec/src/cli/aztec_start_action.ts. In the sandbox branch,testAccountsis unconditionally hardcoded totrueregardless of any environment variable:This value is then passed directly to
createSandbox:Meanwhile, the shell wrapper (
aztec-up/bin/aztec) correctly respects the env var:But the TypeScript layer overrides it before it can be used.
Note: the non-sandbox node path (
start_node.ts) correctly readsTEST_ACCOUNTSviagetConfigEnvVars()— this bug is specific to the sandbox branch.Aztec Version
v1.2.1
Additional Context
Proposed fix
--sandbox.testAccountsoption to theSANDBOXsection ofaztec_start_options.ts, bound to theTEST_ACCOUNTSenv var with a default oftrue:aztec_start_action.ts:With this change
sandboxOptions.testAccountswill be populated by Commander from the env var (defaulting totrue), exactly like--sandbox.noPXEalready works forNO_PXE.A failing spec that captures the regression lives in
yarn-project/aztec/src/cli/aztec_start_action.test.ts.