diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index c31c07152e2..50de148405c 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -57,6 +57,14 @@ spec: value: {{ include "aztec-network.ethereumHost" . | quote }} - name: INIT_VALIDATORS value: {{ not .Values.validator.external | quote }} + - name: ETHEREUM_SLOT_DURATION + value: "{{ .Values.ethereum.blockTime }}" + - name: AZTEC_SLOT_DURATION + value: "{{ .Values.aztec.slotDuration }}" + - name: AZTEC_EPOCH_DURATION + value: "{{ .Values.aztec.epochDuration }}" + - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS + value: "{{ .Values.aztec.epochProofClaimWindow }}" {{- end }} containers: - name: boot-node @@ -144,6 +152,14 @@ spec: value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} + - name: ETHEREUM_SLOT_DURATION + value: "{{ .Values.ethereum.blockTime }}" + - name: AZTEC_SLOT_DURATION + value: "{{ .Values.aztec.slotDuration }}" + - name: AZTEC_EPOCH_DURATION + value: "{{ .Values.aztec.epochDuration }}" + - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS + value: "{{ .Values.aztec.epochProofClaimWindow }}" ports: - containerPort: {{ .Values.bootNode.service.nodePort }} - containerPort: {{ .Values.bootNode.service.p2pTcpPort }} diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index 38de5cf1f9e..bd2f305710b 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -122,6 +122,14 @@ spec: value: "0.0.0.0:{{ .Values.proverNode.service.p2pTcpPort }}" - name: P2P_UDP_LISTEN_ADDR value: "0.0.0.0:{{ .Values.proverNode.service.p2pUdpPort }}" + - name: ETHEREUM_SLOT_DURATION + value: "{{ .Values.ethereum.blockTime }}" + - name: AZTEC_SLOT_DURATION + value: "{{ .Values.aztec.slotDuration }}" + - name: AZTEC_EPOCH_DURATION + value: "{{ .Values.aztec.epochDuration }}" + - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS + value: "{{ .Values.aztec.epochProofClaimWindow }}" ports: - containerPort: {{ .Values.proverNode.service.nodePort }} - containerPort: {{ .Values.proverNode.service.p2pTcpPort }} diff --git a/spartan/aztec-network/templates/transaction-bot.yaml b/spartan/aztec-network/templates/transaction-bot.yaml index 75a1d09f32c..1b224e4665d 100644 --- a/spartan/aztec-network/templates/transaction-bot.yaml +++ b/spartan/aztec-network/templates/transaction-bot.yaml @@ -105,4 +105,4 @@ spec: {{- if and (eq .Values.bot.service.type "NodePort") .Values.bot.service.nodePort }} nodePort: {{ .Values.bot.service.nodePort }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index b97884e557d..ac6223b5dff 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -147,6 +147,14 @@ spec: value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} + - name: ETHEREUM_SLOT_DURATION + value: "{{ .Values.ethereum.blockTime }}" + - name: AZTEC_SLOT_DURATION + value: "{{ .Values.aztec.slotDuration }}" + - name: AZTEC_EPOCH_DURATION + value: "{{ .Values.aztec.epochDuration }}" + - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS + value: "{{ .Values.aztec.epochProofClaimWindow }}" ports: - containerPort: {{ .Values.validator.service.nodePort }} - containerPort: {{ .Values.validator.service.p2pTcpPort }} @@ -255,4 +263,4 @@ spec: protocol: UDP --- {{- end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 4c846408d48..7c87a20c088 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -23,6 +23,11 @@ images: image: ghcr.io/paradigmxyz/reth:v1.0.8 pullPolicy: IfNotPresent +aztec: + slotDuration: 24 # in seconds, aka L2 slot duration. Must be a multiple of {{ ethereum.blockTime }} + epochDuration: 16 # how many L2 slots in an epoch + epochProofClaimWindow: 13 # in L2 slots + bootNode: externalTcpHost: "" externalUdpHost: "" diff --git a/spartan/aztec-network/values/1-validator-with-proving.yaml b/spartan/aztec-network/values/1-validator-with-proving.yaml index ac7ca644a1f..30e7d5b87af 100644 --- a/spartan/aztec-network/values/1-validator-with-proving.yaml +++ b/spartan/aztec-network/values/1-validator-with-proving.yaml @@ -32,6 +32,10 @@ jobs: deployL1Verifier: enable: true +aztec: + slotDuration: 36 + epochDuration: 32 + telemetry: enabled: true otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 diff --git a/yarn-project/ethereum/src/config.ts b/yarn-project/ethereum/src/config.ts index a7b0733f190..eda0024870b 100644 --- a/yarn-project/ethereum/src/config.ts +++ b/yarn-project/ethereum/src/config.ts @@ -1,4 +1,4 @@ -import { type ConfigMappingsType, getConfigFromMappings } from '@aztec/foundation/config'; +import { type ConfigMappingsType, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config'; export type L1ContractsConfig = { /** How many seconds an L1 slot lasts. */ @@ -25,27 +25,27 @@ export const l1ContractsConfigMappings: ConfigMappingsType = ethereumSlotDuration: { env: 'ETHEREUM_SLOT_DURATION', description: 'How many seconds an L1 slot lasts.', - defaultValue: DefaultL1ContractsConfig.ethereumSlotDuration, + ...numberConfigHelper(DefaultL1ContractsConfig.ethereumSlotDuration), }, aztecSlotDuration: { env: 'AZTEC_SLOT_DURATION', description: 'How many seconds an L2 slots lasts (must be multiple of ethereum slot duration).', - defaultValue: DefaultL1ContractsConfig.aztecSlotDuration, + ...numberConfigHelper(DefaultL1ContractsConfig.aztecSlotDuration), }, aztecEpochDuration: { env: 'AZTEC_EPOCH_DURATION', description: `How many L2 slots an epoch lasts (maximum AZTEC_MAX_EPOCH_DURATION).`, - defaultValue: DefaultL1ContractsConfig.aztecEpochDuration, + ...numberConfigHelper(DefaultL1ContractsConfig.aztecEpochDuration), }, aztecTargetCommitteeSize: { env: 'AZTEC_TARGET_COMMITTEE_SIZE', description: 'The target validator committee size.', - defaultValue: DefaultL1ContractsConfig.aztecTargetCommitteeSize, + ...numberConfigHelper(DefaultL1ContractsConfig.aztecTargetCommitteeSize), }, aztecEpochProofClaimWindowInL2Slots: { env: 'AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS', description: 'The number of L2 slots that we can wait for a proof of an epoch to be produced.', - defaultValue: DefaultL1ContractsConfig.aztecEpochProofClaimWindowInL2Slots, + ...numberConfigHelper(DefaultL1ContractsConfig.aztecEpochProofClaimWindowInL2Slots), }, }; diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index d4f44e3a88e..9bc631dbdc8 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -283,12 +283,11 @@ export const deployL1Contracts = async ( return await (await fetch(rpcUrl, content)).json(); }; if (isAnvilTestChain(chain.id)) { - const interval = 12; // @todo #8084 - const res = await rpcCall('anvil_setBlockTimestampInterval', [interval]); + const res = await rpcCall('anvil_setBlockTimestampInterval', [args.ethereumSlotDuration]); if (res.error) { throw new Error(`Error setting block interval: ${res.error.message}`); } - logger.info(`Set block interval to ${interval}`); + logger.info(`Set block interval to ${args.ethereumSlotDuration}`); } logger.info(`Deploying contracts from ${account.address.toString()}...`); @@ -347,6 +346,12 @@ export const deployL1Contracts = async ( ]); logger.info(`Deployed Fee Juice Portal at ${feeJuicePortalAddress}`); + const rollupArgs = { + aztecSlotDuration: args.aztecSlotDuration, + aztecEpochDuration: args.aztecEpochDuration, + targetCommitteeSize: args.aztecTargetCommitteeSize, + aztecEpochProofClaimWindowInL2Slots: args.aztecEpochProofClaimWindowInL2Slots, + }; const rollupAddress = await deployer.deploy(l1Artifacts.rollup, [ feeJuicePortalAddress.toString(), rewardDistributorAddress.toString(), @@ -354,14 +359,9 @@ export const deployL1Contracts = async ( args.protocolContractTreeRoot.toString(), account.address.toString(), args.initialValidators?.map(v => v.toString()) ?? [], - { - aztecSlotDuration: args.aztecSlotDuration, - aztecEpochDuration: args.aztecEpochDuration, - targetCommitteeSize: args.aztecTargetCommitteeSize, - aztecEpochProofClaimWindowInL2Slots: args.aztecEpochProofClaimWindowInL2Slots, - }, + rollupArgs, ]); - logger.info(`Deployed Rollup at ${rollupAddress}`); + logger.info(`Deployed Rollup at ${rollupAddress}`, rollupArgs); await deployer.waitForDeployments(); logger.info(`All core contracts deployed`);