From f38874811fbaad6ddd9bc72a2293616a57f5e9a5 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 3 Mar 2022 15:29:56 -0800 Subject: [PATCH] feat: remove TS BSS from itests + Docker --- .github/workflows/integration.yml | 5 +--- .github/workflows/ts-packages.yml | 10 ------- CONTRIBUTING.md | 2 +- README.md | 1 - ops/Makefile | 4 +-- ops/README.md | 21 -------------- ops/docker-compose-nobuild.yml | 17 +++++------ ops/docker-compose.go-batch-submitter.yml | 19 ------------ ops/docker-compose.ts-batch-submitter.yml | 20 ------------- ops/docker-compose.yml | 19 ++++++++++++ ops/docker/Dockerfile.batch-submitter | 35 ----------------------- ops/docker/Dockerfile.monorepo | 1 - ops/docker/Dockerfile.packages | 7 ----- ops/envs/batches.env | 19 ------------ ops/scripts/batches.sh | 25 ---------------- ops/scripts/build-ci.sh | 1 - 16 files changed, 31 insertions(+), 175 deletions(-) delete mode 100644 ops/docker-compose.go-batch-submitter.yml delete mode 100644 ops/docker-compose.ts-batch-submitter.yml delete mode 100644 ops/docker/Dockerfile.batch-submitter delete mode 100644 ops/envs/batches.env delete mode 100755 ops/scripts/batches.sh diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index cf63567842c9..939301f04501 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,9 +20,6 @@ jobs: - 5000:5000 strategy: matrix: - batch-submitter: - - ts-batch-submitter - - go-batch-submitter batch-type: - zlib - legacy @@ -53,7 +50,7 @@ jobs: working-directory: ./ops run: | ./scripts/stats.sh & - docker-compose -f docker-compose.yml -f docker-compose.${{ matrix.batch-submitter }}.yml up -d + docker-compose -f docker-compose.yml up -d - name: Wait for the Sequencer node working-directory: ./ops diff --git a/.github/workflows/ts-packages.yml b/.github/workflows/ts-packages.yml index 8968fcb73999..4cc40266ce45 100644 --- a/.github/workflows/ts-packages.yml +++ b/.github/workflows/ts-packages.yml @@ -113,12 +113,6 @@ jobs: fail_ci_if_error: false verbose: true flags: core-utils - - uses: codecov/codecov-action@v1 - with: - files: ./packages/batch-submitter/coverage.json - fail_ci_if_error: false - verbose: true - flags: batch-submitter - uses: codecov/codecov-action@v1 with: files: ./packages/data-transport-layer/coverage.json @@ -170,10 +164,6 @@ jobs: # if: steps.yarn-cache.outputs.cache-hit != 'true' run: yarn install - - name: Check packages/batch-submitter - working-directory: ./packages/batch-submitter - run: npx depcheck - - name: Check packages/contracts working-directory: ./packages/contracts run: npx depcheck diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0413bff6c123..5485a08be4d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -116,7 +116,7 @@ This will build the following containers: * [`l2geth`](https://hub.docker.com/r/ethereumoptimism/l2geth): L2 geth node running in Sequencer mode * [`verifier`](https://hub.docker.com/r/ethereumoptimism/go-ethereum): L2 geth node running in Verifier mode * [`relayer`](https://hub.docker.com/r/ethereumoptimism/message-relayer): helper process that relays messages between L1 and L2 -* [`batch_submitter`](https://hub.docker.com/r/ethereumoptimism/batch-submitter): service that submits batches of Sequencer transactions to the L1 chain +* [`batch_submitter`](https://hub.docker.com/r/ethereumoptimism/batch-submitter-service): service that submits batches of Sequencer transactions to the L1 chain * [`integration_tests`](https://hub.docker.com/r/ethereumoptimism/integration-tests): integration tests in a box If you want to make a change to a container, you'll need to take it down and rebuild it. diff --git a/README.md b/README.md index 7c4762153638..d899873cc62c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ root │ ├── core-utils: Low-level utilities that make building Optimism easier │ ├── common-ts: Common tools for building apps in TypeScript │ ├── data-transport-layer: Service for indexing Optimism-related L1 data -│ ├── batch-submitter: Service for submitting batches of transactions and results to L1 │ ├── message-relayer: Tool for automatically relaying L1<>L2 messages in development │ └── replica-healthcheck: Service for monitoring the health of a replica node ├── go diff --git a/ops/Makefile b/ops/Makefile index 4d4dd82503f3..7ff3285bd1b0 100644 --- a/ops/Makefile +++ b/ops/Makefile @@ -1,7 +1,5 @@ -BATCH_SUBMITTER ?= docker-compose.ts-batch-submitter.yml DOCKER_COMPOSE_CMD := docker-compose \ - -f docker-compose.yml \ - -f $(BATCH_SUBMITTER) + -f docker-compose.yml build: DOCKER_BUILDKIT=1 \ diff --git a/ops/README.md b/ops/README.md index 90c175577d05..d3b46276d625 100644 --- a/ops/README.md +++ b/ops/README.md @@ -26,7 +26,6 @@ The base stack can be started and stopped with a command like this: ``` docker-compose \ -f docker-compose.yml \ - -f docker-compose.ts-batch-submitter.yml \ up --build --detach ``` @@ -40,7 +39,6 @@ To start the stack with monitoring enabled, just add the metric composition file ``` docker-compose \ -f docker-compose.yml \ - -f docker-compose.ts-batch-submitter.yml \ -f docker-compose-metrics.yml \ up --build --detach ``` @@ -50,7 +48,6 @@ Optionally, run a verifier along the rest of the stack. Run a replica with the s ``` docker-compose -f docker-compose.yml \ - -f docker-compose.ts-batch-submitter.yml \ up --scale \ verifier=1 \ --build --detach @@ -71,24 +68,6 @@ Fees can be turned off at runtime by setting the environment variable ROLLUP_ENFORCE_FEES=false docker-compose up ``` -## Using the Go Batch Submitter - -The existing Typescript batch submitter is in the process of being reimplemented -in Go. During this transition, the user is required to specify which batch -submitter to use with docker-compose. - -The commands above all use the Typescript batch submitter, by specifying -`-f docker-compose.ts-batch-submitter.yml`. This can be swapped out for the go -batch submitter by supplying `-f docker-compose.go-batch-submitter.yml` instead. - -Additionally, the `make` targets assume the use of the Typescript batch -submitter. This can be overridden by setting the `BATCH_SUBMITTER` environment -variable, e.g. `BATCH_SUBMITTER=docker-compose.go-batch-submitter.yml make up`. - -Once the transition is complete, specifying the desired batch submitter will be -obsolete, and the Go batch submitter will be selected by default from the -`docker-compose.yml` file and `Makefile`. - ## Cross domain communication By default, the `message-relayer` service is turned off. This means that diff --git a/ops/docker-compose-nobuild.yml b/ops/docker-compose-nobuild.yml index 128d706706c4..3988f589fda4 100644 --- a/ops/docker-compose-nobuild.yml +++ b/ops/docker-compose-nobuild.yml @@ -85,16 +85,17 @@ services: - l1_chain - deployer - l2geth - image: ethereumoptimism/batch-submitter:${DOCKER_TAG:-prerelease-0.5.0-rc-7-ee217ce} - entrypoint: ./batches.sh + image: ethereumoptimism/batch-submitter-service:${DOCKER_TAG:-prerelease-0.5.0-rc-7-ee217ce} + entrypoint: ./batch-submitter.sh env_file: - - ./envs/batches.env + - ./envs/batch-submitter.env environment: - L1_NODE_WEB3_URL: http://l1_chain:8545 - L2_NODE_WEB3_URL: http://l2geth:8545 - URL: http://deployer:8081/addresses.json - SEQUENCER_PRIVATE_KEY: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - PROPOSER_PRIVATE_KEY: "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a" + L1_ETH_RPC: http://l1_chain:8545 + L2_ETH_RPC: http://l2geth:8545 + URL: http://deployer:8081/addresses.json + BATCH_SUBMITTER_SEQUENCER_PRIVATE_KEY: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' + BATCH_SUBMITTER_PROPOSER_PRIVATE_KEY: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' + BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE: ${BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE:-zlib} verifier: depends_on: diff --git a/ops/docker-compose.go-batch-submitter.yml b/ops/docker-compose.go-batch-submitter.yml deleted file mode 100644 index ea8f5dfd664c..000000000000 --- a/ops/docker-compose.go-batch-submitter.yml +++ /dev/null @@ -1,19 +0,0 @@ -services: - batch_submitter: - depends_on: - - l1_chain - - deployer - - l2geth - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.batch-submitter-service - entrypoint: ./batch-submitter.sh - env_file: - - ./envs/batch-submitter.env - environment: - L1_ETH_RPC: http://l1_chain:8545 - L2_ETH_RPC: http://l2geth:8545 - URL: http://deployer:8081/addresses.json - BATCH_SUBMITTER_SEQUENCER_PRIVATE_KEY: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' - BATCH_SUBMITTER_PROPOSER_PRIVATE_KEY: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' - BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE: ${BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE:-zlib} diff --git a/ops/docker-compose.ts-batch-submitter.yml b/ops/docker-compose.ts-batch-submitter.yml deleted file mode 100644 index da0b3b7e9c47..000000000000 --- a/ops/docker-compose.ts-batch-submitter.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - batch_submitter: - depends_on: - - l1_chain - - deployer - - l2geth - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.packages - target: batch-submitter - entrypoint: ./batches.sh - env_file: - - ./envs/batches.env - environment: - L1_NODE_WEB3_URL: http://l1_chain:8545 - L2_NODE_WEB3_URL: http://l2geth:8545 - URL: http://deployer:8081/addresses.json - SEQUENCER_PRIVATE_KEY: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' - PROPOSER_PRIVATE_KEY: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' - BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE: ${BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE:-zlib} diff --git a/ops/docker-compose.yml b/ops/docker-compose.yml index 03469de8a262..2e40b3bd8b04 100644 --- a/ops/docker-compose.yml +++ b/ops/docker-compose.yml @@ -212,3 +212,22 @@ services: GAS_PRICE_ORACLE_ETHEREUM_HTTP_URL: http://l2geth:8545 # Default hardhat account 5 GAS_PRICE_ORACLE_PRIVATE_KEY: '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba' + + batch_submitter: + depends_on: + - l1_chain + - deployer + - l2geth + build: + context: .. + dockerfile: ./ops/docker/Dockerfile.batch-submitter-service + entrypoint: ./batch-submitter.sh + env_file: + - ./envs/batch-submitter.env + environment: + L1_ETH_RPC: http://l1_chain:8545 + L2_ETH_RPC: http://l2geth:8545 + URL: http://deployer:8081/addresses.json + BATCH_SUBMITTER_SEQUENCER_PRIVATE_KEY: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' + BATCH_SUBMITTER_PROPOSER_PRIVATE_KEY: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' + BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE: ${BATCH_SUBMITTER_SEQUENCER_BATCH_TYPE:-zlib} diff --git a/ops/docker/Dockerfile.batch-submitter b/ops/docker/Dockerfile.batch-submitter deleted file mode 100644 index a0b84461c584..000000000000 --- a/ops/docker/Dockerfile.batch-submitter +++ /dev/null @@ -1,35 +0,0 @@ -ARG LOCAL_REGISTRY=docker.io -ARG BUILDER_TAG=latest -FROM ${LOCAL_REGISTRY}/ethereumoptimism/builder:${BUILDER_TAG} AS builder - -FROM node:16-alpine - -RUN apk add --no-cache curl bash jq - -WORKDIR /opt/optimism - -# copy top level files -COPY --from=builder /optimism/*.json /optimism/yarn.lock ./ -COPY --from=builder /optimism/node_modules ./node_modules - -# copy deps (would have been nice if docker followed the symlinks required) -COPY --from=builder /optimism/packages/core-utils/package.json ./packages/core-utils/package.json -COPY --from=builder /optimism/packages/core-utils/dist ./packages/core-utils/dist -COPY --from=builder /optimism/packages/common-ts/package.json ./packages/common-ts/package.json -COPY --from=builder /optimism/packages/common-ts/dist ./packages/common-ts/dist - -COPY --from=builder /optimism/packages/contracts/package.json ./packages/contracts/package.json -COPY --from=builder /optimism/packages/contracts/deployments ./packages/contracts/deployments -COPY --from=builder /optimism/packages/contracts/dist ./packages/contracts/dist -COPY --from=builder /optimism/packages/contracts/artifacts ./packages/contracts/artifacts - -# copy the service -WORKDIR /opt/optimism/packages/batch-submitter -COPY --from=builder /optimism/packages/batch-submitter/package.json ./ -COPY --from=builder /optimism/packages/batch-submitter/dist ./dist -COPY --from=builder /optimism/packages/batch-submitter/exec ./exec -COPY --from=builder /optimism/packages/batch-submitter/node_modules ./node_modules - -# copy this over in case you want to run alongside other services -COPY ./ops/scripts/batches.sh . -ENTRYPOINT ["npm", "run", "start"] diff --git a/ops/docker/Dockerfile.monorepo b/ops/docker/Dockerfile.monorepo index 63762076ada8..e3b07a6a27df 100644 --- a/ops/docker/Dockerfile.monorepo +++ b/ops/docker/Dockerfile.monorepo @@ -29,7 +29,6 @@ COPY packages/core-utils/package.json ./packages/core-utils/package.json COPY packages/common-ts/package.json ./packages/common-ts/package.json COPY packages/contracts/package.json ./packages/contracts/package.json COPY packages/data-transport-layer/package.json ./packages/data-transport-layer/package.json -COPY packages/batch-submitter/package.json ./packages/batch-submitter/package.json COPY packages/message-relayer/package.json ./packages/message-relayer/package.json COPY packages/replica-healthcheck/package.json ./packages/replica-healthcheck/package.json COPY integration-tests/package.json ./integration-tests/package.json diff --git a/ops/docker/Dockerfile.packages b/ops/docker/Dockerfile.packages index 119f94f046a0..e06cb37949b0 100644 --- a/ops/docker/Dockerfile.packages +++ b/ops/docker/Dockerfile.packages @@ -18,7 +18,6 @@ COPY packages/core-utils/package.json ./packages/core-utils/package.json COPY packages/common-ts/package.json ./packages/common-ts/package.json COPY packages/contracts/package.json ./packages/contracts/package.json COPY packages/data-transport-layer/package.json ./packages/data-transport-layer/package.json -COPY packages/batch-submitter/package.json ./packages/batch-submitter/package.json COPY packages/message-relayer/package.json ./packages/message-relayer/package.json COPY packages/replica-healthcheck/package.json ./packages/replica-healthcheck/package.json COPY integration-tests/package.json ./integration-tests/package.json @@ -38,12 +37,6 @@ COPY ./ops/scripts/deployer.sh . CMD ["yarn", "run", "deploy"] -FROM base as batch-submitter -WORKDIR /opt/optimism/packages/batch-submitter -COPY ./ops/scripts/batches.sh . -CMD ["npm", "run", "start"] - - FROM base as data-transport-layer WORKDIR /opt/optimism/packages/data-transport-layer COPY ./ops/scripts/dtl.sh . diff --git a/ops/envs/batches.env b/ops/envs/batches.env deleted file mode 100644 index 13017d3e6f7e..000000000000 --- a/ops/envs/batches.env +++ /dev/null @@ -1,19 +0,0 @@ -ADDRESS_MANAGER_ADDRESS= - -DEBUG=info*,error*,warn*,debug* - -MAX_L1_TX_SIZE=90000 -MIN_L1_TX_SIZE=32 -MAX_TX_BATCH_COUNT=50 -MAX_STATE_BATCH_COUNT=50 - -POLL_INTERVAL=500 -NUM_CONFIRMATIONS=0 -RESUBMISSION_TIMEOUT=1 -FINALITY_CONFIRMATIONS=0 -RUN_TX_BATCH_SUBMITTER=true -RUN_STATE_BATCH_SUBMITTER=true -MAX_BATCH_SUBMISSION_TIME=0 -SAFE_MINIMUM_ETHER_BALANCE=0 -CLEAR_PENDING_TXS=false -RETRIES=80 diff --git a/ops/scripts/batches.sh b/ops/scripts/batches.sh deleted file mode 100755 index 09c77db93c5c..000000000000 --- a/ops/scripts/batches.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -e - -RETRIES=${RETRIES:-40} - -if [[ ! -z "$URL" ]]; then - # get the addrs from the URL provided - ADDRESSES=$(curl --fail --show-error --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) - # set the env - export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager') -fi - -# waits for l2geth to be up -curl --fail \ - --show-error \ - --silent \ - --retry-connrefused \ - --retry $RETRIES \ - --retry-delay 1 \ - --output /dev/null \ - $L2_NODE_WEB3_URL - -# go -exec node ./exec/run-batch-submitter.js diff --git a/ops/scripts/build-ci.sh b/ops/scripts/build-ci.sh index db85d1e80ec9..682f29450730 100755 --- a/ops/scripts/build-ci.sh +++ b/ops/scripts/build-ci.sh @@ -43,7 +43,6 @@ docker tag localhost:5000/ethereumoptimism/builder:latest ethereumoptimism/build build deployer "ethereumoptimism/deployer:latest" "./ops/docker/Dockerfile.deployer" . build dtl "ethereumoptimism/data-transport-layer:latest" "./ops/docker/Dockerfile.data-transport-layer" . -build batch_submitter "ethereumoptimism/batch-submitter:latest" "./ops/docker/Dockerfile.batch-submitter" . build relayer "ethereumoptimism/message-relayer:latest" "./ops/docker/Dockerfile.message-relayer" . build integration-tests "ethereumoptimism/integration-tests:latest" "./ops/docker/Dockerfile.integration-tests" .