Skip to content
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
25 changes: 9 additions & 16 deletions yarn-project/aztec-node/src/aztec-node/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum';
import {
type GenesisStateConfig,
type L1ContractAddresses,
genesisStateConfigMappings,
l1ContractAddressesMapping,
} from '@aztec/ethereum';
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
Expand All @@ -24,13 +29,10 @@ export type AztecNodeConfig = ArchiverConfig &
WorldStateConfig &
Pick<ProverClientConfig, 'bbBinaryPath' | 'bbWorkingDirectory' | 'realProofs'> &
P2PConfig &
DataStoreConfig & {
DataStoreConfig &
GenesisStateConfig & {
/** Whether the validator is disabled for this node */
disableValidator: boolean;
/** Whether to populate the genesis state with initial fee juice for the test accounts */
testAccounts: boolean;
/** Whether to populate the genesis state with initial fee juice for the sponsored FPC */
sponsoredFPC: boolean;
} & {
l1Contracts: L1ContractAddresses;
};
Expand All @@ -43,6 +45,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
...proverClientConfigMappings,
...worldStateConfigMappings,
...p2pConfigMappings,
...genesisStateConfigMappings,
l1Contracts: {
description: 'The deployed L1 contract addresses',
nested: l1ContractAddressesMapping,
Expand All @@ -52,16 +55,6 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
description: 'Whether the validator is disabled for this node.',
...booleanConfigHelper(),
},
testAccounts: {
env: 'TEST_ACCOUNTS',
description: 'Whether to populate the genesis state with initial fee juice for the test accounts.',
...booleanConfigHelper(),
},
sponsoredFPC: {
env: 'SPONSORED_FPC',
description: 'Whether to populate the genesis state with initial fee juice for the sponsored FPC.',
...booleanConfigHelper(false),
},
};

/**
Expand Down
1 change: 1 addition & 0 deletions yarn-project/aztec/src/cli/aztec_start_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
const cliVersion = getCliVersion();
const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
const nodeOptions = extractNamespacedOptions(options, 'node');
sandboxOptions.testAccounts = true;
userLog(`${splash}\n${github}\n\n`);
userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);

Expand Down
12 changes: 0 additions & 12 deletions yarn-project/aztec/src/cli/aztec_start_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
defaultValue: undefined,
envVar: undefined,
},
{
flag: '--sandbox.testAccounts',
description: 'Deploy test accounts on sandbox start',
envVar: 'TEST_ACCOUNTS',
...booleanConfigHelper(true),
},
{
flag: '--sandbox.noPXE',
description: 'Do not expose PXE service on sandbox start',
Expand Down Expand Up @@ -269,12 +263,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
envVar: 'WS_BLOCK_CHECK_INTERVAL_MS',
parseVal: val => parseInt(val, 10),
},
{
flag: '--node.testAccounts',
description: 'Populate genesis state with initial fee juice for test accounts',
envVar: 'TEST_ACCOUNTS',
...booleanConfigHelper(),
},
],
'P2P SUBSYSTEM': [
{
Expand Down
25 changes: 25 additions & 0 deletions yarn-project/ethereum/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import {
type ConfigMappingsType,
bigintConfigHelper,
booleanConfigHelper,
getConfigFromMappings,
numberConfigHelper,
} from '@aztec/foundation/config';

import { type L1TxUtilsConfig, l1TxUtilsConfigMappings } from './l1_tx_utils.js';

export type GenesisStateConfig = {
/** Whether to populate the genesis state with initial fee juice for the test accounts */
testAccounts: boolean;
/** Whether to populate the genesis state with initial fee juice for the sponsored FPC */
sponsoredFPC: boolean;
};

export type L1ContractsConfig = {
/** How many seconds an L1 slot lasts. */
ethereumSlotDuration: number;
Expand Down Expand Up @@ -114,6 +122,23 @@ export const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig> =
...l1TxUtilsConfigMappings,
};

export const genesisStateConfigMappings: ConfigMappingsType<GenesisStateConfig> = {
testAccounts: {
env: 'TEST_ACCOUNTS',
description: 'Whether to populate the genesis state with initial fee juice for the test accounts.',
...booleanConfigHelper(false),
},
sponsoredFPC: {
env: 'SPONSORED_FPC',
description: 'Whether to populate the genesis state with initial fee juice for the sponsored FPC.',
...booleanConfigHelper(false),
},
};

export function getL1ContractsConfigEnvVars(): L1ContractsConfig {
return getConfigFromMappings(l1ContractsConfigMappings);
}

export function getGenesisStateConfigEnvVars(): GenesisStateConfig {
return getConfigFromMappings(genesisStateConfigMappings);
}
27 changes: 5 additions & 22 deletions yarn-project/prover-node/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
import type { ACVMConfig, BBConfig } from '@aztec/bb-prover/config';
import {
type ConfigMappingsType,
booleanConfigHelper,
getConfigFromMappings,
numberConfigHelper,
} from '@aztec/foundation/config';
import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum';
import { type ConfigMappingsType, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
import {
Expand Down Expand Up @@ -33,12 +29,8 @@ export type ProverNodeConfig = ArchiverConfig &
TxSenderConfig &
DataStoreConfig &
ProverCoordinationConfig &
SpecificProverNodeConfig & {
/** Whether to populate the genesis state with initial fee juice for the test accounts */
testAccounts: boolean;
/** Whether to populate the genesis state with initial fee juice for the sponsored FPC */
sponsoredFPC: boolean;
};
SpecificProverNodeConfig &
GenesisStateConfig;

type SpecificProverNodeConfig = {
proverNodeMaxPendingJobs: number;
Expand Down Expand Up @@ -92,16 +84,7 @@ export const proverNodeConfigMappings: ConfigMappingsType<ProverNodeConfig> = {
...getTxSenderConfigMappings('PROVER'),
...proverCoordinationConfigMappings,
...specificProverNodeConfigMappings,
testAccounts: {
env: 'TEST_ACCOUNTS',
description: 'Whether to populate the genesis state with initial fee juice for the test accounts.',
...booleanConfigHelper(false),
},
sponsoredFPC: {
env: 'SPONSORED_FPC',
description: 'Whether to populate the genesis state with initial fee juice for the sponsored FPC.',
...booleanConfigHelper(false),
},
...genesisStateConfigMappings,
};

export function getProverNodeConfigFromEnv(): ProverNodeConfig {
Expand Down
Loading