diff --git a/.circleci/config.yml b/.circleci/config.yml index 775561b3d6cd..dfd82cf4be67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,7 +92,6 @@ jobs: - "packages/drippie-mon/node_modules" - "packages/fault-detector/node_modules" - "packages/hardhat-deploy-config/node_modules" - - "packages/message-relayer/node_modules" - "packages/migration-data/node_modules" - "packages/replica-healthcheck/node_modules" - "packages/sdk/node_modules" @@ -1201,13 +1200,6 @@ workflows: dependencies: "(common-ts|contracts|core-utils|sdk)" requires: - yarn-monorepo - - js-lint-test: - name: message-relayer-tests - coverage_flag: message-relayer-tests - package_name: message-relayer - dependencies: "(common-ts|core-utils|sdk)" - requires: - - yarn-monorepo - js-lint-test: name: replica-healthcheck-tests coverage_flag: replica-healthcheck-tests diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c1f10ee15c2d..fb9552bda34a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,7 +10,6 @@ /packages/chain-mon @smartcontracts /packages/fault-detector @ethereum-optimism/devxpod /packages/hardhat-deploy-config @ethereum-optimism/legacy-reviewers -/packages/message-relayer @ethereum-optimism/legacy-reviewers /packages/migration-data @ethereum-optimism/legacy-reviewers /packages/replica-healthcheck @ethereum-optimism/legacy-reviewers /packages/sdk @ethereum-optimism/devxpod diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml index 165e1b9c05e0..45f6b48cb8da 100644 --- a/.github/workflows/publish-canary.yml +++ b/.github/workflows/publish-canary.yml @@ -16,7 +16,6 @@ jobs: # map the step outputs to job outputs outputs: l2geth: ${{ steps.packages.outputs.l2geth }} - message-relayer: ${{ steps.packages.outputs.message-relayer }} fault-detector: ${{ steps.packages.outputs.fault-detector }} balance-mon: ${{ steps.packages.outputs.balance-mon }} drippie-mon: ${{ steps.packages.outputs.drippie-mon }} @@ -149,33 +148,6 @@ jobs: push: true tags: ethereumoptimism/hardhat-node:${{ needs.canary-publish.outputs.canary-docker-tag }} - message-relayer: - name: Publish Message Relayer Version ${{ needs.canary-publish.outputs.canary-docker-tag }} - needs: canary-publish - if: needs.canary-publish.outputs.message-relayer != '' - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} - password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./ops/docker/Dockerfile.packages - target: message-relayer - push: true - tags: ethereumoptimism/message-relayer:${{ needs.canary-publish.outputs.canary-docker-tag }} - fault-detector: name: Publish Fault Detector Version ${{ needs.canary-publish.outputs.canary-docker-tag }} needs: canary-publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad8e67cc4899..3b0872a6912d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,6 @@ jobs: # map the step outputs to job outputs outputs: l2geth: ${{ steps.packages.outputs.l2geth }} - message-relayer: ${{ steps.packages.outputs.message-relayer }} fault-detector: ${{ steps.packages.outputs.fault-detector }} balance-mon: ${{ steps.packages.outputs.drippie-mon }} drippie-mon: ${{ steps.packages.outputs.drippie-mon }} @@ -198,33 +197,6 @@ jobs: GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} GITVERSION=${{ steps.build_args.outputs.GITVERSION }} - message-relayer: - name: Publish Message Relayer Version ${{ needs.release.outputs.message-relayer }} - needs: release - if: needs.release.outputs.message-relayer != '' - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} - password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./ops/docker/Dockerfile.packages - target: message-relayer - push: true - tags: ethereumoptimism/message-relayer:${{ needs.release.outputs.message-relayer }},ethereumoptimism/message-relayer:latest - fault-detector: name: Publish Fault Detector Version ${{ needs.release.outputs.fault-detector }} needs: release diff --git a/.vscode/settings.json b/.vscode/settings.json index 08080815ac54..bcc8b1183b07 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -28,10 +28,6 @@ "directory": "packages/chain-mon", "changeProcessCWD": true }, - { - "directory": "packages/message-relayer", - "changeProcessCWD": true - }, { "directory": "packages/fault-detector", "changeProcessCWD": true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6b91893166f..b9d169d868e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,7 +127,6 @@ This will build the following containers: * [`dtl`](https://hub.docker.com/r/ethereumoptimism/data-transport-layer): service that indexes transaction data from the L1 chain * [`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 If you want to make a change to a container, you'll need to take it down and rebuild it. For example, if you make a change in l2geth: diff --git a/README.md b/README.md index 39bc0cec2552..0c0335f63a65 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,6 @@ Refer to the Directory Structure section below to understand which packages are │ ├── data-transport-layer: Service for indexing Optimism-related L1 data │ ├── chain-mon: Chain monitoring services │ ├── fault-detector: Service for detecting Sequencer faults -│ ├── message-relayer: Tool for automatically relaying L1<>L2 messages in development │ ├── replica-healthcheck: Service for monitoring the health of a replica node │ └── sdk: provides a set of tools for interacting with Optimism ├── op-bindings: Go bindings for Bedrock smart contracts. @@ -86,7 +85,6 @@ Refer to the Directory Structure section below to understand which packages are │ ├── data-transport-layer: Service for indexing Optimism-related L1 data │ ├── chain-mon: Chain monitoring services │ ├── fault-detector: Service for detecting Sequencer faults -│ ├── message-relayer: Tool for automatically relaying L1<>L2 messages in development │ ├── replica-healthcheck: Service for monitoring the health of a replica node │ └── sdk: provides a set of tools for interacting with Optimism ├── indexer: indexes and syncs transactions diff --git a/codecov.yml b/codecov.yml index e65eccc3523a..7f4ae79be789 100644 --- a/codecov.yml +++ b/codecov.yml @@ -39,6 +39,5 @@ flag_management: - name: dtl-tests - name: chain-mon-tests - name: fault-detector-tests - - name: message-relayer-tests - name: replica-healthcheck-tests - name: sdk-tests diff --git a/ops/docker-compose.yml b/ops/docker-compose.yml deleted file mode 100644 index 3a7523c79cc9..000000000000 --- a/ops/docker-compose.yml +++ /dev/null @@ -1,208 +0,0 @@ -version: '3.4' - -x-system-addr-env: &system-addr-env - # private key: a6aecc98b63bafb0de3b29ae9964b14acb4086057808be29f90150214ebd4a0f - # OK to publish this since it will only ever be used in itests - SYSTEM_ADDRESS_0_DEPLOYER: '0xa961b0d6dce82db098cf70a42a14add3ee3db2d5' - - # private key: 3b8d2345102cce2443acb240db6e87c8edd4bb3f821b17fab8ea2c9da08ea132 - # OK to publish this since it will only ever be used in itests - SYSTEM_ADDRESS_1_DEPLOYER: '0xdfc82d475833a50de90c642770f34a9db7deb725' - -services: - # this is a helper service used because there's no official hardhat image - l1_chain: - image: ethereumoptimism/hardhat-node:${DOCKER_TAG_HARDHAT:-latest} - build: - context: ./docker/hardhat - dockerfile: Dockerfile - env_file: - - ./envs/l1_chain.env - ports: - # expose the service to the host for integration testing - - ${L1CHAIN_HTTP_PORT:-9545}:8545 - - deployer: - depends_on: - - l1_chain - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.packages - target: deployer - image: ethereumoptimism/deployer:${DOCKER_TAG_DEPLOYER:-latest} - entrypoint: ./deployer.sh - environment: - # Env vars for the deployment script. - CONTRACTS_RPC_URL: http://l1_chain:8545 - CONTRACTS_DEPLOYER_KEY: 'ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' - CONTRACTS_TARGET_NETWORK: 'local' - ports: - # expose the service to the host for getting the contract addrs - - ${DEPLOYER_PORT:-8080}:8081 - - dtl: - depends_on: - - l1_chain - - deployer - - l2geth - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.packages - target: data-transport-layer - image: ethereumoptimism/data-transport-layer:${DOCKER_TAG_DATA_TRANSPORT_LAYER:-latest} - # override with the dtl script and the env vars required for it - entrypoint: ./dtl.sh - env_file: - - ./envs/dtl.env - # set the rest of the env vars for the network whcih do not - # depend on the docker-compose setup - environment: - # used for setting the address manager address - URL: http://deployer:8081/addresses.json - # connect to the 2 layers - DATA_TRANSPORT_LAYER__L1_RPC_ENDPOINT: http://l1_chain:8545 - DATA_TRANSPORT_LAYER__L2_RPC_ENDPOINT: http://l2geth:8545 - DATA_TRANSPORT_LAYER__SYNC_FROM_L2: 'true' - DATA_TRANSPORT_LAYER__L2_CHAIN_ID: 17 - ports: - - ${DTL_PORT:-7878}:7878 - - l2geth: - depends_on: - - l1_chain - - deployer - build: - context: .. - dockerfile: ./l2geth/Dockerfile - image: ethereumoptimism/l2geth:${DOCKER_TAG_L2GETH:-latest} - # override with the geth script and the env vars required for it - entrypoint: sh ./geth.sh - env_file: - - ./envs/geth.env - environment: - <<: *system-addr-env - ETH1_HTTP: http://l1_chain:8545 - ROLLUP_TIMESTAMP_REFRESH: 5s - ROLLUP_STATE_DUMP_PATH: http://deployer:8081/state-dump.latest.json - # connecting to the DTL - ROLLUP_CLIENT_HTTP: http://dtl:7878 - ETH1_CTC_DEPLOYMENT_HEIGHT: 8 - RETRIES: 60 - # no need to keep this secret, only used internally to sign blocks - BLOCK_SIGNER_KEY: '6587ae678cf4fc9a33000cdbf9f35226b71dcc6a4684a31203241f9bcfd55d27' - BLOCK_SIGNER_ADDRESS: '0x00000398232E2064F896018496b4b44b3D62751F' - - ROLLUP_ENFORCE_FEES: ${ROLLUP_ENFORCE_FEES:-true} - ROLLUP_FEE_THRESHOLD_DOWN: 0.9 - ROLLUP_FEE_THRESHOLD_UP: 1.1 - ports: - - ${L2GETH_HTTP_PORT:-8545}:8545 - - ${L2GETH_WS_PORT:-8546}:8546 - - relayer: - depends_on: - - l1_chain - - l2geth - deploy: - replicas: 0 - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.packages - target: message-relayer - image: ethereumoptimism/message-relayer:${DOCKER_TAG_MESSAGE_RELAYER:-latest} - entrypoint: ./relayer.sh - environment: - MESSAGE_RELAYER__L1_RPC_PROVIDER: http://l1_chain:8545 - MESSAGE_RELAYER__L2_RPC_PROVIDER: http://l2geth:8545 - MESSAGE_RELAYER__L1_WALLET: '0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97' - RETRIES: 60 - - fault_detector: - depends_on: - - l1_chain - - l2geth - deploy: - replicas: 0 - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.packages - target: fault-detector - image: ethereumoptimism/fault-detector:${DOCKER_TAG_FAULT_DETECTOR:-latest} - entrypoint: ./detector.sh - environment: - FAULT_DETECTOR__L1_RPC_PROVIDER: http://l1_chain:8545 - FAULT_DETECTOR__L2_RPC_PROVIDER: http://l2geth:8545 - RETRIES: 60 - - verifier: - depends_on: - - l1_chain - - deployer - - dtl - - l2geth - deploy: - replicas: 1 - build: - context: .. - dockerfile: ./l2geth/Dockerfile - image: ethereumoptimism/l2geth:${DOCKER_TAG_L2GETH:-latest} - entrypoint: sh ./geth.sh - env_file: - - ./envs/geth.env - environment: - <<: *system-addr-env - ETH1_HTTP: http://l1_chain:8545 - SEQUENCER_CLIENT_HTTP: http://l2geth:8545 - ROLLUP_STATE_DUMP_PATH: http://deployer:8081/state-dump.latest.json - ROLLUP_CLIENT_HTTP: http://dtl:7878 - ROLLUP_BACKEND: 'l1' - ETH1_CTC_DEPLOYMENT_HEIGHT: 8 - RETRIES: 60 - ROLLUP_VERIFIER_ENABLE: 'true' - ports: - - ${VERIFIER_HTTP_PORT:-8547}:8545 - - ${VERIFIER_WS_PORT:-8548}:8546 - - replica: - depends_on: - - dtl - - l2geth - deploy: - replicas: 1 - build: - context: .. - dockerfile: ./l2geth/Dockerfile - image: ethereumoptimism/l2geth:${DOCKER_TAG_L2GETH:-latest} - entrypoint: sh ./geth.sh - env_file: - - ./envs/geth.env - environment: - <<: *system-addr-env - ETH1_HTTP: http://l1_chain:8545 - SEQUENCER_CLIENT_HTTP: http://l2geth:8545 - ROLLUP_STATE_DUMP_PATH: http://deployer:8081/state-dump.latest.json - ROLLUP_CLIENT_HTTP: http://dtl:7878 - ROLLUP_BACKEND: 'l2' - ROLLUP_VERIFIER_ENABLE: 'true' - ETH1_CTC_DEPLOYMENT_HEIGHT: 8 - RETRIES: 60 - ports: - - ${REPLICA_HTTP_PORT:-8549}:8545 - - ${REPLICA_WS_PORT:-8550}:8546 - - replica_healthcheck: - depends_on: - - l2geth - - replica - deploy: - replicas: 0 - build: - context: .. - dockerfile: ./ops/docker/Dockerfile.packages - target: replica-healthcheck - image: ethereumoptimism/replica-healthcheck:${DOCKER_TAG_REPLICA_HEALTHCHECK:-latest} - environment: - HEALTHCHECK__REFERENCE_RPC_PROVIDER: http://l2geth:8545 - HEALTHCHECK__TARGET_RPC_PROVIDER: http://replica:8545 - ports: - - ${HEALTHCHECK_HTTP_PORT:-7300}:7300 diff --git a/ops/docker/Dockerfile.packages b/ops/docker/Dockerfile.packages index 71eb84e15dfb..66af971f8c12 100644 --- a/ops/docker/Dockerfile.packages +++ b/ops/docker/Dockerfile.packages @@ -94,12 +94,6 @@ COPY ./ops/scripts/dtl.sh . CMD ["node", "dist/src/services/run.js"] -FROM base as message-relayer -WORKDIR /opt/optimism/packages/message-relayer -COPY ./ops/scripts/relayer.sh . -CMD ["npm", "run", "start"] - - FROM base as fault-detector WORKDIR /opt/optimism/packages/fault-detector COPY ./ops/scripts/detector.sh . diff --git a/packages/message-relayer/.depcheckrc b/packages/message-relayer/.depcheckrc deleted file mode 100644 index 3a691b778839..000000000000 --- a/packages/message-relayer/.depcheckrc +++ /dev/null @@ -1,13 +0,0 @@ -ignores: [ - "@babel/eslint-parser", - "@typescript-eslint/parser", - "eslint-plugin-import", - "eslint-plugin-unicorn", - "eslint-plugin-jsdoc", - "eslint-plugin-prefer-arrow", - "eslint-plugin-react", - "@typescript-eslint/eslint-plugin", - "eslint-config-prettier", - "eslint-plugin-prettier", - "chai" -] diff --git a/packages/message-relayer/.env.example b/packages/message-relayer/.env.example deleted file mode 100644 index 7a7797a43f66..000000000000 --- a/packages/message-relayer/.env.example +++ /dev/null @@ -1,11 +0,0 @@ -# URL pointing to an L1 RPC provider -MESSAGE_RELAYER__L1_RPC_PROVIDER= - -# URL pointing to an L2 RPC provider -MESSAGE_RELAYER__L2_RPC_PROVIDER= - -# Private key for a wallet with ETH on L1 -MESSAGE_RELAYER__L1_WALLET= - -# Optional, L2 block height to start relaying messages from (default is 0) -MESSAGE_RELAYER__FROM_L2_TRANSACTION_INDEX= diff --git a/packages/message-relayer/.eslintrc.js b/packages/message-relayer/.eslintrc.js deleted file mode 100644 index bfd2057be80b..000000000000 --- a/packages/message-relayer/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: '../../.eslintrc.js', -} diff --git a/packages/message-relayer/.lintstagedrc.yml b/packages/message-relayer/.lintstagedrc.yml deleted file mode 100644 index a3035a2299b2..000000000000 --- a/packages/message-relayer/.lintstagedrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -"*.{ts,js}": - - eslint diff --git a/packages/message-relayer/.prettierrc.js b/packages/message-relayer/.prettierrc.js deleted file mode 100644 index 6b3fa8e2ce23..000000000000 --- a/packages/message-relayer/.prettierrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../.prettierrc.js'), -}; \ No newline at end of file diff --git a/packages/message-relayer/CHANGELOG.md b/packages/message-relayer/CHANGELOG.md deleted file mode 100644 index 9cc7a1ef35ad..000000000000 --- a/packages/message-relayer/CHANGELOG.md +++ /dev/null @@ -1,925 +0,0 @@ -# @eth-optimism/message-relayer - -## 0.5.34 - -### Patch Changes - -- Updated dependencies [a1b7ff9e3] -- Updated dependencies [8133872ed] -- Updated dependencies [afc2ab8c9] -- Updated dependencies [5063a69fb] -- Updated dependencies [aa854bdd8] - - @eth-optimism/sdk@2.1.0 - -## 0.5.33 - -### Patch Changes - -- dbe5eb308: Empty patch release to re-release packages that failed to be released by a bug in the release process. -- Updated dependencies [be3315689] - - @eth-optimism/sdk@2.0.2 - -## 0.5.32 - -### Patch Changes - -- Updated dependencies [fecd42d67] -- Updated dependencies [66cafc00a] - - @eth-optimism/common-ts@0.8.1 - - @eth-optimism/sdk@2.0.1 - -## 0.5.31 - -### Patch Changes - -- Updated dependencies [cb19e2f9c] - - @eth-optimism/sdk@2.0.0 - -## 0.5.30 - -### Patch Changes - -- @eth-optimism/sdk@1.10.4 - -## 0.5.29 - -### Patch Changes - -- @eth-optimism/sdk@1.10.3 - -## 0.5.28 - -### Patch Changes - -- Updated dependencies [0e179781b] -- Updated dependencies [5372c9f5b] -- Updated dependencies [4ae94b412] - - @eth-optimism/common-ts@0.8.0 - - @eth-optimism/sdk@1.10.2 - -## 0.5.27 - -### Patch Changes - -- Updated dependencies [f04e5db2d] - - @eth-optimism/common-ts@0.7.1 - - @eth-optimism/sdk@1.10.1 - -## 0.5.26 - -### Patch Changes - -- Updated dependencies [3f4b3c328] - - @eth-optimism/sdk@1.10.0 - -## 0.5.25 - -### Patch Changes - -- @eth-optimism/sdk@1.9.1 - -## 0.5.24 - -### Patch Changes - -- Updated dependencies [e23f60f63] -- Updated dependencies [ab8ec365c] -- Updated dependencies [ba8b94a60] -- Updated dependencies [9b2891852] -- Updated dependencies [d1f9098f9] -- Updated dependencies [c6c9c7dbf] -- Updated dependencies [ffcee1013] -- Updated dependencies [eceb0de1d] - - @eth-optimism/common-ts@0.7.0 - - @eth-optimism/sdk@1.9.0 - -## 0.5.23 - -### Patch Changes - -- 1d3c749a2: Bumps the version of ts-node used -- Updated dependencies [767585b07] -- Updated dependencies [c975c9620] -- Updated dependencies [136ea1785] - - @eth-optimism/sdk@1.8.0 - - @eth-optimism/core-utils@0.12.0 - - @eth-optimism/common-ts@0.6.8 - -## 0.5.22 - -### Patch Changes - -- Updated dependencies [1bfe79f20] - - @eth-optimism/sdk@1.7.0 - -## 0.5.21 - -### Patch Changes - -- 97b5f578c: Fixes how versions are imported for BaseServiceV2 services - - @eth-optimism/sdk@1.6.11 - -## 0.5.20 - -### Patch Changes - -- Updated dependencies [1e76cdb86] - - @eth-optimism/core-utils@0.11.0 - - @eth-optimism/common-ts@0.6.7 - - @eth-optimism/sdk@1.6.10 - -## 0.5.19 - -### Patch Changes - -- @eth-optimism/sdk@1.6.9 - -## 0.5.18 - -### Patch Changes - -- @eth-optimism/sdk@1.6.8 - -## 0.5.17 - -### Patch Changes - -- Updated dependencies [b40913b1] -- Updated dependencies [a5e715c3] - - @eth-optimism/sdk@1.6.7 - -## 0.5.16 - -### Patch Changes - -- Updated dependencies [ce7da914] - - @eth-optimism/common-ts@0.6.6 - - @eth-optimism/sdk@1.6.6 - -## 0.5.15 - -### Patch Changes - -- Updated dependencies [e2faaa8b] - - @eth-optimism/sdk@1.6.5 - -## 0.5.14 - -### Patch Changes - -- 7215f4ce: Bump ethers to 5.7.0 globally -- 4f0cc4a4: Small patch release meant to test a fix for a bug in our canary release process for this package. -- Updated dependencies [7215f4ce] -- Updated dependencies [206f6033] -- Updated dependencies [d7679ca4] - - @eth-optimism/common-ts@0.6.5 - - @eth-optimism/core-utils@0.10.1 - - @eth-optimism/sdk@1.6.4 - -## 0.5.13 - -### Patch Changes - -- @eth-optimism/sdk@1.6.3 - -## 0.5.12 - -### Patch Changes - -- Updated dependencies [cfa81f88] - - @eth-optimism/sdk@1.6.2 - -## 0.5.11 - -### Patch Changes - -- Updated dependencies [b27d0fa7] -- Updated dependencies [dbfea116] - - @eth-optimism/sdk@1.6.1 - - @eth-optimism/core-utils@0.10.0 - - @eth-optimism/common-ts@0.6.4 - -## 0.5.10 - -### Patch Changes - -- Updated dependencies [3df66a9a] -- Updated dependencies [8323407f] -- Updated dependencies [3af9c7a9] -- Updated dependencies [aa2949ef] -- Updated dependencies [a1a73e64] -- Updated dependencies [f53c30b9] - - @eth-optimism/sdk@1.6.0 - -## 0.5.9 - -### Patch Changes - -- Updated dependencies [dcd715a6] - - @eth-optimism/sdk@1.5.0 - -## 0.5.8 - -### Patch Changes - -- Updated dependencies [0df744f6] -- Updated dependencies [8ae39154] -- Updated dependencies [f05ab6b6] -- Updated dependencies [dac4a9f0] - - @eth-optimism/core-utils@0.9.3 - - @eth-optimism/sdk@1.4.0 - - @eth-optimism/common-ts@0.6.3 - -## 0.5.7 - -### Patch Changes - -- Updated dependencies [0bf3b9b4] -- Updated dependencies [680714c1] -- Updated dependencies [8d26459b] -- Updated dependencies [4477fe9f] -- Updated dependencies [29830750] - - @eth-optimism/core-utils@0.9.2 - - @eth-optimism/sdk@1.3.1 - - @eth-optimism/common-ts@0.6.2 - -## 0.5.6 - -### Patch Changes - -- Updated dependencies [032f7214] - - @eth-optimism/sdk@1.3.0 - -## 0.5.5 - -### Patch Changes - -- Updated dependencies [f9fee446] - - @eth-optimism/core-utils@0.9.1 - - @eth-optimism/sdk@1.2.1 - - @eth-optimism/common-ts@0.6.1 - -## 0.5.4 - -### Patch Changes - -- 977493bc: Update SDK version and usage to account for new constructor -- Updated dependencies [977493bc] -- Updated dependencies [700dcbb0] -- Updated dependencies [3d1cb720] - - @eth-optimism/sdk@1.2.0 - - @eth-optimism/core-utils@0.9.0 - - @eth-optimism/common-ts@0.6.0 - -## 0.5.3 - -### Patch Changes - -- Updated dependencies [cb71fcde] -- Updated dependencies [10e41522] - - @eth-optimism/common-ts@0.5.0 - -## 0.5.2 - -### Patch Changes - -- 29ff7462: Revert es target back to 2017 -- Updated dependencies [c201f3f1] -- Updated dependencies [29ff7462] -- Updated dependencies [52b26878] - - @eth-optimism/common-ts@0.4.0 - - @eth-optimism/core-utils@0.8.7 - - @eth-optimism/sdk@1.1.9 - -## 0.5.1 - -### Patch Changes - -- Updated dependencies [9ba869a7] -- Updated dependencies [050859fd] - - @eth-optimism/common-ts@0.3.1 - -## 0.5.0 - -### Minor Changes - -- 84a8934c: BaseServiceV2 exposes service name and version as standard synthetic metric - -### Patch Changes - -- Updated dependencies [d9e39931] -- Updated dependencies [84a8934c] - - @eth-optimism/common-ts@0.3.0 - -## 0.4.13 - -### Patch Changes - -- Updated dependencies [9ecbf3e5] - - @eth-optimism/common-ts@0.2.10 - - @eth-optimism/sdk@1.1.8 - -## 0.4.12 - -### Patch Changes - -- Updated dependencies [17962ca9] - - @eth-optimism/core-utils@0.8.6 - - @eth-optimism/common-ts@0.2.9 - - @eth-optimism/sdk@1.1.7 - -## 0.4.11 - -### Patch Changes - -- d18ae135: Updates all ethers versions in response to BN.js bug -- Updated dependencies [f16383f2] -- Updated dependencies [d18ae135] - - @eth-optimism/common-ts@0.2.8 - - @eth-optimism/core-utils@0.8.5 - - @eth-optimism/sdk@1.1.6 - -## 0.4.10 - -### Patch Changes - -- Updated dependencies [86901552] - - @eth-optimism/sdk@1.1.5 - -## 0.4.9 - -### Patch Changes - -- @eth-optimism/sdk@1.1.4 - -## 0.4.8 - -### Patch Changes - -- 412688d5: Replace calls to getNetwork() with getChainId util - - @eth-optimism/sdk@1.1.3 - -## 0.4.7 - -### Patch Changes - -- Updated dependencies [5cb3a5f7] -- Updated dependencies [6b9fc055] - - @eth-optimism/core-utils@0.8.4 - - @eth-optimism/sdk@1.1.2 - - @eth-optimism/common-ts@0.2.7 - -## 0.4.6 - -### Patch Changes - -- Updated dependencies [1338135c] - - @eth-optimism/sdk@1.1.1 - -## 0.4.5 - -### Patch Changes - -- Updated dependencies [a9f8e577] - - @eth-optimism/sdk@1.1.0 - -## 0.4.4 - -### Patch Changes - -- b57014d1: Update to typescript@4.6.2 -- Updated dependencies [b57014d1] - - @eth-optimism/common-ts@0.2.6 - - @eth-optimism/core-utils@0.8.3 - - @eth-optimism/sdk@1.0.4 - -## 0.4.3 - -### Patch Changes - -- c1957126: Update Dockerfile to use Alpine -- d9a51154: Bump to hardhat@2.9.1 -- Updated dependencies [e36b085c] -- Updated dependencies [c1957126] -- Updated dependencies [51673b90] -- Updated dependencies [7a179003] -- Updated dependencies [d9a51154] - - @eth-optimism/common-ts@0.2.5 - - @eth-optimism/core-utils@0.8.2 - - @eth-optimism/sdk@1.0.3 - -## 0.4.2 - -### Patch Changes - -- Updated dependencies [f981b8da] - - @eth-optimism/common-ts@0.2.4 - -## 0.4.1 - -### Patch Changes - -- 88601cb7: Refactored Dockerfiles -- 5cd1e996: Have BaseServiceV2 add spaces to environment variable names -- Updated dependencies [f7761058] -- Updated dependencies [5ae15042] -- Updated dependencies [5cd1e996] -- Updated dependencies [d49feca1] - - @eth-optimism/common-ts@0.2.3 - - @eth-optimism/sdk@1.0.2 - -## 0.4.0 - -### Minor Changes - -- 860fef46: Rewrites the message-relayer to use the BaseServiceV2. - -### Patch Changes - -- Updated dependencies [b3f9bdef] -- Updated dependencies [7ae1c67f] -- Updated dependencies [e53b5783] -- Updated dependencies [47e5d118] - - @eth-optimism/common-ts@0.2.2 - - @eth-optimism/sdk@1.0.1 - -## 0.3.2 - -### Patch Changes - -- Updated dependencies [42227d69] -- Updated dependencies [84f63c49] - - @eth-optimism/sdk@1.0.0 - -## 0.3.1 - -### Patch Changes - -- Updated dependencies [b66e3131] -- Updated dependencies [5a6f539c] -- Updated dependencies [27d8942e] - - @eth-optimism/sdk@0.2.5 - - @eth-optimism/core-utils@0.8.1 - -## 0.3.0 - -### Minor Changes - -- dcdcc757: Removes message relaying utilities from the Message Relayer, to be replaced by the SDK - -### Patch Changes - -- 189f63be: Update message relayer to log sent tx hashes -- Updated dependencies [f37c283c] -- Updated dependencies [3f4d3c13] -- Updated dependencies [0b4453f7] -- Updated dependencies [0c54e60e] - - @eth-optimism/sdk@0.2.3 - - @eth-optimism/core-utils@0.8.0 - -## 0.2.18 - -### Patch Changes - -- 31108ed0: Fixes a bug that prevented the relayer from running correctly. -- Updated dependencies [b4165299] -- Updated dependencies [3c2acd91] - - @eth-optimism/core-utils@0.7.7 - - @eth-optimism/contracts@0.5.14 - -## 0.2.17 - -### Patch Changes - -- Updated dependencies [438bc78a] - - @eth-optimism/contracts@0.5.13 - -## 0.2.16 - -### Patch Changes - -- ba14c59d: Updates various ethers dependencies to their latest versions -- Updated dependencies [ba14c59d] - - @eth-optimism/contracts@0.5.12 - - @eth-optimism/core-utils@0.7.6 - -## 0.2.15 - -### Patch Changes - -- Updated dependencies [e631c39c] - - @eth-optimism/contracts@0.5.11 - -## 0.2.14 - -### Patch Changes - -- Updated dependencies [ad94b9d1] - - @eth-optimism/core-utils@0.7.5 - - @eth-optimism/contracts@0.5.10 - -## 0.2.13 - -### Patch Changes - -- Updated dependencies [ba96a455] -- Updated dependencies [c3e85fef] - - @eth-optimism/core-utils@0.7.4 - - @eth-optimism/contracts@0.5.9 - -## 0.2.12 - -### Patch Changes - -- e7c65ade: Fix docker build -- Updated dependencies [b3efb8b7] -- Updated dependencies [279603e5] -- Updated dependencies [b6040bb3] - - @eth-optimism/contracts@0.5.8 - -## 0.2.11 - -### Patch Changes - -- 3a673322: Removed old node.js service running script - -## 0.2.10 - -### Patch Changes - -- Updated dependencies [b6f89fad] - - @eth-optimism/contracts@0.5.7 - -## 0.2.9 - -### Patch Changes - -- Updated dependencies [bbd42e03] -- Updated dependencies [453f0774] - - @eth-optimism/contracts@0.5.6 - -## 0.2.8 - -### Patch Changes - -- 57d5b8f9: Build docker images with node.js version 16 - -## 0.2.7 - -### Patch Changes - -- 0ab37fc9: Update to node.js version 16 - -## 0.2.6 - -### Patch Changes - -- 6b73a94a: Fix dockerfile - -## 0.2.5 - -### Patch Changes - -- Updated dependencies [584cbc25] - - @eth-optimism/core-utils@0.7.3 - - @eth-optimism/contracts@0.5.5 - -## 0.2.4 - -### Patch Changes - -- 8e634b49: Fix package JSON issues -- Updated dependencies [8e634b49] - - @eth-optimism/core-utils@0.7.2 - - @eth-optimism/contracts@0.5.4 - -## 0.2.3 - -### Patch Changes - -- Updated dependencies [b9049406] -- Updated dependencies [a8b14a7d] - - @eth-optimism/contracts@0.5.3 - -## 0.2.2 - -### Patch Changes - -- 243f33e5: Standardize package json file format -- Updated dependencies [243f33e5] - - @eth-optimism/common-ts@0.2.1 - - @eth-optimism/contracts@0.5.2 - - @eth-optimism/core-utils@0.7.1 - -## 0.2.1 - -### Patch Changes - -- Updated dependencies [c0fc7fee] - - @eth-optimism/contracts@0.5.1 - -## 0.2.0 - -### Minor Changes - -- 3f590e33: Remove the "OVM" Prefix from contract names -- 81ccd6e4: `regenesis/0.5.0` release - -### Patch Changes - -- 0a147680: Add legacy proof generation to message-relayer -- 222a3eef: Add 'User-Agent' to the http headers for ethers providers -- b70ee70c: upgraded to solidity 0.8.9 -- a98a1884: Fixes dependencies instead of using caret constraints -- 8f4cb337: Removes the onlyRelayer modifier from the L1CrossDomainMessenger -- beb6c977: Remove obsoleted contract code. Improve events usability by indexing helpful params. Switch using encoded message and use decoded message from event -- Updated dependencies [e4a1129c] -- Updated dependencies [64ea3ac9] -- Updated dependencies [3ce62c81] -- Updated dependencies [299a459e] -- Updated dependencies [8c8807c0] -- Updated dependencies [d7978cfc] -- Updated dependencies [e16d41c0] -- Updated dependencies [5db50b3d] -- Updated dependencies [cee2a464] -- Updated dependencies [66bf56a6] -- Updated dependencies [2c91ca00] -- Updated dependencies [d5036826] -- Updated dependencies [222a3eef] -- Updated dependencies [dfc784e8] -- Updated dependencies [896168e2] -- Updated dependencies [436c48fd] -- Updated dependencies [7c352b1e] -- Updated dependencies [2ade9a79] -- Updated dependencies [0272a536] -- Updated dependencies [6ee7423f] -- Updated dependencies [3f590e33] -- Updated dependencies [e20deca0] -- Updated dependencies [2a731e0d] -- Updated dependencies [199e895e] -- Updated dependencies [872f5976] -- Updated dependencies [9c1443a4] -- Updated dependencies [26906518] -- Updated dependencies [c53b3587] -- Updated dependencies [1b917041] -- Updated dependencies [483f561b] -- Updated dependencies [b70ee70c] -- Updated dependencies [c38e4b57] -- Updated dependencies [a98a1884] -- Updated dependencies [b744b6ea] -- Updated dependencies [20c8969b] -- Updated dependencies [d2eb8ae0] -- Updated dependencies [1e63ffa0] -- Updated dependencies [ff266e9c] -- Updated dependencies [b56dd079] -- Updated dependencies [56fe3793] -- Updated dependencies [3e2aa16a] -- Updated dependencies [d3cb1b86] -- Updated dependencies [3e41df63] -- Updated dependencies [973589da] -- Updated dependencies [83a449c4] -- Updated dependencies [9c63e9bd] -- Updated dependencies [81ccd6e4] -- Updated dependencies [f38b8000] -- Updated dependencies [d5f012ab] -- Updated dependencies [76c84f21] -- Updated dependencies [6d32d701] -- Updated dependencies [3605b963] -- Updated dependencies [3f28385a] -- Updated dependencies [280f348c] -- Updated dependencies [a0947c3f] -- Updated dependencies [51821d8f] -- Updated dependencies [29f1c228] -- Updated dependencies [8f4cb337] -- Updated dependencies [beb6c977] -- Updated dependencies [33abe73d] -- Updated dependencies [71de86d6] - - @eth-optimism/contracts@0.5.0 - - @eth-optimism/core-utils@0.7.0 - - @eth-optimism/common-ts@0.2.0 - -## 0.1.14 - -### Patch Changes - -- 6d3e1d7f: Update dependencies -- Updated dependencies [6d3e1d7f] -- Updated dependencies [2e929aa9] - - @eth-optimism/common-ts@0.1.6 - - @eth-optimism/contracts@0.4.14 - - @eth-optimism/core-utils@0.6.1 - -## 0.1.13 - -### Patch Changes - -- e504bb47: added coverage for getMerkleTreeProof -- Updated dependencies [e0be02e1] -- Updated dependencies [7f7f35c3] -- Updated dependencies [8da04505] - - @eth-optimism/core-utils@0.6.0 - - @eth-optimism/contracts@0.4.13 - -## 0.1.12 - -### Patch Changes - -- 21b17edd: Added coverage for packages -- Updated dependencies [888dafca] -- Updated dependencies [eb0854e7] -- Updated dependencies [21b17edd] -- Updated dependencies [dfe3598f] - - @eth-optimism/contracts@0.4.11 - - @eth-optimism/core-utils@0.5.5 - -## 0.1.11 - -### Patch Changes - -- 918c08ca: Bump ethers dependency to 5.4.x to support eip1559 -- Updated dependencies [918c08ca] - - @eth-optimism/contracts@0.4.10 - - @eth-optimism/core-utils@0.5.2 - -## 0.1.10 - -### Patch Changes - -- ecc2f8c1: Patch so contracts package will correctly use the browser-compatible contract artifacts import -- Updated dependencies [ecc2f8c1] - - @eth-optimism/contracts@0.4.9 - -## 0.1.9 - -### Patch Changes - -- e4fea5e0: Use latest contracts package for browser compatibility support -- Updated dependencies [e4fea5e0] - - @eth-optimism/contracts@0.4.8 - -## 0.1.8 - -### Patch Changes - -- c73c3939: Update the typescript version to `4.3.5` -- Updated dependencies [c73c3939] - - @eth-optimism/common-ts@0.1.5 - - @eth-optimism/contracts@0.4.5 - - @eth-optimism/core-utils@0.5.1 - -## 0.1.7 - -### Patch Changes - -- fd86043a: Adds a new l2 to l1 message relaying utility within the message relayer package -- Updated dependencies [0313794b] -- Updated dependencies [049200f4] -- Updated dependencies [21e47e1f] - - @eth-optimism/contracts@0.4.2 - - @eth-optimism/core-utils@0.5.0 - -## 0.1.6 - -### Patch Changes - -- 735cd78f: Update relayer package JSON to correctly export all files in dist -- Updated dependencies [25f09abd] -- Updated dependencies [dd8edc7b] -- Updated dependencies [c87e4c74] -- Updated dependencies [db0dbfb2] -- Updated dependencies [7f5936a8] -- Updated dependencies [f87a2d00] -- Updated dependencies [85da4979] -- Updated dependencies [57ca21a2] -- Updated dependencies [5fc728da] -- Updated dependencies [2e72fd90] -- Updated dependencies [c43b33ec] -- Updated dependencies [26bc63ad] -- Updated dependencies [a0d9e565] -- Updated dependencies [2bd49730] -- Updated dependencies [38355a3b] -- Updated dependencies [3c2c32e1] -- Updated dependencies [d9644c34] -- Updated dependencies [48ece14c] -- Updated dependencies [e04de624] -- Updated dependencies [014dea71] -- Updated dependencies [fa29b03e] -- Updated dependencies [6b46c8ba] -- Updated dependencies [e045f582] -- Updated dependencies [5c89c45f] -- Updated dependencies [df5ff890] -- Updated dependencies [e29fab10] -- Updated dependencies [c2a04893] -- Updated dependencies [baacda34] - - @eth-optimism/contracts@0.4.0 - - @eth-optimism/core-utils@0.4.6 - - @eth-optimism/common-ts@0.1.4 - -## 0.1.5 - -### Patch Changes - -- baa3b761: Improve Sentry support, initializing as needed and ensuring ERROR logs route to Sentry -- Updated dependencies [baa3b761] - - @eth-optimism/common-ts@0.1.3 - -## 0.1.4 - -### Patch Changes - -- 9d39121b: Adds a README and cleans up the interface for generating messages and proofs -- 86708bb5: Adds a new set of tools for generating messages to be relayed and their proofs -- 064c03af: Removes spreadsheet mode from the message relayer -- Updated dependencies [a64f8161] -- Updated dependencies [4e03f8a9] -- Updated dependencies [8e2bfd07] -- Updated dependencies [750a5021] -- Updated dependencies [c2b6e14b] -- Updated dependencies [245136f1] - - @eth-optimism/core-utils@0.4.5 - - @eth-optimism/contracts@0.3.5 - -## 0.1.3 - -### Patch Changes - -- e3b138b: Fix to avoid getting OOM killed when the relayer runs for a long period of time -- Updated dependencies [5e5d4a1] - - @eth-optimism/contracts@0.3.3 - -## 0.1.2 - -### Patch Changes - -- 96a586e: Migrate bcfg interface to core-utils -- fa4898a: Explicitly log error messages so that they do not show as empty objects -- Updated dependencies [96a586e] -- Updated dependencies [0c16805] -- Updated dependencies [775118a] - - @eth-optimism/core-utils@0.4.3 - - @eth-optimism/common-ts@0.1.2 - - @eth-optimism/contracts@0.3.1 - -## 0.1.1 - -### Patch Changes - -- aedf931: Add updated config parsing in a backwards compatible way -- d723b2a: Don't log the config options at startup because it contains secrets - -## 0.1.0 - -### Minor Changes - -- b799caa: Updates to use RLP encoded transactions in batches for the `v0.3.0` release - -### Patch Changes - -- 33fcd84: Add a check for `OVM_L2MessageRelayer` in the AddressManager before attempting to relay messages to help surface errors more quickly -- Updated dependencies [b799caa] -- Updated dependencies [6132e7a] -- Updated dependencies [b799caa] -- Updated dependencies [b799caa] -- Updated dependencies [b799caa] -- Updated dependencies [20747fd] -- Updated dependencies [b799caa] -- Updated dependencies [b799caa] - - @eth-optimism/contracts@0.3.0 - - @eth-optimism/core-utils@0.4.2 - -## 0.0.5 - -### Patch Changes - -- 28dc442: move metrics, logger, and base-service to new common-ts package -- Updated dependencies [28dc442] -- Updated dependencies [d2091d4] -- Updated dependencies [a0a0052] -- Updated dependencies [0ef3069] - - @eth-optimism/common-ts@0.1.0 - - @eth-optimism/core-utils@0.4.0 - - @eth-optimism/contracts@0.2.9 - -## 0.0.4 - -### Patch Changes - -- Updated dependencies [91460d9] -- Updated dependencies [a0a7956] -- Updated dependencies [0497d7d] - - @eth-optimism/core-utils@0.3.0 - - @eth-optimism/contracts@0.2.5 - -## 0.0.3 - -### Patch Changes - -- 3b00b7c: bump private package versions to try triggering a tag - -## 0.0.2 - -### Patch Changes - -- Updated dependencies [6cbc54d] - - @eth-optimism/core-utils@0.2.0 - - @eth-optimism/contracts@0.2.2 diff --git a/packages/message-relayer/LICENSE b/packages/message-relayer/LICENSE deleted file mode 100644 index 6a7da5218bb2..000000000000 --- a/packages/message-relayer/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright 2020-2021 Optimism - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/message-relayer/README.md b/packages/message-relayer/README.md deleted file mode 100644 index 7c95fdeb41d8..000000000000 --- a/packages/message-relayer/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# @eth-optimism/message-relayer - -[![codecov](https://codecov.io/gh/ethereum-optimism/optimism/branch/develop/graph/badge.svg?token=0VTG7PG7YR&flag=message-relayer-tests)](https://codecov.io/gh/ethereum-optimism/optimism) - -`message-relayer` is a service that automatically finalizes ("relays") messages sent from Optimism to Ethereum. -This package is meant to be used during local development and should NOT be used on a production network. - -## Installation - -Clone, install, and build the Optimism monorepo: - -``` -git clone https://github.com/ethereum-optimism/optimism.git -yarn install -yarn build -``` - -## Running the relayer (Docker) - -The `message-relayer` can be included as part of the [local Optimism development environment](https://community.optimism.io/docs/developers/build/dev-node/). -Although the `message-relayer` is not turned on by default, it can be enabled by [changing this line in docker-compose.yml](https://github.com/ethereum-optimism/optimism/blob/51a527b8e3fe69940fb8c0f5e4aa2e0ae8ee294c/ops/docker-compose.yml#L129) to: - -``` -replicas: 1 -``` - -## Running the relayer (manual) - -The `message-relayer` can also be run manually. -Copy `.env.example` into a new file named `.env`, then set the environment variables listed there. -Once your environment variables have been set, run the relayer via: - -``` -yarn start -``` diff --git a/packages/message-relayer/hardhat.config.ts b/packages/message-relayer/hardhat.config.ts deleted file mode 100644 index 1705dde31fde..000000000000 --- a/packages/message-relayer/hardhat.config.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { HardhatUserConfig } from 'hardhat/config' - -import '@nomiclabs/hardhat-ethers' -import '@nomiclabs/hardhat-waffle' - -const config: HardhatUserConfig = { - paths: { - sources: './test/test-contracts', - }, - solidity: { - version: '0.8.9', - settings: { - optimizer: { enabled: true, runs: 200 }, - metadata: { - bytecodeHash: 'none', - }, - outputSelection: { - '*': { - '*': ['metadata', 'storageLayout'], - }, - }, - }, - }, -} - -export default config diff --git a/packages/message-relayer/package.json b/packages/message-relayer/package.json deleted file mode 100644 index 41979812a4ee..000000000000 --- a/packages/message-relayer/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "private": true, - "name": "@eth-optimism/message-relayer", - "version": "0.5.34", - "description": "[Optimism] Service for automatically relaying L2 to L1 transactions", - "main": "dist/index", - "types": "dist/index", - "files": [ - "dist/*" - ], - "scripts": { - "start": "ts-node ./src/service.ts", - "test:coverage": "echo 'No tests defined.'", - "build": "tsc -p ./tsconfig.json", - "clean": "rimraf dist/ ./tsconfig.tsbuildinfo", - "lint": "yarn lint:fix && yarn lint:check", - "pre-commit": "lint-staged", - "lint:fix": "yarn lint:check --fix", - "lint:check": "eslint . --max-warnings=0" - }, - "keywords": [ - "optimism", - "ethereum", - "relayer" - ], - "homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/message-relayer#readme", - "license": "MIT", - "author": "Optimism PBC", - "repository": { - "type": "git", - "url": "https://github.com/ethereum-optimism/optimism.git" - }, - "dependencies": { - "@eth-optimism/common-ts": "0.8.1", - "@eth-optimism/core-utils": "0.12.0", - "@eth-optimism/sdk": "2.1.0", - "ethers": "^5.7.0" - }, - "devDependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@nomiclabs/hardhat-ethers": "^2.0.2", - "@nomiclabs/hardhat-waffle": "^2.0.1", - "ethereum-waffle": "^3.3.0", - "hardhat": "^2.9.6", - "ts-node": "^10.9.1" - } -} diff --git a/packages/message-relayer/src/index.ts b/packages/message-relayer/src/index.ts deleted file mode 100644 index caf7fffa1017..000000000000 --- a/packages/message-relayer/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './service' diff --git a/packages/message-relayer/src/service.ts b/packages/message-relayer/src/service.ts deleted file mode 100644 index 4d93aee441b0..000000000000 --- a/packages/message-relayer/src/service.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* Imports: External */ -import { Signer } from 'ethers' -import { getChainId, sleep } from '@eth-optimism/core-utils' -import { - BaseServiceV2, - validators, - Gauge, - Counter, -} from '@eth-optimism/common-ts' -import { CrossChainMessenger, MessageStatus } from '@eth-optimism/sdk' -import { Provider } from '@ethersproject/abstract-provider' - -import { version } from '../package.json' - -type MessageRelayerOptions = { - l1RpcProvider: Provider - l2RpcProvider: Provider - l1Wallet: Signer - fromL2TransactionIndex?: number -} - -type MessageRelayerMetrics = { - highestCheckedL2Tx: Gauge - highestKnownL2Tx: Gauge - numRelayedMessages: Counter -} - -type MessageRelayerState = { - wallet: Signer - messenger: CrossChainMessenger - highestCheckedL2Tx: number - highestKnownL2Tx: number -} - -export class MessageRelayerService extends BaseServiceV2< - MessageRelayerOptions, - MessageRelayerMetrics, - MessageRelayerState -> { - constructor(options?: Partial) { - super({ - version, - name: 'message-relayer', - options, - optionsSpec: { - l1RpcProvider: { - validator: validators.provider, - desc: 'Provider for interacting with L1.', - }, - l2RpcProvider: { - validator: validators.provider, - desc: 'Provider for interacting with L2.', - }, - l1Wallet: { - validator: validators.wallet, - desc: 'Wallet used to interact with L1.', - }, - fromL2TransactionIndex: { - validator: validators.num, - desc: 'Index of the first L2 transaction to start processing from.', - default: 0, - public: true, - }, - }, - metricsSpec: { - highestCheckedL2Tx: { - type: Gauge, - desc: 'Highest L2 tx that has been scanned for messages', - }, - highestKnownL2Tx: { - type: Gauge, - desc: 'Highest known L2 transaction', - }, - numRelayedMessages: { - type: Counter, - desc: 'Number of messages relayed by the service', - }, - }, - }) - } - - protected async init(): Promise { - this.state.wallet = this.options.l1Wallet.connect( - this.options.l1RpcProvider - ) - - this.state.messenger = new CrossChainMessenger({ - l1SignerOrProvider: this.state.wallet, - l2SignerOrProvider: this.options.l2RpcProvider, - l1ChainId: await getChainId(this.state.wallet.provider), - l2ChainId: await getChainId(this.options.l2RpcProvider), - }) - - this.state.highestCheckedL2Tx = this.options.fromL2TransactionIndex || 1 - this.state.highestKnownL2Tx = - await this.state.messenger.l2Provider.getBlockNumber() - } - - protected async main(): Promise { - // Update metrics - this.metrics.highestCheckedL2Tx.set(this.state.highestCheckedL2Tx) - this.metrics.highestKnownL2Tx.set(this.state.highestKnownL2Tx) - - // If we're already at the tip, then update the latest tip and loop again. - if (this.state.highestCheckedL2Tx > this.state.highestKnownL2Tx) { - this.state.highestKnownL2Tx = - await this.state.messenger.l2Provider.getBlockNumber() - - // Sleeping for 1000ms is good enough since this is meant for development and not for live - // networks where we might want to restrict the number of requests per second. - await sleep(1000) - return - } - - this.logger.info(`checking L2 block ${this.state.highestCheckedL2Tx}`) - - const block = - await this.state.messenger.l2Provider.getBlockWithTransactions( - this.state.highestCheckedL2Tx - ) - - // Should never happen. - if (block.transactions.length !== 1) { - throw new Error( - `got an unexpected number of transactions in block: ${block.number}` - ) - } - - const messages = await this.state.messenger.getMessagesByTransaction( - block.transactions[0].hash - ) - - // No messages in this transaction so we can move on to the next one. - if (messages.length === 0) { - this.state.highestCheckedL2Tx++ - return - } - - // Make sure that all messages sent within the transaction are finalized. If any messages - // are not finalized, then we're going to break the loop which will trigger the sleep and - // wait for a few seconds before we check again to see if this transaction is finalized. - let isFinalized = true - for (const message of messages) { - const status = await this.state.messenger.getMessageStatus(message) - if ( - status === MessageStatus.IN_CHALLENGE_PERIOD || - status === MessageStatus.STATE_ROOT_NOT_PUBLISHED - ) { - isFinalized = false - } - } - - if (!isFinalized) { - this.logger.info( - `tx not yet finalized, waiting: ${this.state.highestCheckedL2Tx}` - ) - return - } else { - this.logger.info( - `tx is finalized, relaying: ${this.state.highestCheckedL2Tx}` - ) - } - - // If we got here then all messages in the transaction are finalized. Now we can relay - // each message to L1. - for (const message of messages) { - try { - const tx = await this.state.messenger.finalizeMessage(message) - this.logger.info(`relayer sent tx: ${tx.hash}`) - this.metrics.numRelayedMessages.inc() - } catch (err) { - if (err.message.includes('message has already been received')) { - // It's fine, the message was relayed by someone else - } else { - throw err - } - } - await this.state.messenger.waitForMessageReceipt(message) - } - - // All messages have been relayed so we can move on to the next block. - this.state.highestCheckedL2Tx++ - } -} - -if (require.main === module) { - const service = new MessageRelayerService() - service.run() -} diff --git a/packages/message-relayer/tsconfig.json b/packages/message-relayer/tsconfig.json deleted file mode 100644 index 12b6b742d745..000000000000 --- a/packages/message-relayer/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist" - }, - "include": [ - "package.json", - "src/**/*" - ] -}