diff --git a/aztec-up/bin/aztec b/aztec-up/bin/aztec index fb512ec544fb..c84b66cc55e6 100755 --- a/aztec-up/bin/aztec +++ b/aztec-up/bin/aztec @@ -89,8 +89,9 @@ case ${1:-} in # Export p2p port forwarding only if set in env vars if [ -n "${P2P_PORT:-}" ]; then P2P_TCP_LISTEN_MAPPING="$P2P_PORT:$P2P_PORT" + P2P_UDP_LISTEN_MAPPING="${P2P_TCP_LISTEN_MAPPING}/udp" - PORTS_TO_EXPOSE="${PORTS_TO_EXPOSE:-} $P2P_TCP_LISTEN_MAPPING" + PORTS_TO_EXPOSE="${PORTS_TO_EXPOSE:-} $P2P_TCP_LISTEN_MAPPING $P2P_UDP_LISTEN_MAPPING" fi exec $(dirname $0)/.aztec-run aztec-start \ diff --git a/spartan/aztec-network/values/alpha-testnet.yaml b/spartan/aztec-network/values/alpha-testnet.yaml index 30e63fff4ed9..507455630b61 100644 --- a/spartan/aztec-network/values/alpha-testnet.yaml +++ b/spartan/aztec-network/values/alpha-testnet.yaml @@ -9,13 +9,13 @@ snapshots: aztec: realProofs: true numberOfDefaultAccounts: 0 - testAccounts: true - sponsoredFPC: false + testAccounts: false + sponsoredFPC: true bootstrapENRs: "enr:-LO4QLbJddVpePYjaiCftOBY-L7O6Mfj_43TAn5Q1Y-5qQ_OWmSFc7bTKWHzw5xmdVIqXUiizum_kIRniXdPnWHHcwEEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEI8nh9YlzZWNwMjU2azGhA-_dX6aFcXP1DLk91negbXL2a0mNYGXH4hrMvb2i92I0g3VkcIKd0A,enr:-LO4QN4WF8kFyV3sQVX0C_y_03Eepxk5Wac70l9QJcIDRYwKS6aRst1YcfbTDdvovXdRfKf-WSXNVWViGLhDA-dUz2MEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEIicTHolzZWNwMjU2azGhAsz7aFFYRnP5xjTux5UW-HyEQcW_EJrZMT1CNm79N4g-g3VkcIKd0A,enr:-LO4QFrGfkRaCk_iFTeUjR5ESwo45Eov9hx_T1-BLdoT-iHzFgCiHMT4V1KBtdFp8D0ajLSe5HcNYrhalmdJXgv6NTUEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEIlICt4lzZWNwMjU2azGhAlC6nKB3iDtRFqWKWqxf_t-P9hc-SZ6VFBJV4y3bTZBQg3VkcIKd0A" contracts: registryAddress: "0xad85d55a4bbef35e95396191c22903aa717edf1c" - rollupAddress: "0x8e9152bb1b0577ea82508c001785e92fc96035fd" - slashFactoryAddress: "0xf667f50fd68b30c38b12d29fee537fa5ea158eb8" + rollupAddress: "0xee29e2cfdf6bac577e7a6497a6d61856be22c9f1" + slashFactoryAddress: "0x0000000000000000000000000000000000000000" feeAssetHandlerContractAddress: "0xf0664fec6ac15313e18d5ad8225e46b7c6463338" network: diff --git a/spartan/scripts/upgrade_rollup_with_lock.sh b/spartan/scripts/upgrade_rollup_with_lock.sh index bd4c3e41d8df..5e06b03b942b 100755 --- a/spartan/scripts/upgrade_rollup_with_lock.sh +++ b/spartan/scripts/upgrade_rollup_with_lock.sh @@ -20,7 +20,9 @@ set -exu # --registry 0x29f815e32efdef19883cf2b92a766b7aebadd326 \ # --address 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 \ # --deposit-amount 200000000000000000000000 \ -# --mint +# --mint \ +# --test-accounts \ +# --sponsored-fpc # # where: # - aztec-docker-tag is the tag of the aztec docker image to use. @@ -28,6 +30,8 @@ set -exu # - address is the address that corresponds to whatever mnemonic/private key you are using. # - deposit-amount is optional, and if provided, will deposit the specified amount of governance tokens to the address. # - mint is optional, and if provided, will mint the governance tokens to the address before depositing. +# - test-accounts is optional, and if provided, will initialise the genesis state with funded test accounts. +# - sponsored-fpc is optional, and if provided, will initialise the genesis state with a funded FPC. # # It can also be used locally by providing an --aztec-bin argument to the path of the aztec binary. # For example, --aztec-bin /usr/src/yarn-project/aztec/dest/bin/index.js @@ -40,6 +44,8 @@ set -exu # --address 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 \ # --deposit-amount 10000000000000000 \ # --mint +# --test-accounts \ +# --sponsored-fpc # First set from environment variables if they exist DEPOSIT_AMOUNT="" @@ -48,6 +54,8 @@ SALT=$((RANDOM % 1000000)) # The default path to the aztec binary within the docker image AZTEC_BIN="/usr/src/yarn-project/aztec/dest/bin/index.js" AZTEC_DOCKER_IMAGE="" +TEST_ACCOUNTS="" +SPONSORED_FPC="" # Parse command line arguments (these will override env vars if provided) while [[ $# -gt 0 ]]; do @@ -80,6 +88,14 @@ while [[ $# -gt 0 ]]; do MINT="--mint" shift 1 ;; + --test-accounts) + TEST_ACCOUNTS="--test-accounts" + shift 1 + ;; + --sponsored-fpc) + SPONSORED_FPC="--sponsored-fpc" + shift 1 + ;; *) echo "Unknown parameter: $1" exit 1 @@ -106,7 +122,7 @@ cleanup() { # if aztec-docker-tag is set, use it if [ -n "$AZTEC_DOCKER_IMAGE" ]; then - EXE="docker run --rm --network=host --env-file .env.tmp $AZTEC_DOCKER_IMAGE $AZTEC_BIN" + EXE="docker run --rm --network=host --env-file .env.tmp $AZTEC_DOCKER_IMAGE node --no-warnings $AZTEC_BIN" # Check if the image exists locally before pulling it if ! docker images $AZTEC_DOCKER_IMAGE -q; then echo "Pulling docker image $AZTEC_DOCKER_IMAGE" @@ -126,7 +142,9 @@ if [ -n "$DEPOSIT_AMOUNT" ]; then $EXE deposit-governance-tokens -r $REGISTRY --recipient $MY_ADDR -a $DEPOSIT_AMOUNT $MINT fi -PAYLOAD=$($EXE deploy-new-rollup -r $REGISTRY --salt $SALT --json --test-accounts | jq -r '.payloadAddress') +OUTPUT=$($EXE deploy-new-rollup -r $REGISTRY --salt $SALT --json $TEST_ACCOUNTS $SPONSORED_FPC) + +PAYLOAD=$(echo $OUTPUT | jq -r '.payloadAddress') PROPOSAL_ID=$($EXE propose-with-lock -r $REGISTRY --payload-address $PAYLOAD --json | jq -r '.proposalId') diff --git a/yarn-project/aztec-node/src/aztec-node/config.ts b/yarn-project/aztec-node/src/aztec-node/config.ts index e6699178e4ed..fe3dc6e544cc 100644 --- a/yarn-project/aztec-node/src/aztec-node/config.ts +++ b/yarn-project/aztec-node/src/aztec-node/config.ts @@ -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 SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config'; @@ -29,7 +34,8 @@ export type AztecNodeConfig = ArchiverConfig & P2PConfig & DataStoreConfig & SentinelConfig & - SharedNodeConfig & { + SharedNodeConfig & + GenesisStateConfig & { /** L1 contracts addresses */ l1Contracts: L1ContractAddresses; /** Whether the validator is disabled for this node */ @@ -46,6 +52,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType = { ...p2pConfigMappings, ...sentinelConfigMappings, ...sharedNodeConfigMappings, + ...genesisStateConfigMappings, l1Contracts: { description: 'The deployed L1 contract addresses', nested: l1ContractAddressesMapping, diff --git a/yarn-project/aztec/src/bin/index.ts b/yarn-project/aztec/src/bin/index.ts index 55294c642f0e..ee13a912e714 100644 --- a/yarn-project/aztec/src/bin/index.ts +++ b/yarn-project/aztec/src/bin/index.ts @@ -12,6 +12,8 @@ import { createConsoleLogger, createLogger } from '@aztec/foundation/log'; import { Command } from 'commander'; +import { NETWORK_FLAG } from '../cli/aztec_start_options.js'; +import { type NetworkNames, enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js'; import { injectAztecCommands } from '../cli/index.js'; import { getCliVersion } from '../cli/release_version.js'; @@ -26,6 +28,22 @@ async function main() { process.once('SIGINT', shutdown); process.once('SIGTERM', shutdown); + // Intercept the setting of a network and enrich the environment with defaults for that network + let networkValue: string | undefined; + + const args = process.argv.slice(2); + const networkIndex = args.findIndex(arg => arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`); + + if (networkIndex !== -1) { + networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1]; + } + + networkValue = networkValue || process.env.NETWORK; + + if (networkValue !== undefined) { + await enrichEnvironmentWithChainConfig(networkValue as NetworkNames); + } + const cliVersion = getCliVersion(); let program = new Command('aztec'); program.description('Aztec command line interface').version(cliVersion); diff --git a/yarn-project/aztec/src/cli/aztec_start_action.ts b/yarn-project/aztec/src/cli/aztec_start_action.ts index 9ba1f849d256..af1e3e159916 100644 --- a/yarn-project/aztec/src/cli/aztec_start_action.ts +++ b/yarn-project/aztec/src/cli/aztec_start_action.ts @@ -11,7 +11,6 @@ import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client'; import { createSandbox } from '../sandbox/index.js'; import { github, splash } from '../splash.js'; -import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js'; import { getCliVersion } from './release_version.js'; import { extractNamespacedOptions, installSignalHandlers } from './util.js'; import { getVersions } from './versioning.js'; @@ -27,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...`); @@ -51,10 +51,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg userLog(`Not exposing PXE API through JSON-RPC server`); } } else { - // If a network is specified, enrich the environment with the chain config - if (options.network) { - await enrichEnvironmentWithChainConfig(options.network); - } if (options.node) { const { startNode } = await import('./cmds/start_node.js'); ({ config } = await startNode(options, signalHandlers, services, adminServices, userLog)); diff --git a/yarn-project/aztec/src/cli/aztec_start_options.ts b/yarn-project/aztec/src/cli/aztec_start_options.ts index d186761d5f06..9f5074394e7f 100644 --- a/yarn-project/aztec/src/cli/aztec_start_options.ts +++ b/yarn-project/aztec/src/cli/aztec_start_options.ts @@ -65,11 +65,13 @@ export const universalOptions = [ 'dataStoreMapSizeKb', ]; +export const NETWORK_FLAG = 'network'; + // Define categories and options export const aztecStartOptions: { [key: string]: AztecStartOption[] } = { NETWORK: [ { - flag: '--network ', + flag: `--${NETWORK_FLAG} `, description: 'Network to run Aztec on', defaultValue: undefined, envVar: 'NETWORK', @@ -82,12 +84,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = { defaultValue: undefined, envVar: undefined, }, - { - flag: '--sandbox.testAccounts [value]', - description: 'Deploy test accounts on sandbox start', - envVar: 'TEST_ACCOUNTS', - ...booleanConfigHelper(), - }, { flag: '--sandbox.noPXE [value]', description: 'Do not expose PXE service on sandbox start', @@ -267,12 +263,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = { envVar: 'WS_BLOCK_CHECK_INTERVAL_MS', parseVal: val => parseInt(val, 10), }, - { - flag: '--node.testAccounts [value]', - description: 'Populate genesis state with initial fee juice for test accounts', - envVar: 'TEST_ACCOUNTS', - ...booleanConfigHelper(), - }, { flag: '--node.syncMode ', description: diff --git a/yarn-project/aztec/src/cli/chain_l2_config.ts b/yarn-project/aztec/src/cli/chain_l2_config.ts index d42dcbdb87a7..5a6358974abd 100644 --- a/yarn-project/aztec/src/cli/chain_l2_config.ts +++ b/yarn-project/aztec/src/cli/chain_l2_config.ts @@ -1,3 +1,4 @@ +import { EthAddress } from '@aztec/aztec.js'; import type { EnvVar } from '@aztec/foundation/config'; import path from 'path'; @@ -48,12 +49,12 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = { aztecSlotDuration: 36, aztecEpochDuration: 32, aztecProofSubmissionWindow: 64, - testAccounts: true, + testAccounts: false, sponsoredFPC: true, p2pEnabled: true, p2pBootstrapNodes: [], registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c', - slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8', + slashFactoryAddress: '', feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338', seqMinTxsPerBlock: 0, seqMaxTxsPerBlock: 4, @@ -95,6 +96,15 @@ function enrichVar(envVar: EnvVar, value: string) { process.env[envVar] = value; } +function enrichEthAddressVar(envVar: EnvVar, value: string) { + // EthAddress doesn't like being given empty strings + if (value === '') { + enrichVar(envVar, EthAddress.ZERO.toString()); + return; + } + enrichVar(envVar, value); +} + export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) { const config = await getL2ChainConfig(networkName); if (!config) { @@ -109,13 +119,14 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames 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('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress); 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')); enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString()); enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString()); enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl); + + enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress); + enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress); + enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress); } diff --git a/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts b/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts index 9f96d5877e36..0080535a82b9 100644 --- a/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts +++ b/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts @@ -24,11 +24,10 @@ export async function deployL1Contracts( ) { const config = getL1ContractsConfigEnvVars(); - const initialFundedAccounts = testAccounts ? await getInitialTestAccounts() : []; + const initialAccounts = testAccounts ? await getInitialTestAccounts() : []; const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : []; - const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues( - initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress), - ); + const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress); + const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts); const { l1ContractAddresses } = await deployAztecContracts( rpcUrls, @@ -67,5 +66,9 @@ export async function deployL1Contracts( log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`); log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress?.toString()}`); log(`FeeAssetHandler Address: ${l1ContractAddresses.feeAssetHandlerAddress?.toString()}`); + log(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`); + log(`Initial validators: ${initialValidators.map(a => a.toString()).join(', ')}`); + log(`Genesis block hash: ${genesisBlockHash.toString()}`); + log(`Genesis archive root: ${genesisArchiveRoot.toString()}`); } } diff --git a/yarn-project/cli/src/cmds/l1/deploy_l1_verifier.ts b/yarn-project/cli/src/cmds/l1/deploy_l1_verifier.ts index bed0d52904e4..58252f8b3e73 100644 --- a/yarn-project/cli/src/cmds/l1/deploy_l1_verifier.ts +++ b/yarn-project/cli/src/cmds/l1/deploy_l1_verifier.ts @@ -13,15 +13,9 @@ export async function deployUltraHonkVerifier( privateKey: string | undefined, mnemonic: string, pxeRpcUrl: string, - bbBinaryPath: string, - bbWorkingDirectory: string, log: LogFn, debugLogger: Logger, ) { - if (!bbBinaryPath || !bbWorkingDirectory) { - throw new InvalidOptionArgumentError('Missing path to bb binary and working directory'); - } - const { publicClient, walletClient } = createL1Clients( ethRpcUrls, privateKey ?? mnemonic, diff --git a/yarn-project/cli/src/cmds/l1/deploy_new_rollup.ts b/yarn-project/cli/src/cmds/l1/deploy_new_rollup.ts index 5528f5e7e11a..d47d42515a07 100644 --- a/yarn-project/cli/src/cmds/l1/deploy_new_rollup.ts +++ b/yarn-project/cli/src/cmds/l1/deploy_new_rollup.ts @@ -5,6 +5,7 @@ import type { LogFn, Logger } from '@aztec/foundation/log'; import { getGenesisValues } from '@aztec/world-state/testing'; import { deployNewRollupContracts } from '../../utils/aztec.js'; +import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js'; export async function deployNewRollup( registryAddress: EthAddress, @@ -15,6 +16,7 @@ export async function deployNewRollup( mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, + sponsoredFPC: boolean, json: boolean, initialValidators: EthAddress[], log: LogFn, @@ -22,8 +24,10 @@ export async function deployNewRollup( ) { const config = getL1ContractsConfigEnvVars(); - const initialFundedAccounts = testAccounts ? await getInitialTestAccounts() : []; - const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts.map(a => a.address)); + const initialAccounts = testAccounts ? await getInitialTestAccounts() : []; + const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : []; + const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress); + const { genesisBlockHash, genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts); const { payloadAddress, rollup, slashFactoryAddress } = await deployNewRollupContracts( registryAddress, @@ -46,6 +50,10 @@ export async function deployNewRollup( { payloadAddress: payloadAddress.toString(), rollupAddress: rollup.address, + initialFundedAccounts: initialFundedAccounts.map(a => a.toString()), + initialValidators: initialValidators.map(a => a.toString()), + genesisBlockHash: genesisBlockHash.toString(), + genesisArchiveRoot: genesisArchiveRoot.toString(), slashFactoryAddress: slashFactoryAddress.toString(), }, null, @@ -55,6 +63,10 @@ export async function deployNewRollup( } else { log(`Payload Address: ${payloadAddress.toString()}`); log(`Rollup Address: ${rollup.address}`); + log(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`); + log(`Initial validators: ${initialValidators.map(a => a.toString()).join(', ')}`); + log(`Genesis block hash: ${genesisBlockHash.toString()}`); + log(`Genesis archive root: ${genesisArchiveRoot.toString()}`); log(`Slash Factory Address: ${slashFactoryAddress.toString()}`); } } diff --git a/yarn-project/cli/src/cmds/l1/index.ts b/yarn-project/cli/src/cmds/l1/index.ts index b792415807d4..3e6e3315cfdd 100644 --- a/yarn-project/cli/src/cmds/l1/index.ts +++ b/yarn-project/cli/src/cmds/l1/index.ts @@ -24,8 +24,6 @@ const l1RpcUrlsOption = new Option( .argParser((arg: string) => arg.split(',').map(url => url.trim())); export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) { - const { BB_BINARY_PATH, BB_WORKING_DIRECTORY } = process.env; - program .command('deploy-l1-contracts') .description('Deploys all necessary Ethereum contracts for Aztec.') @@ -83,6 +81,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger .option('--salt ', 'The optional salt to use in deployment', arg => parseInt(arg)) .option('--json', 'Output the contract addresses in JSON format') .option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts') + .option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract') .action(async options => { const { deployNewRollup } = await import('./deploy_new_rollup.js'); @@ -97,6 +96,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger options.mnemonicIndex, options.salt, options.testAccounts, + options.sponsoredFpc, options.json, initialValidators, log, @@ -412,8 +412,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger 'test test test test test test test test test test test junk', ) .requiredOption('--verifier ', 'Either mock or real', 'real') - .option('--bb ', 'Path to bb binary', BB_BINARY_PATH) - .option('--bb-working-dir ', 'Path to bb working directory', BB_WORKING_DIRECTORY) .action(async options => { const { deployMockVerifier, deployUltraHonkVerifier } = await import('./deploy_l1_verifier.js'); if (options.verifier === 'mock') { @@ -435,8 +433,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger options.l1PrivateKey, options.mnemonic, options.rpcUrl, - options.bb, - options.bbWorkingDir, log, debugLogger, ); diff --git a/yarn-project/ethereum/src/config.ts b/yarn-project/ethereum/src/config.ts index 35c6772a8e40..ffb41bd13688 100644 --- a/yarn-project/ethereum/src/config.ts +++ b/yarn-project/ethereum/src/config.ts @@ -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; @@ -114,6 +122,23 @@ export const l1ContractsConfigMappings: ConfigMappingsType = ...l1TxUtilsConfigMappings, }; +export const genesisStateConfigMappings: ConfigMappingsType = { + 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); +} diff --git a/yarn-project/prover-node/src/config.ts b/yarn-project/prover-node/src/config.ts index 7afbd08ecbc9..317fc8b56955 100644 --- a/yarn-project/prover-node/src/config.ts +++ b/yarn-project/prover-node/src/config.ts @@ -1,5 +1,6 @@ import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config'; import type { ACVMConfig, BBConfig } from '@aztec/bb-prover/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 SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config'; @@ -30,7 +31,8 @@ export type ProverNodeConfig = ArchiverConfig & DataStoreConfig & ProverCoordinationConfig & SharedNodeConfig & - SpecificProverNodeConfig; + SpecificProverNodeConfig & + GenesisStateConfig; type SpecificProverNodeConfig = { proverNodeMaxPendingJobs: number; @@ -84,6 +86,7 @@ export const proverNodeConfigMappings: ConfigMappingsType = { ...getTxSenderConfigMappings('PROVER'), ...proverCoordinationConfigMappings, ...specificProverNodeConfigMappings, + ...genesisStateConfigMappings, ...sharedNodeConfigMappings, };