From fda2dca4314c1124a4e95ee89a33848db5ad32de Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 2 Oct 2024 12:41:11 +0000 Subject: [PATCH 1/7] WIP reducing L1 requests --- .github/workflows/publish-aztec-packages.yml | 2 +- barretenberg/ts/Earthfile | 5 + docker-compose.provernet.yml | 121 ++++++++++-------- yarn-project/archiver/README.md | 2 +- .../archiver/src/archiver/archiver.ts | 5 + yarn-project/archiver/src/index.ts | 1 + yarn-project/aztec/terraform/node/main.tf | 2 +- .../aztec/terraform/prover-node/main.tf | 2 +- .../end-to-end/scripts/docker-compose-p2p.yml | 2 +- .../end-to-end/scripts/start_p2p_e2e.sh | 2 +- .../proof-verifier/src/proof_verifier.ts | 2 + yarn-project/publish_npm.sh | 4 - .../global_variable_builder/global_builder.ts | 1 + .../src/publisher/l1-publisher.ts | 1 + 14 files changed, 88 insertions(+), 64 deletions(-) diff --git a/.github/workflows/publish-aztec-packages.yml b/.github/workflows/publish-aztec-packages.yml index 6c654f4dd7c..c9b16c337f6 100644 --- a/.github/workflows/publish-aztec-packages.yml +++ b/.github/workflows/publish-aztec-packages.yml @@ -218,7 +218,7 @@ jobs: publish-npm: needs: publish-manifests - runs-on: ubuntu-latest + runs-on: ${{ github.actor }}-x86 env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} steps: diff --git a/barretenberg/ts/Earthfile b/barretenberg/ts/Earthfile index cc5d1695544..ea6c58286ba 100644 --- a/barretenberg/ts/Earthfile +++ b/barretenberg/ts/Earthfile @@ -71,6 +71,11 @@ build: RUN yarn pack && tar zxf package.tgz && rm package.tgz SAVE ARTIFACT /usr/src/barretenberg/ts build +deploy-npm: + FROM +build + RUN --secret NPM_TOKEN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > /usr/src/barretenberg/ts/.npmrc + RUN yarn publish + test: FROM +deps BUILD +test-prettier-format diff --git a/docker-compose.provernet.yml b/docker-compose.provernet.yml index 1084e28bf7b..7b3fcb05e24 100644 --- a/docker-compose.provernet.yml +++ b/docker-compose.provernet.yml @@ -3,7 +3,6 @@ # Logs latest block numbers every 10 seconds. name: aztec-provernet services: - # Anvil instance that serves as L1 ethereum: image: ghcr.io/foundry-rs/foundry@sha256:29ba6e34379e79c342ec02d437beb7929c9e254261e8032b17e187be71a2609f @@ -23,69 +22,39 @@ services: L1_CHAIN_ID: 31337 AZTEC_PORT: 80 DEPLOY_AZTEC_CONTRACTS: 1 - ARCHIVER_POLLING_INTERVAL: 1000 + ARCHIVER_POLLING_INTERVAL_MS: 10000 + ARCHIVER_VIEM_POLLING_INTERVAL_MS: 10000 SEQ_MAX_TX_PER_BLOCK: 4 SEQ_MIN_TX_PER_BLOCK: 1 SEQ_MAX_SECONDS_BETWEEN_BLOCKS: 3600 SEQ_MIN_SECONDS_BETWEEN_BLOCKS: 0 - SEQ_RETRY_INTERVAL: 10000 SEQ_PUBLISHER_PRIVATE_KEY: "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a" VALIDATOR_PRIVATE_KEY: "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a" PROVER_REAL_PROOFS: "${PROVER_REAL_PROOFS:-false}" ASSUME_PROVEN_THROUGH_BLOCK_NUMBER: "${ASSUME_PROVEN_THROUGH_BLOCK_NUMBER:-4}" P2P_ENABLED: false - IS_DEV_NET: true volumes: - ./log/aztec-node/:/usr/src/yarn-project/aztec/log:rw healthcheck: - test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] + test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] interval: 3s timeout: 30s start_period: 120s depends_on: - ethereum - command: + entrypoint: + - "node" + - "--no-warnings" + - "--inspect=0.0.0.0:9221" + - "/usr/src/yarn-project/aztec/dest/bin/index.js" - "start" - "--node" - "--archiver" - "--sequencer" - - # Bot for keeping a steady flow of txs into the network - # Requires bootstrapping to be completed successfully - aztec-bot: - image: "aztecprotocol/${IMAGE:-aztec:master}" - ports: - - "8082:80" - environment: - LOG_LEVEL: info - ETHEREUM_HOST: http://ethereum:8545 - AZTEC_NODE_URL: http://aztec-node - L1_CHAIN_ID: 31337 - AZTEC_PORT: 80 - BOT_PRIVATE_KEY: 0xcafe - BOT_TX_INTERVAL_SECONDS: 5 - BOT_PRIVATE_TRANSFERS_PER_TX: 1 - BOT_PUBLIC_TRANSFERS_PER_TX: 0 - BOT_NO_WAIT_FOR_TRANSFERS: true - BOT_NO_START: false - PXE_PROVER_ENABLED: "${PROVER_REAL_PROOFS:-false}" - PROVER_REAL_PROOFS: "${PROVER_REAL_PROOFS:-false}" - BB_SKIP_CLEANUP: "${BB_SKIP_CLEANUP:-0}" # Persist tmp dirs for debugging - IS_DEV_NET: true - volumes: - - ./log/aztec-bot/:/usr/src/yarn-project/aztec/log:rw - - ./cache/bb-crs/:/root/.bb-crs:rw - - ./workdir/bb-bot/:/usr/src/yarn-project/bb:rw - depends_on: - aztec-node: - condition: service_healthy - healthcheck: - test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] - interval: 3s - timeout: 30s - start_period: 10s - restart: on-failure:5 - command: [ "start", "--bot", "--pxe" ] + deploy: + resources: + limits: + memory: 800M # Prover node that listens for unproven blocks on L1, and generates and submits block proofs # Requires one or more agents to be connected for actually generating proofs @@ -97,26 +66,33 @@ services: environment: LOG_LEVEL: verbose ETHEREUM_HOST: http://ethereum:8545 - TX_PROVIDER_NODE_URL: http://aztec-node + PROVER_COORDINATION_NODE_URL: http://aztec-node L1_CHAIN_ID: 31337 AZTEC_PORT: 80 - ARCHIVER_POLLING_INTERVAL: 1000 + ARCHIVER_POLLING_INTERVAL_MS: 10000 + ARCHIVER_VIEM_POLLING_INTERVAL_MS: 10000 PROVER_AGENT_ENABLED: false PROVER_PUBLISHER_PRIVATE_KEY: "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97" PROVER_REAL_PROOFS: "${PROVER_REAL_PROOFS:-false}" - ASSUME_PROVEN_THROUGH_BLOCK_NUMBER: "${ASSUME_PROVEN_THROUGH_BLOCK_NUMBER:-4}" - IS_DEV_NET: true + ASSUME_PROVEN_THROUGH_BLOCK_NUMBER: "${ASSUME_PROVEN_THROUGH_BLOCK_NUMBER:-4000}" + ROLLUP_CONTRACT_ADDRESS: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 + REGISTRY_CONTRACT_ADDRESS: 0x5fbdb2315678afecb367f032d93f642f64180aa3 + INBOX_CONTRACT_ADDRESS: 0xb1ede3f5ac8654124cb5124adf0fd3885cbdd1f7 + OUTBOX_CONTRACT_ADDRESS: 0xa6d6d7c556ce6ada136ba32dbe530993f128ca44 + FEE_JUICE_CONTRACT_ADDRESS: 0xe7f1725e7734ce288f8367e1bb143e90bb3f0512 + FEE_JUICE_PORTAL_CONTRACT_ADDRESS: 0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0 + volumes: - ./log/aztec-prover/:/usr/src/yarn-project/aztec/log:rw depends_on: aztec-node: condition: service_healthy healthcheck: - test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] + test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] interval: 3s timeout: 30s start_period: 10s - command: [ "start", "--prover-node", "--archiver" ] + command: ["start", "--prover-node", "--archiver"] restart: on-failure:5 # Prover agent that connects to the prover-node for fetching proving jobs and executing them @@ -135,7 +111,8 @@ services: PROVER_TEST_DELAY_MS: "${PROVER_TEST_DELAY_MS:-0}" PROVER_AGENT_CONCURRENCY: 2 BB_SKIP_CLEANUP: "${BB_SKIP_CLEANUP:-0}" # Persist tmp dirs for debugging - IS_DEV_NET: true + ARCHIVER_POLLING_INTERVAL_MS: 10000 + ARCHIVER_VIEM_POLLING_INTERVAL_MS: 10000 volumes: - ./log/aztec-prover-agent/:/usr/src/yarn-project/aztec/log:rw - ./cache/bb-crs/:/root/.bb-crs:rw @@ -143,24 +120,60 @@ services: depends_on: aztec-prover: condition: service_healthy - command: [ "start", "--prover" ] + command: ["start", "--prover"] restart: on-failure:5 healthcheck: - test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] + test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] interval: 3s timeout: 30s start_period: 20s + # Bot for keeping a steady flow of txs into the network + # Requires bootstrapping to be completed successfully + aztec-bot: + image: "aztecprotocol/${IMAGE:-aztec:master}" + ports: + - "8082:80" + environment: + LOG_LEVEL: info + ETHEREUM_HOST: http://ethereum:8545 + AZTEC_NODE_URL: http://aztec-node + L1_CHAIN_ID: 31337 + AZTEC_PORT: 80 + BOT_PRIVATE_KEY: 0xcafe + BOT_TX_INTERVAL_SECONDS: 5 + BOT_PRIVATE_TRANSFERS_PER_TX: 1 + BOT_PUBLIC_TRANSFERS_PER_TX: 0 + BOT_NO_WAIT_FOR_TRANSFERS: true + BOT_NO_START: false + PXE_PROVER_ENABLED: "${PROVER_REAL_PROOFS:-false}" + PROVER_REAL_PROOFS: "${PROVER_REAL_PROOFS:-false}" + BB_SKIP_CLEANUP: "${BB_SKIP_CLEANUP:-0}" # Persist tmp dirs for debugging + volumes: + - ./log/aztec-bot/:/usr/src/yarn-project/aztec/log:rw + - ./cache/bb-crs/:/root/.bb-crs:rw + - ./workdir/bb-bot/:/usr/src/yarn-project/bb:rw + depends_on: + aztec-node: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] + interval: 3s + timeout: 30s + start_period: 10s + restart: on-failure:5 + command: ["start", "--bot", "--pxe"] + # Simple watcher that logs the latest block numbers every few seconds using the CLI and the bot's PXE aztec-block-watcher: - image: "aztecprotocol/${IMAGE:-aztec:master}" + image: "aztecprotocol/aztec:master" environment: ETHEREUM_HOST: http://ethereum:8545 L1_CHAIN_ID: 31337 depends_on: aztec-bot: condition: service_healthy - entrypoint: '/bin/bash -c' + entrypoint: "/bin/bash -c" command: > 'while true; do node --no-warnings ./node_modules/.bin/aztec block-number -u http://aztec-bot | head -n2; sleep 10; done' restart: on-failure:5 diff --git a/yarn-project/archiver/README.md b/yarn-project/archiver/README.md index b66fd1d46af..86f67911346 100644 --- a/yarn-project/archiver/README.md +++ b/yarn-project/archiver/README.md @@ -13,4 +13,4 @@ The interfaces defining how the data can be consumed from the archiver are `L2Bl To install dependencies and build the package run `yarn install` followed by `yarn build`. To run test execute `yarn test`. -To start the service export `ETHEREUM_HOST` (defaults to `http://127.0.0.1:8545/`), `ARCHIVER_POLLING_INTERVAL` (defaults to `1000 ms`), `ROLLUP_CONTRACT_ADDRESS`, `INBOX_CONTRACT_ADDRESS` environmental variables and start the service with `yarn start`. +To start the service export `ETHEREUM_HOST` (defaults to `http://127.0.0.1:8545/`), `ARCHIVER_POLLING_INTERVAL_MS` (defaults to `1000 ms`), `ROLLUP_CONTRACT_ADDRESS`, `INBOX_CONTRACT_ADDRESS` environmental variables and start the service with `yarn start`. diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index 23f5f668254..28ca29471bb 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -61,6 +61,8 @@ import { ArchiverInstrumentation } from './instrumentation.js'; import { type DataRetrieval } from './structs/data_retrieval.js'; import { type L1Published } from './structs/published.js'; +const logger = createDebugLogger('aztec:archiver:static'); + /** * Helper interface to combine all sources this archiver implementation provides. */ @@ -131,6 +133,9 @@ export class Archiver implements ArchiveSource { telemetry: TelemetryClient, blockUntilSynced = true, ): Promise { + logger.info('createAndSync'); + logger.info(`viem interval: ${config.viemPollingIntervalMS}`); + logger.info(`archiver interval: ${config.archiverPollingIntervalMS}`); const chain = createEthereumChain(config.l1RpcUrl, config.l1ChainId); const publicClient = createPublicClient({ chain: chain.chainInfo, diff --git a/yarn-project/archiver/src/index.ts b/yarn-project/archiver/src/index.ts index 6cd0fe60b15..ae7f86f8c20 100644 --- a/yarn-project/archiver/src/index.ts +++ b/yarn-project/archiver/src/index.ts @@ -25,6 +25,7 @@ async function main() { const config = getArchiverConfigFromEnv(); const { l1RpcUrl: rpcUrl, l1Contracts } = config; + log.info(`Starting archiver in main(): ${JSON.stringify(config)}`); const publicClient = createPublicClient({ chain: localhost, transport: http(rpcUrl), diff --git a/yarn-project/aztec/terraform/node/main.tf b/yarn-project/aztec/terraform/node/main.tf index 4ca97f5fe41..33fa008ae82 100644 --- a/yarn-project/aztec/terraform/node/main.tf +++ b/yarn-project/aztec/terraform/node/main.tf @@ -265,7 +265,7 @@ resource "aws_ecs_task_definition" "aztec-node" { value = "${local.data_dir}/node_${count.index + 1}/data" }, { - name = "ARCHIVER_POLLING_INTERVAL" + name = "ARCHIVER_POLLING_INTERVAL_MS" value = "10000" }, { diff --git a/yarn-project/aztec/terraform/prover-node/main.tf b/yarn-project/aztec/terraform/prover-node/main.tf index 5d22fe5300d..e98b0466e4e 100644 --- a/yarn-project/aztec/terraform/prover-node/main.tf +++ b/yarn-project/aztec/terraform/prover-node/main.tf @@ -249,7 +249,7 @@ resource "aws_ecs_task_definition" "aztec-prover-node" { { name = "API_PREFIX", value = "/${var.DEPLOY_TAG}/aztec-prover-node-${count.index + 1}/${var.API_KEY}" }, // Archiver - { name = "ARCHIVER_POLLING_INTERVAL", value = "10000" }, + { name = "ARCHIVER_POLLING_INTERVAL_MS", value = "10000" }, // Aztec node to pull clientivc proofs from (to be replaced with a p2p connection) { name = "TX_PROVIDER_NODE_URL", value = "http://${var.DEPLOY_TAG}-aztec-node-${count.index + 1}.local/${var.DEPLOY_TAG}/aztec-node-${count.index + 1}/${var.API_KEY}" }, diff --git a/yarn-project/end-to-end/scripts/docker-compose-p2p.yml b/yarn-project/end-to-end/scripts/docker-compose-p2p.yml index 57f3b51c8fb..f5c79b9c0c2 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-p2p.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-p2p.yml @@ -29,7 +29,7 @@ services: DEBUG_COLORS: 1 ETHEREUM_HOST: http://fork:8545 L1_CHAIN_ID: 31337 - ARCHIVER_POLLING_INTERVAL: 500 + ARCHIVER_POLLING_INTERVAL_MS: 500 P2P_CHECK_INTERVAL: 50 SEQ_TX_POLLING_INTERVAL: 50 WS_CHECK_INTERVAL: 50 diff --git a/yarn-project/end-to-end/scripts/start_p2p_e2e.sh b/yarn-project/end-to-end/scripts/start_p2p_e2e.sh index 88b21e9f6ee..edb89f08d82 100755 --- a/yarn-project/end-to-end/scripts/start_p2p_e2e.sh +++ b/yarn-project/end-to-end/scripts/start_p2p_e2e.sh @@ -1,7 +1,7 @@ #! /bin/bash set -eu export DEBUG='aztec:*' -export ARCHIVER_POLLING_INTERVAL=500 +export ARCHIVER_POLLING_INTERVAL_MS=500 export P2P_CHECK_INTERVAL=50 export WS_CHECK_INTERVAL=50 export SEQ_TX_POLLING_INTERVAL=50 diff --git a/yarn-project/proof-verifier/src/proof_verifier.ts b/yarn-project/proof-verifier/src/proof_verifier.ts index 265a7e8aac5..712a6489286 100644 --- a/yarn-project/proof-verifier/src/proof_verifier.ts +++ b/yarn-project/proof-verifier/src/proof_verifier.ts @@ -35,9 +35,11 @@ export class ProofVerifier { static async new(config: ProofVerifierConfig, telemetryClient: TelemetryClient): Promise { const logger = createDebugLogger('aztec:block-verifier-bot'); const verifier = await BBCircuitVerifier.new(config, [], logger); + logger.info(`Creating public client for ProofVerifier`); const client = createPublicClient({ chain: createEthereumChain(config.l1Url, config.l1ChainId).chainInfo, transport: http(config.l1Url), + pollingInterval: 10_000, }); return new ProofVerifier(config, client, verifier, telemetryClient, logger); diff --git a/yarn-project/publish_npm.sh b/yarn-project/publish_npm.sh index fed0810063b..16276ed3457 100644 --- a/yarn-project/publish_npm.sh +++ b/yarn-project/publish_npm.sh @@ -4,10 +4,6 @@ set -eu echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >.npmrc -echo "Current directory: $(pwd)" -echo "Contents of .npmrc:" -cat .npmrc - # This is to be used with the 'canary' tag for testing, and then 'latest' for making it public DIST_TAG=${1:-"latest"} VERSION=$2 diff --git a/yarn-project/sequencer-client/src/global_variable_builder/global_builder.ts b/yarn-project/sequencer-client/src/global_variable_builder/global_builder.ts index 3d9a6e0d093..8d381dbde85 100644 --- a/yarn-project/sequencer-client/src/global_variable_builder/global_builder.ts +++ b/yarn-project/sequencer-client/src/global_variable_builder/global_builder.ts @@ -39,6 +39,7 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface { this.publicClient = createPublicClient({ chain: chain.chainInfo, transport: http(chain.rpcUrl), + pollingInterval: 10_000, }); this.rollupContract = getContract({ diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index 99df20363d1..9720142c5a8 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -152,6 +152,7 @@ export class L1Publisher { this.publicClient = createPublicClient({ chain: chain.chainInfo, transport: http(chain.rpcUrl), + pollingInterval: 10_000, }); this.rollupContract = getContract({ From e9a4675cbe782699566a9700a39a7bf0ca9ca42e Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 3 Oct 2024 11:06:41 +0000 Subject: [PATCH 2/7] use viem interval where needed --- .github/workflows/publish-aztec-packages.yml | 2 +- yarn-project/ethereum/src/l1_reader.ts | 11 ++++++++++- yarn-project/foundation/src/config/env_var.ts | 6 +++++- yarn-project/proof-verifier/src/config.ts | 7 +++++++ yarn-project/proof-verifier/src/proof_verifier.ts | 2 +- .../src/global_variable_builder/global_builder.ts | 2 +- yarn-project/sequencer-client/src/publisher/config.ts | 7 ++++++- .../sequencer-client/src/publisher/l1-publisher.ts | 2 +- 8 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-aztec-packages.yml b/.github/workflows/publish-aztec-packages.yml index c9b16c337f6..16b7318d90e 100644 --- a/.github/workflows/publish-aztec-packages.yml +++ b/.github/workflows/publish-aztec-packages.yml @@ -170,7 +170,7 @@ jobs: build-cli-wallet-x86, build-cli-wallet-arm, ] - runs-on: ${{ github.actor }}-x86 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: diff --git a/yarn-project/ethereum/src/l1_reader.ts b/yarn-project/ethereum/src/l1_reader.ts index 3155e35a040..251f57ad1a5 100644 --- a/yarn-project/ethereum/src/l1_reader.ts +++ b/yarn-project/ethereum/src/l1_reader.ts @@ -1,4 +1,4 @@ -import { type ConfigMappingsType } from '@aztec/foundation/config'; +import { type ConfigMappingsType, numberConfigHelper } from '@aztec/foundation/config'; import { type L1ContractAddresses, l1ContractAddressesMapping } from './l1_contract_addresses.js'; @@ -19,6 +19,10 @@ export interface L1ReaderConfig { * The deployed l1 contract addresses */ l1Contracts: L1ContractAddresses; + /** + * The polling interval viem uses in ms + */ + viemPollingIntervalMS: number; } export const l1ReaderConfigMappings: ConfigMappingsType = { @@ -37,4 +41,9 @@ export const l1ReaderConfigMappings: ConfigMappingsType = { description: 'The deployed L1 contract addresses', defaultValue: l1ContractAddressesMapping, }, + viemPollingIntervalMS: { + env: 'L1_READER_VIEM_POLLING_INTERVAL_MS', + description: 'The polling interval viem uses in ms', + ...numberConfigHelper(1_000), + }, }; diff --git a/yarn-project/foundation/src/config/env_var.ts b/yarn-project/foundation/src/config/env_var.ts index 7a0bc86efe2..50f3157484d 100644 --- a/yarn-project/foundation/src/config/env_var.ts +++ b/yarn-project/foundation/src/config/env_var.ts @@ -130,4 +130,8 @@ export type EnvVar = | 'VERSION' | 'WS_BLOCK_CHECK_INTERVAL_MS' | 'WS_L2_BLOCK_QUEUE_SIZE' - | 'WS_PROVEN_BLOCKS_ONLY'; + | 'WS_PROVEN_BLOCKS_ONLY' + | 'VERIFIER_VIEM_POLLING_INTERVAL_MS' + | 'L1_READER_VIEM_POLLING_INTERVAL_MS' + | 'PROVER_VIEM_POLLING_INTERVAL_MS' + | 'SEQ_VIEM_POLLING_INTERVAL_MS'; diff --git a/yarn-project/proof-verifier/src/config.ts b/yarn-project/proof-verifier/src/config.ts index fcedde43e4c..a312bbddd59 100644 --- a/yarn-project/proof-verifier/src/config.ts +++ b/yarn-project/proof-verifier/src/config.ts @@ -24,6 +24,8 @@ export type ProofVerifierConfig = { bbWorkingDirectory: string; /** Whether to skip cleanup of bb temporary files */ bbSkipCleanup: boolean; + /** The polling interval viem uses in ms */ + viemPollingIntervalMS: number; } & TelemetryClientConfig; export const proofVerifierConfigMappings: ConfigMappingsType = { @@ -66,6 +68,11 @@ export const proofVerifierConfigMappings: ConfigMappingsType { diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index 9720142c5a8..a5963824a7d 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -152,7 +152,7 @@ export class L1Publisher { this.publicClient = createPublicClient({ chain: chain.chainInfo, transport: http(chain.rpcUrl), - pollingInterval: 10_000, + pollingInterval: config.viemPollingIntervalMS, }); this.rollupContract = getContract({ From 5825334f957a2e456004c53a0eca1e9e3a5e5aca Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 3 Oct 2024 12:32:03 +0000 Subject: [PATCH 3/7] undo testing changes --- docker-compose.provernet.yml | 40 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/docker-compose.provernet.yml b/docker-compose.provernet.yml index 7b3fcb05e24..693b2d1e678 100644 --- a/docker-compose.provernet.yml +++ b/docker-compose.provernet.yml @@ -22,8 +22,9 @@ services: L1_CHAIN_ID: 31337 AZTEC_PORT: 80 DEPLOY_AZTEC_CONTRACTS: 1 - ARCHIVER_POLLING_INTERVAL_MS: 10000 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 10000 + ARCHIVER_POLLING_INTERVAL_MS: 1000 + ARCHIVER_VIEM_POLLING_INTERVAL_MS: 1000 + SEQ_VIEM_POLLING_INTERVAL_MS: 1000 SEQ_MAX_TX_PER_BLOCK: 4 SEQ_MIN_TX_PER_BLOCK: 1 SEQ_MAX_SECONDS_BETWEEN_BLOCKS: 3600 @@ -36,17 +37,13 @@ services: volumes: - ./log/aztec-node/:/usr/src/yarn-project/aztec/log:rw healthcheck: - test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] + test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] interval: 3s timeout: 30s start_period: 120s depends_on: - ethereum - entrypoint: - - "node" - - "--no-warnings" - - "--inspect=0.0.0.0:9221" - - "/usr/src/yarn-project/aztec/dest/bin/index.js" + command: - "start" - "--node" - "--archiver" @@ -69,18 +66,13 @@ services: PROVER_COORDINATION_NODE_URL: http://aztec-node L1_CHAIN_ID: 31337 AZTEC_PORT: 80 - ARCHIVER_POLLING_INTERVAL_MS: 10000 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 10000 + ARCHIVER_POLLING_INTERVAL_MS: 1000 + ARCHIVER_VIEM_POLLING_INTERVAL_MS: 1000 + PROVER_VIEM_POLLING_INTERVAL_MS: 1000 PROVER_AGENT_ENABLED: false PROVER_PUBLISHER_PRIVATE_KEY: "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97" PROVER_REAL_PROOFS: "${PROVER_REAL_PROOFS:-false}" - ASSUME_PROVEN_THROUGH_BLOCK_NUMBER: "${ASSUME_PROVEN_THROUGH_BLOCK_NUMBER:-4000}" - ROLLUP_CONTRACT_ADDRESS: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 - REGISTRY_CONTRACT_ADDRESS: 0x5fbdb2315678afecb367f032d93f642f64180aa3 - INBOX_CONTRACT_ADDRESS: 0xb1ede3f5ac8654124cb5124adf0fd3885cbdd1f7 - OUTBOX_CONTRACT_ADDRESS: 0xa6d6d7c556ce6ada136ba32dbe530993f128ca44 - FEE_JUICE_CONTRACT_ADDRESS: 0xe7f1725e7734ce288f8367e1bb143e90bb3f0512 - FEE_JUICE_PORTAL_CONTRACT_ADDRESS: 0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0 + ASSUME_PROVEN_THROUGH_BLOCK_NUMBER: "${ASSUME_PROVEN_THROUGH_BLOCK_NUMBER:-4}" volumes: - ./log/aztec-prover/:/usr/src/yarn-project/aztec/log:rw @@ -88,11 +80,11 @@ services: aztec-node: condition: service_healthy healthcheck: - test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] + test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] interval: 3s timeout: 30s start_period: 10s - command: ["start", "--prover-node", "--archiver"] + command: [ "start", "--prover-node", "--archiver" ] restart: on-failure:5 # Prover agent that connects to the prover-node for fetching proving jobs and executing them @@ -111,8 +103,6 @@ services: PROVER_TEST_DELAY_MS: "${PROVER_TEST_DELAY_MS:-0}" PROVER_AGENT_CONCURRENCY: 2 BB_SKIP_CLEANUP: "${BB_SKIP_CLEANUP:-0}" # Persist tmp dirs for debugging - ARCHIVER_POLLING_INTERVAL_MS: 10000 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 10000 volumes: - ./log/aztec-prover-agent/:/usr/src/yarn-project/aztec/log:rw - ./cache/bb-crs/:/root/.bb-crs:rw @@ -120,10 +110,10 @@ services: depends_on: aztec-prover: condition: service_healthy - command: ["start", "--prover"] + command: [ "start", "--prover" ] restart: on-failure:5 healthcheck: - test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] + test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] interval: 3s timeout: 30s start_period: 20s @@ -157,12 +147,12 @@ services: aztec-node: condition: service_healthy healthcheck: - test: ["CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status"] + test: [ "CMD", "curl", "-fSs", "http://127.0.0.1:$AZTEC_PORT/status" ] interval: 3s timeout: 30s start_period: 10s restart: on-failure:5 - command: ["start", "--bot", "--pxe"] + command: [ "start", "--bot", "--pxe" ] # Simple watcher that logs the latest block numbers every few seconds using the CLI and the bot's PXE aztec-block-watcher: From 5dec65a09ac59ad914059fa422b8ded13e64f3d8 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 3 Oct 2024 12:38:37 +0000 Subject: [PATCH 4/7] add more interval configs --- yarn-project/archiver/src/archiver/archiver.ts | 5 ----- yarn-project/archiver/src/archiver/config.ts | 10 +++++----- yarn-project/aztec/terraform/node/main.tf | 8 ++++++++ yarn-project/aztec/terraform/prover-node/main.tf | 2 ++ yarn-project/proof-verifier/src/proof_verifier.ts | 1 - yarn-project/sequencer-client/src/config.ts | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index a3a195c6053..cccef6420c9 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -68,8 +68,6 @@ import { ArchiverInstrumentation } from './instrumentation.js'; import { type DataRetrieval } from './structs/data_retrieval.js'; import { type L1Published } from './structs/published.js'; -const logger = createDebugLogger('aztec:archiver:static'); - /** * Helper interface to combine all sources this archiver implementation provides. */ @@ -143,9 +141,6 @@ export class Archiver implements ArchiveSource { telemetry: TelemetryClient, blockUntilSynced = true, ): Promise { - logger.info('createAndSync'); - logger.info(`viem interval: ${config.viemPollingIntervalMS}`); - logger.info(`archiver interval: ${config.archiverPollingIntervalMS}`); const chain = createEthereumChain(config.l1RpcUrl, config.l1ChainId); const publicClient = createPublicClient({ chain: chain.chainInfo, diff --git a/yarn-project/archiver/src/archiver/config.ts b/yarn-project/archiver/src/archiver/config.ts index f4ec61d3106..0412ddd7aa2 100644 --- a/yarn-project/archiver/src/archiver/config.ts +++ b/yarn-project/archiver/src/archiver/config.ts @@ -52,11 +52,6 @@ export const archiverConfigMappings: ConfigMappingsType = { description: 'The polling interval in ms for retrieving new L2 blocks and encrypted logs.', ...numberConfigHelper(1000), }, - viemPollingIntervalMS: { - env: 'ARCHIVER_VIEM_POLLING_INTERVAL_MS', - description: 'The polling interval viem uses in ms', - ...numberConfigHelper(1000), - }, dataDirectory: { env: 'DATA_DIRECTORY', description: 'Optional dir to store data. If omitted will store in memory.', @@ -67,6 +62,11 @@ export const archiverConfigMappings: ConfigMappingsType = { ...numberConfigHelper(1_000), }, ...l1ReaderConfigMappings, + viemPollingIntervalMS: { + env: 'ARCHIVER_VIEM_POLLING_INTERVAL_MS', + description: 'The polling interval viem uses in ms', + ...numberConfigHelper(1000), + }, }; /** diff --git a/yarn-project/aztec/terraform/node/main.tf b/yarn-project/aztec/terraform/node/main.tf index 33fa008ae82..f419a3568a7 100644 --- a/yarn-project/aztec/terraform/node/main.tf +++ b/yarn-project/aztec/terraform/node/main.tf @@ -268,6 +268,14 @@ resource "aws_ecs_task_definition" "aztec-node" { name = "ARCHIVER_POLLING_INTERVAL_MS" value = "10000" }, + { + name = "ARCHIVER_VIEM_POLLING_INTERVAL_MS" + value = "10000" + }, + { + name = "SEQ_VIEM_POLLING_INTERVAL_MS" + value = "10000" + }, { name = "SEQ_RETRY_INTERVAL" value = "10000" diff --git a/yarn-project/aztec/terraform/prover-node/main.tf b/yarn-project/aztec/terraform/prover-node/main.tf index e98b0466e4e..45bdfcb0be8 100644 --- a/yarn-project/aztec/terraform/prover-node/main.tf +++ b/yarn-project/aztec/terraform/prover-node/main.tf @@ -250,6 +250,8 @@ resource "aws_ecs_task_definition" "aztec-prover-node" { // Archiver { name = "ARCHIVER_POLLING_INTERVAL_MS", value = "10000" }, + { name = "ARCHIVER_VIEM_POLLING_INTERVAL_MS", value = "10000" }, + { name = "PROVER_VIEM_POLLING_INTERVAL_MS", value = "10000" }, // Aztec node to pull clientivc proofs from (to be replaced with a p2p connection) { name = "TX_PROVIDER_NODE_URL", value = "http://${var.DEPLOY_TAG}-aztec-node-${count.index + 1}.local/${var.DEPLOY_TAG}/aztec-node-${count.index + 1}/${var.API_KEY}" }, diff --git a/yarn-project/proof-verifier/src/proof_verifier.ts b/yarn-project/proof-verifier/src/proof_verifier.ts index bf968d34a24..2a1bc06267f 100644 --- a/yarn-project/proof-verifier/src/proof_verifier.ts +++ b/yarn-project/proof-verifier/src/proof_verifier.ts @@ -35,7 +35,6 @@ export class ProofVerifier { static async new(config: ProofVerifierConfig, telemetryClient: TelemetryClient): Promise { const logger = createDebugLogger('aztec:block-verifier-bot'); const verifier = await BBCircuitVerifier.new(config, [], logger); - logger.info(`Creating public client for ProofVerifier`); const client = createPublicClient({ chain: createEthereumChain(config.l1Url, config.l1ChainId).chainInfo, transport: http(config.l1Url), diff --git a/yarn-project/sequencer-client/src/config.ts b/yarn-project/sequencer-client/src/config.ts index 3451fe099ed..e69c87d898b 100644 --- a/yarn-project/sequencer-client/src/config.ts +++ b/yarn-project/sequencer-client/src/config.ts @@ -117,9 +117,9 @@ export const chainConfigMappings: ConfigMappingsType = { export const sequencerClientConfigMappings: ConfigMappingsType = { ...sequencerConfigMappings, + ...l1ReaderConfigMappings, ...getTxSenderConfigMappings('SEQ'), ...getPublisherConfigMappings('SEQ'), - ...l1ReaderConfigMappings, ...chainConfigMappings, }; From 1e901116379308e39f005daf94db3b3d4b6b0789 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 3 Oct 2024 13:15:09 +0000 Subject: [PATCH 5/7] remove resource limit --- docker-compose.provernet.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-compose.provernet.yml b/docker-compose.provernet.yml index 693b2d1e678..968cec3552c 100644 --- a/docker-compose.provernet.yml +++ b/docker-compose.provernet.yml @@ -48,10 +48,6 @@ services: - "--node" - "--archiver" - "--sequencer" - deploy: - resources: - limits: - memory: 800M # Prover node that listens for unproven blocks on L1, and generates and submits block proofs # Requires one or more agents to be connected for actually generating proofs From 9ef5453b7028d0104801b1b002e0fa4499617756 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 3 Oct 2024 13:16:38 +0000 Subject: [PATCH 6/7] undo block watcher change --- docker-compose.provernet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.provernet.yml b/docker-compose.provernet.yml index 968cec3552c..d6ae0e57498 100644 --- a/docker-compose.provernet.yml +++ b/docker-compose.provernet.yml @@ -152,14 +152,14 @@ services: # Simple watcher that logs the latest block numbers every few seconds using the CLI and the bot's PXE aztec-block-watcher: - image: "aztecprotocol/aztec:master" + image: "aztecprotocol/${IMAGE:-aztec:master}" environment: ETHEREUM_HOST: http://ethereum:8545 L1_CHAIN_ID: 31337 depends_on: aztec-bot: condition: service_healthy - entrypoint: "/bin/bash -c" + entrypoint: '/bin/bash -c' command: > 'while true; do node --no-warnings ./node_modules/.bin/aztec block-number -u http://aztec-bot | head -n2; sleep 10; done' restart: on-failure:5 From fb19a6260058e915d1a83e3fdd2a86c274a799df Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 3 Oct 2024 14:27:32 +0000 Subject: [PATCH 7/7] fix test configs --- .../end-to-end/src/composed/integration_l1_publisher.test.ts | 1 + yarn-project/end-to-end/src/e2e_synching.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts index 691d0c3aae6..2b935d32183 100644 --- a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts @@ -166,6 +166,7 @@ describe('L1Publisher integration', () => { publisherPrivateKey: sequencerPK, l1PublishRetryIntervalMS: 100, l1ChainId: 31337, + viemPollingIntervalMS: 100, }, new NoopTelemetryClient(), ); diff --git a/yarn-project/end-to-end/src/e2e_synching.test.ts b/yarn-project/end-to-end/src/e2e_synching.test.ts index 18b1f7b4285..7048b7be8c1 100644 --- a/yarn-project/end-to-end/src/e2e_synching.test.ts +++ b/yarn-project/end-to-end/src/e2e_synching.test.ts @@ -412,6 +412,7 @@ describe('e2e_synching', () => { publisherPrivateKey: sequencerPK, l1PublishRetryIntervalMS: 100, l1ChainId: 31337, + viemPollingIntervalMS: 100, }, new NoopTelemetryClient(), );