Commit c718bcde authored by Mark Tyneway's avatar Mark Tyneway

gas-oracle: ci + docker build/publish

Adds a dockerfile for the `gas-oracle` as well as adding it as
a service in the `docker-compose.yaml`. It is not enabled by
default due to memory issues in CI already happening occasionally
where the integration tests are oom killed.

The `gas-oracle` is configured with a key that owns the
`OVM_GasPriceOracle`.

This PR adds the `gas-oracle` to the Github Actions
workflow that is responsible for publishing the docker images.
parent ce3c353b
......@@ -12,3 +12,4 @@ tests/testdata
l2geth/signer/fourbyte
l2geth/cmd/puppeth
l2geth/cmd/clef
go/gas-oracle/gas-oracle
......@@ -17,6 +17,7 @@ jobs:
message-relayer: ${{ steps.packages.outputs.message-relayer }}
data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }}
contracts: ${{ steps.packages.outputs.contracts }}
gas-oracle: ${{ steps.packages.outputs.gas-oracle }}
steps:
- name: Checkout Repo
......@@ -100,6 +101,32 @@ jobs:
push: true
tags: ethereumoptimism/rpc-proxy:${{ needs.release.outputs.l2geth }}
gas-oracle:
name: Publish Gas Oracle Version ${{ needs.release.outputs.gas-oracle }}
needs: release
if: needs.release.outputs.gas-oracle != ''
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Publish Gas Oracle
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.gas-oracle
push: true
tags: ethereumoptimism/gas-oracle:${{ needs.release.outputs.gas-oracle }}
# pushes the base builder image to dockerhub
builder:
name: Prepare the base builder image for the services
......
......@@ -198,3 +198,14 @@ services:
ENABLE_GAS_REPORT: 1
NO_NETWORK: 1
gas_oracle:
image: ethereumoptimism/gas-oracle
deploy:
replicas: 0
build:
context: ..
dockerfile: ./ops/docker/Dockerfile.gas-oracle
entrypoint: ./gas-oracle.sh
environment:
GAS_PRICE_ORACLE_ETHEREUM_HTTP_URL: http://l2geth:8545
GAS_PRICE_ORACLE_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
FROM golang:1.15-alpine3.13 as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
ADD ./go/gas-oracle /gas-oracle
RUN cd /gas-oracle && make gas-oracle
FROM alpine:3.13
RUN apk add --no-cache ca-certificates jq curl
COPY --from=builder /gas-oracle/gas-oracle /usr/local/bin/
COPY ./ops/scripts/gas-oracle.sh .
ENTRYPOINT ["gas-oracle"]
......@@ -7,6 +7,7 @@ ROLLUP_CLIENT_HTTP=
ROLLUP_STATE_DUMP_PATH=
ROLLUP_POLL_INTERVAL_FLAG=500ms
ROLLUP_ENABLE_L2_GAS_POLLING=true
ROLLUP_GAS_PRICE_ORACLE_OWNER_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
# ROLLUP_ENFORCE_FEES=
ETHERBASE=0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
......
#!/bin/sh
RETRIES=${RETRIES:-40}
if [[ -z $GAS_PRICE_ORACLE_ETHEREUM_HTTP_URL ]]; then
echo "Must set env GAS_PRICE_ORACLE_ETHEREUM_HTTP_URL"
exit 1
fi
# waits for l2geth to be up
curl --fail \
--show-error \
--silent \
--retry-connrefused \
--retry $RETRIES \
--retry-delay 1 \
--output /dev/null \
$GAS_PRICE_ORACLE_ETHEREUM_HTTP_URL
exec gas-oracle "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment