diff --git a/yarn-project/aztec-node/src/aztec-node/config.ts b/yarn-project/aztec-node/src/aztec-node/config.ts index f630b941e599..58729cbc0e82 100644 --- a/yarn-project/aztec-node/src/aztec-node/config.ts +++ b/yarn-project/aztec-node/src/aztec-node/config.ts @@ -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; }; @@ -55,6 +57,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType = { 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), + }, }; /** diff --git a/yarn-project/aztec/src/cli/chain_l2_config.ts b/yarn-project/aztec/src/cli/chain_l2_config.ts index 233efb871c30..ebb15184140f 100644 --- a/yarn-project/aztec/src/cli/chain_l2_config.ts +++ b/yarn-project/aztec/src/cli/chain_l2_config.ts @@ -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; @@ -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, @@ -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, @@ -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')); diff --git a/yarn-project/aztec/src/cli/cmds/start_node.ts b/yarn-project/aztec/src/cli/cmds/start_node.ts index 9923c361ad05..9f2a8db1b142 100644 --- a/yarn-project/aztec/src/cli/cmds/start_node.ts +++ b/yarn-project/aztec/src/cli/cmds/start_node.ts @@ -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'; @@ -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) { diff --git a/yarn-project/aztec/src/cli/cmds/start_prover_node.ts b/yarn-project/aztec/src/cli/cmds/start_prover_node.ts index ca92cbbdee0d..6eb2d419b171 100644 --- a/yarn-project/aztec/src/cli/cmds/start_prover_node.ts +++ b/yarn-project/aztec/src/cli/cmds/start_prover_node.ts @@ -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'; @@ -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]; diff --git a/yarn-project/foundation/src/config/env_var.ts b/yarn-project/foundation/src/config/env_var.ts index 32ec18b1497e..0938c513bb44 100644 --- a/yarn-project/foundation/src/config/env_var.ts +++ b/yarn-project/foundation/src/config/env_var.ts @@ -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' diff --git a/yarn-project/prover-node/src/config.ts b/yarn-project/prover-node/src/config.ts index c4680d31748f..924f603d81bb 100644 --- a/yarn-project/prover-node/src/config.ts +++ b/yarn-project/prover-node/src/config.ts @@ -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 = { @@ -95,6 +97,11 @@ export const proverNodeConfigMappings: ConfigMappingsType = { 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 {