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
7 changes: 7 additions & 0 deletions yarn-project/aztec-node/src/aztec-node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export type AztecNodeConfig = ArchiverConfig &
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 @@ -55,6 +57,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
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
12 changes: 10 additions & 2 deletions yarn-project/aztec/src/cli/chain_l2_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export type L2ChainConfig = {
aztecEpochDuration: number;
aztecProofSubmissionWindow: number;
testAccounts: boolean;
sponsoredFPC: boolean;
p2pEnabled: boolean;
p2pBootstrapNodes: string[];
registryAddress: string;
slashFactoryAddress: string;
seqMinTxsPerBlock: number;
seqMaxTxsPerBlock: number;
realProofs: boolean;
Expand All @@ -26,9 +28,11 @@ export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
aztecEpochDuration: 32,
aztecProofSubmissionWindow: 64,
testAccounts: true,
sponsoredFPC: false,
p2pEnabled: true,
p2pBootstrapNodes: [],
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
slashFactoryAddress: '',
seqMinTxsPerBlock: 0,
seqMaxTxsPerBlock: 0,
realProofs: true,
Expand All @@ -40,10 +44,12 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
aztecSlotDuration: 36,
aztecEpochDuration: 32,
aztecProofSubmissionWindow: 64,
testAccounts: false,
testAccounts: true,
sponsoredFPC: true,
p2pEnabled: true,
p2pBootstrapNodes: [],
registryAddress: '', // To be updated
registryAddress: '0x290667b79dd73ce03cd2fc901b905e7f1b001d18',
slashFactoryAddress: '0xc5aceadbb626630e854ffd6cb39105e9c541fa34',
seqMinTxsPerBlock: 0,
seqMaxTxsPerBlock: 4,
realProofs: true,
Expand Down Expand Up @@ -94,9 +100,11 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
Expand Down
10 changes: 6 additions & 4 deletions yarn-project/aztec/src/cli/cmds/start_node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getInitialTestAccounts } from '@aztec/accounts/testing';
import { type AztecNodeConfig, aztecNodeConfigMappings, getConfigEnvVars } from '@aztec/aztec-node';
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
import { NULL_KEY } from '@aztec/ethereum';
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
import type { LogFn } from '@aztec/foundation/log';
Expand Down Expand Up @@ -47,10 +48,11 @@ export async function startNode(

await preloadCrsDataForVerifying(nodeConfig, userLog);

const initialFundedAccounts = nodeConfig.testAccounts ? await getInitialTestAccounts() : [];
const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(
initialFundedAccounts.map(a => a.address),
);
const testAccounts = nodeConfig.testAccounts ? (await getInitialTestAccounts()).map(a => a.address) : [];
const sponsoredFPCAccounts = nodeConfig.sponsoredFPC ? [await getSponsoredFPCAddress()] : [];
const initialFundedAccounts = [...testAccounts, ...sponsoredFPCAccounts];

const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);

// Deploy contracts if needed
if (nodeSpecificOptions.deployAztecContracts || nodeSpecificOptions.deployAztecContractsSalt) {
Expand Down
7 changes: 5 additions & 2 deletions yarn-project/aztec/src/cli/cmds/start_prover_node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getInitialTestAccounts } from '@aztec/accounts/testing';
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
import { NULL_KEY } from '@aztec/ethereum';
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
Expand Down Expand Up @@ -101,8 +102,10 @@ export async function startProverNode(

await preloadCrsDataForVerifying(proverConfig, userLog);

const initialFundedAccounts = proverConfig.testAccounts ? await getInitialTestAccounts() : [];
const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts.map(a => a.address));
const testAccounts = proverConfig.testAccounts ? (await getInitialTestAccounts()).map(a => a.address) : [];
const sponsoredFPCAccounts = proverConfig.sponsoredFPC ? [await getSponsoredFPCAddress()] : [];
const initialFundedAccounts = [...testAccounts, ...sponsoredFPCAccounts];
const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts);

const proverNode = await createProverNode(proverConfig, { telemetry, broker }, { prefilledPublicData });
services.proverNode = [proverNode, ProverNodeApiSchema];
Expand Down
1 change: 1 addition & 0 deletions yarn-project/foundation/src/config/env_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export type EnvVar =
| 'REWARD_DISTRIBUTOR_CONTRACT_ADDRESS'
| 'TELEMETRY'
| 'TEST_ACCOUNTS'
| 'SPONSORED_FPC'
| 'TX_GOSSIP_VERSION'
| 'TXE_PORT'
| 'VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS'
Expand Down
7 changes: 7 additions & 0 deletions yarn-project/prover-node/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export type ProverNodeConfig = ArchiverConfig &
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;
};

type SpecificProverNodeConfig = {
Expand Down Expand Up @@ -95,6 +97,11 @@ export const proverNodeConfigMappings: ConfigMappingsType<ProverNodeConfig> = {
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 getProverNodeConfigFromEnv(): ProverNodeConfig {
Expand Down