From b83f88953c7060a0c4d7461cd1d6b1ceb88616d9 Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 20 Feb 2024 19:14:56 +0000 Subject: [PATCH] fix: add new contract to devnet in CI --- l1-contracts/scripts/ci_deploy_contracts.sh | 4 ++++ l1-contracts/terraform/main.tf | 9 +++++++++ yarn-project/aztec-node/terraform/main.tf | 4 ++++ yarn-project/aztec/src/cli/texts.ts | 1 + yarn-project/aztec/src/cli/util.ts | 14 ++++++++------ yarn-project/cli/src/cmds/deploy_l1_contracts.ts | 1 + 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/l1-contracts/scripts/ci_deploy_contracts.sh b/l1-contracts/scripts/ci_deploy_contracts.sh index 328653535ff..ee8d3a987a4 100755 --- a/l1-contracts/scripts/ci_deploy_contracts.sh +++ b/l1-contracts/scripts/ci_deploy_contracts.sh @@ -37,6 +37,7 @@ docker run \ # L1 -> L2 Inbox Address: 0xdf34a07c7da15630d3b5d6bb17651d548a6e9d8f # L2 -> L1 Outbox address: 0xf6b1b3c2c393fe55fe577a1f528bd72a76589ab0 # Contract Deployment Emitter Address: 0xf3ecc6e9428482a74687ee5f7b96f4dff8781454 +# Availability Oracle Address: 0x610178da211fef7d417bc0e6fed39f05609ad788 # Read the file line by line while IFS= read -r line; do @@ -59,6 +60,9 @@ while IFS= read -r line; do elif [[ $line == *"Emitter"* ]]; then export TF_VAR_CONTRACT_DEPLOYMENT_EMITTER_ADDRESS=$address echo "TF_VAR_CONTRACT_DEPLOYMENT_EMITTER_ADDRESS=$TF_VAR_CONTRACT_DEPLOYMENT_EMITTER_ADDRESS" + elif [[ $line == *"Oracle"* ]]; then + export TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$address + echo "TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS" fi done <"$FILE_PATH" diff --git a/l1-contracts/terraform/main.tf b/l1-contracts/terraform/main.tf index 89cb2c801e5..adf899760a1 100644 --- a/l1-contracts/terraform/main.tf +++ b/l1-contracts/terraform/main.tf @@ -20,6 +20,15 @@ output "rollup_contract_address" { value = var.ROLLUP_CONTRACT_ADDRESS } +variable "AVAILABILITY_ORACLE_CONTRACT_ADDRESS" { + type = string + default = "" +} + +output "availability_oracle_contract_address" { + value = var.AVAILABILITY_ORACLE_CONTRACT_ADDRESS +} + variable "REGISTRY_CONTRACT_ADDRESS" { type = string default = "" diff --git a/yarn-project/aztec-node/terraform/main.tf b/yarn-project/aztec-node/terraform/main.tf index 9d1f74dbd90..aa030c163d7 100644 --- a/yarn-project/aztec-node/terraform/main.tf +++ b/yarn-project/aztec-node/terraform/main.tf @@ -235,6 +235,10 @@ resource "aws_ecs_task_definition" "aztec-node" { "name": "REGISTRY_CONTRACT_ADDRESS", "value": "${data.terraform_remote_state.l1_contracts.outputs.registry_contract_address}" }, + { + "name": "AVAILABILITY_ORACLE_CONTRACT_ADDRESS", + "value": "${data.terraform_remote_state.l1_contracts.outputs.availability_oracle_contract_address}" + }, { "name": "API_KEY", "value": "${var.API_KEY}" diff --git a/yarn-project/aztec/src/cli/texts.ts b/yarn-project/aztec/src/cli/texts.ts index 2536e37637d..6d203edb071 100644 --- a/yarn-project/aztec/src/cli/texts.ts +++ b/yarn-project/aztec/src/cli/texts.ts @@ -5,6 +5,7 @@ const contractAddresses = 'inboxAddress:INBOX_CONTRACT_ADDRESS - string - The deployed L1 inbox contract address.\n' + 'outboxAddress:OUTBOX_CONTRACT_ADDRESS - string - The deployed L1 outbox contract address.\n' + 'contractDeploymentEmitterAddress:CONTRACT_DEPLOYMENT_EMITTER_ADDRESS - string - The deployed L1 contract deployment emitter contract address.\n'; +('availabilityOracleAddress:AVAILABILITY_ORACLE_CONTRACT_ADDRESS - string - The deployed L1 availability oracle contract address.\n'); const p2pOptions = 'p2pBlockCheckIntervalMS:P2P_BLOCK_CHECK_INTERVAL_MS - number - The frequency in which to check for blocks. Default: 100\n' + 'p2pL2QueueSize:P2P_L2_QUEUE_SIZE - number - Size of queue of L2 blocks to store. Default: 1000\n' + diff --git a/yarn-project/aztec/src/cli/util.ts b/yarn-project/aztec/src/cli/util.ts index 3f3556c87b8..28417b5217c 100644 --- a/yarn-project/aztec/src/cli/util.ts +++ b/yarn-project/aztec/src/cli/util.ts @@ -7,7 +7,13 @@ import { LogFn, createConsoleLogger } from '@aztec/foundation/log'; import { P2PConfig } from '@aztec/p2p'; import { GrumpkinScalar, PXEService, PXEServiceConfig } from '@aztec/pxe'; -const l1ContractsNames = ['rollupAddress', 'inboxAddress', 'outboxAddress', 'contractDeploymentEmitterAddress']; +const l1ContractsNames = [ + 'rollupAddress', + 'inboxAddress', + 'outboxAddress', + 'contractDeploymentEmitterAddress', + 'availabilityOracleAddress', +]; /** * Checks if the object has l1Contracts property @@ -69,10 +75,6 @@ export const mergeEnvVarsAndCliOptions = { - if (contractsRequired && !cliOptions.rollupAddress) { - throw new Error('Rollup contract address is required to start the service'); - } - let merged = { ...envVars, ...cliOptions } as T; if (hasL1Contracts(envVars)) { @@ -86,7 +88,7 @@ export const mergeEnvVarsAndCliOptions = L2 Inbox Address: ${l1ContractAddresses.inboxAddress.toString()}`); log(`L2 -> L1 Outbox address: ${l1ContractAddresses.outboxAddress.toString()}`); log(`Contract Deployment Emitter Address: ${l1ContractAddresses.contractDeploymentEmitterAddress.toString()}`); + log(`Availability Oracle Address: ${l1ContractAddresses.availabilityOracleAddress.toString()}`); log('\n'); }