Commit 240e62e9 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #1647 from ethereum-optimism/bwilson/rpc-proxy-only-on-post

Bypass lua checking when the request is not a POST
parents 458dd0ef 3e09aa0a
---
'@eth-optimism/rpc-proxy': patch
---
Initial rpc-proxy package
...@@ -24,6 +24,7 @@ jobs: ...@@ -24,6 +24,7 @@ jobs:
replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }} replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }}
canary-docker-tag: ${{ steps.docker-image-name.outputs.canary-docker-tag }} canary-docker-tag: ${{ steps.docker-image-name.outputs.canary-docker-tag }}
proxyd: ${{ steps.canary-publish.outputs.proxyd }} proxyd: ${{ steps.canary-publish.outputs.proxyd }}
rpc-proxy : ${{ steps.canary-publish.outputs.rpc-proxy }}
steps: steps:
- name: Check out source code - name: Check out source code
...@@ -342,3 +343,29 @@ jobs: ...@@ -342,3 +343,29 @@ jobs:
build-args: build-args:
- GITCOMMIT=$GITHUB_SHA - GITCOMMIT=$GITHUB_SHA
- GITDATE=$GITDATE - GITDATE=$GITDATE
rpc-proxy:
name: Publish rpc-proxy Version ${{ needs.canary-publish.outputs.canary-docker-tag }}
needs: canary-publish
if: needs.canary-publish.outputs.rpc-proxy != ''
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.rpc-proxy
push: true
tags: ethereumoptimism/rpc-proxy:${{ needs.canary-publish.outputs.rpc-proxy }}
...@@ -20,6 +20,7 @@ jobs: ...@@ -20,6 +20,7 @@ jobs:
gas-oracle: ${{ steps.packages.outputs.gas-oracle }} gas-oracle: ${{ steps.packages.outputs.gas-oracle }}
replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }} replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }}
proxyd: ${{ steps.packages.outputs.proxyd }} proxyd: ${{ steps.packages.outputs.proxyd }}
rpc-proxy: ${{ steps.packages.outputs.rpc-proxy }}
steps: steps:
- name: Checkout Repo - name: Checkout Repo
...@@ -360,3 +361,33 @@ jobs: ...@@ -360,3 +361,33 @@ jobs:
build-args: build-args:
- GITCOMMIT=$GITHUB_SHA - GITCOMMIT=$GITHUB_SHA
- GITDATE=$GITDATE - GITDATE=$GITDATE
rpc-proxy:
name: Publish rpc-proxy Version ${{ needs.release.outputs.rpc-proxy }}
needs: release
if: needs.release.outputs.rpc-proxy != ''
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: Set env
run: |
echo "GITDATE=$(date)" >> $GITHUB_ENV"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.rpc-proxy
push: true
tags: ethereumoptimism/rpc-proxy:${{ needs.canary-publish.outputs.rpc-proxy }}
...@@ -69,7 +69,9 @@ http { ...@@ -69,7 +69,9 @@ http {
} }
location / { location / {
set $jsonrpc_whitelist {{env.Getenv "ETH_CALLS_ALLOWED"}}; set $jsonrpc_whitelist {{env.Getenv "ETH_CALLS_ALLOWED"}};
access_by_lua_file 'eth-jsonrpc-access.lua'; if ($request_method = POST) {
access_by_lua_file 'eth-jsonrpc-access.lua';
}
proxy_pass http://sequencer; proxy_pass http://sequencer;
} }
} }
......
{
"name": "@eth-optimism/rpc-proxy",
"version": "0.0.1",
"private": true,
"devDependencies": {}
}
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
"specs", "specs",
"go/gas-oracle", "go/gas-oracle",
"go/batch-submitter", "go/batch-submitter",
"go/proxyd" "go/proxyd",
"ops/docker/rpc-proxy"
], ],
"nohoist": [ "nohoist": [
"examples/*" "examples/*"
......
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