Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Load l1 addresses in prover node #7858

Merged
merged 1 commit into from
Aug 9, 2024
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
14 changes: 10 additions & 4 deletions yarn-project/aztec/src/cli/cmds/start_prover_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {

import { mnemonicToAccount } from 'viem/accounts';

import { extractRelevantOptions } from '../util.js';
import { extractL1ContractAddresses, extractRelevantOptions } from '../util.js';

export const startProverNode = async (
options: any,
Expand All @@ -31,7 +31,10 @@ export const startProverNode = async (
process.exit(1);
}

const proverConfig = extractRelevantOptions<ProverNodeConfig>(options, proverNodeConfigMappings);
const proverConfig = {
...extractRelevantOptions<ProverNodeConfig>(options, proverNodeConfigMappings),
l1Contracts: extractL1ContractAddresses(options),
};

if (!options.archiver && !proverConfig.archiverUrl) {
userLog('--archiver.archiverUrl is required to start a Prover Node without --archiver option');
Expand Down Expand Up @@ -59,8 +62,11 @@ export const startProverNode = async (
// TODO(palla/prover-node) L1 contract addresses should not silently default to zero,
// they should be undefined if not set and fail loudly.
// Load l1 contract addresses from aztec node if not set.
if (proverConfig.nodeUrl && proverConfig.l1Contracts.rollupAddress.isZero()) {
proverConfig.l1Contracts = await createAztecNodeClient(proverConfig.nodeUrl).getL1ContractAddresses();
const isRollupAddressSet =
proverConfig.l1Contracts?.rollupAddress && !proverConfig.l1Contracts.rollupAddress.isZero();
const nodeUrl = proverConfig.nodeUrl ?? proverConfig.txProviderNodeUrl;
if (nodeUrl && !isRollupAddressSet) {
proverConfig.l1Contracts = await createAztecNodeClient(nodeUrl).getL1ContractAddresses();
}

const telemetry = createAndStartTelemetryClient(getTelemetryClientConfig());
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/prover-node/src/tx-provider/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const txProviderConfigMappings: ConfigMappingsType<TxProviderConfig> = {
txProviderNodeUrl: {
env: 'TX_PROVIDER_NODE_URL',
description: 'The URL of the tx provider node',
parseEnv: (val: string) => val || process.env.AZTEC_NODE_URL,
parseEnv: (val: string) => val,
},
};

Expand Down
Loading