Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop' of git://github.com/ethereum-optimism/optimism…
Browse files Browse the repository at this point in the history
… into develop
  • Loading branch information
CAPtheorem committed Oct 12, 2021
2 parents da9b618 + 02d4670 commit 88794f5
Show file tree
Hide file tree
Showing 39 changed files with 10,117 additions and 18,681 deletions.
5 changes: 0 additions & 5 deletions .changeset/ninety-years-smell.md

This file was deleted.

13 changes: 3 additions & 10 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,15 @@
- 'packages/message-relayer/**/*'
- 'patches/**/*'

A-ci:
M-ci:
- any: ['.github/**/*']

A-contracts:
- any: ['packages/contracts/**/*']

A-geth:
M-l2geth:
- any: ['l2geth/**/*']

A-integration-tests:
M-integration:
- any: ['integration-tests/**/*']

A-ts-packages:
- any: ['packages/**/*']
all: ['!packages/contracts/**/*']

M-batch-submitter:
- any: ['packages/batch-submitter/**/*']

Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/ext-test-snx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on: workflow_dispatch
jobs:
integration:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
Expand All @@ -28,9 +33,23 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
name: Set up layer cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-1-
- uses: docker/setup-buildx-action@master
name: Set up Docker Buildx
id: buildx
with:
version: latest
driver-opts: image=moby/buildkit:master,network=host

- name: Build the services
working-directory: ./ops
run: ./scripts/build-ci.sh
run: ./ops/scripts/build-ci.sh

- name: Bring the stack up
working-directory: ./ops
Expand Down Expand Up @@ -63,3 +82,8 @@ jobs:
with:
name: logs.tgz
path: ./logs.tgz

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
18 changes: 16 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,23 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
name: Set up layer cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-1-
- uses: docker/setup-buildx-action@master
name: Set up Docker Buildx
id: buildx
with:
version: latest
driver-opts: image=moby/buildkit:master,network=host

- name: Build the services
working-directory: ./ops
run: ./scripts/build-ci.sh
run: ./ops/scripts/build-ci.sh

- name: Bring the stack up
working-directory: ./ops
Expand Down
41 changes: 22 additions & 19 deletions .github/workflows/sync-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on: workflow_dispatch
jobs:
integration-sync-test:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
Expand All @@ -22,9 +27,24 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
name: Set up layer cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-1-
- uses: docker/setup-buildx-action@master
name: Set up Docker Buildx
id: buildx
with:
version: latest
driver-opts: image=moby/buildkit:master,network=host

- name: Build the services
working-directory: ./ops
run: ./scripts/build-ci.sh
run: ./ops/scripts/build-ci.sh

- name: Bring the stack up
working-directory: ./ops
Expand All @@ -37,20 +57,3 @@ jobs:
yarn build:integration
yarn test:sync
# - name: Collect docker logs on failure
# if: failure()
# uses: jwalton/gh-docker-logs@v1
# with:
# images: 'ethereumoptimism/builder,ethereumoptimism/hardhat,ethereumoptimism/deployer,ethereumoptimism/data-transport-layer,ethereumoptimism/l2geth,ethereumoptimism/message-relayer,ethereumoptimism/batch-submitter,ethereumoptimism/l2geth'
# dest: './logs'

# - name: Tar logs
# if: failure()
# run: tar cvzf ./logs.tgz ./logs

# - name: Upload logs to GitHub
# if: failure()
# uses: actions/upload-artifact@master
# with:
# name: logs.tgz
# path: ./logs.tgz
6 changes: 3 additions & 3 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"clean": "rimraf cache artifacts artifacts-ovm cache-ovm"
},
"devDependencies": {
"@eth-optimism/contracts": "^0.4.10",
"@eth-optimism/core-utils": "^0.5.2",
"@eth-optimism/contracts": "^0.4.13",
"@eth-optimism/core-utils": "^0.6.0",
"@eth-optimism/hardhat-ovm": "^0.2.3",
"@eth-optimism/message-relayer": "^0.1.11",
"@eth-optimism/message-relayer": "^0.1.13",
"@ethersproject/providers": "^5.4.4",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
Expand Down
12 changes: 12 additions & 0 deletions l2geth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.4.15

### Patch Changes

- 5c9b6343: Fix execution manager run

## 0.4.14

### Patch Changes

- 0d429564: Add ROLLUP_ENABLE_ARBITRARY_CONTRACT_DEPLOYMENT_FLAG

## 0.4.13

### Patch Changes
Expand Down
12 changes: 10 additions & 2 deletions l2geth/core/state_transition_ovm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ type ovmTransaction struct {
}

func toExecutionManagerRun(evm *vm.EVM, msg Message) (Message, error) {
to := msg.To()
if to == nil {
to = &common.Address{}
}
l1MsgSender := msg.L1MessageSender()
if l1MsgSender == nil {
l1MsgSender = &common.Address{}
}
tx := ovmTransaction{
evm.Context.Time,
msg.L1BlockNumber(),
uint8(msg.QueueOrigin()),
*msg.L1MessageSender(),
*msg.To(),
*l1MsgSender,
*to,
big.NewInt(int64(msg.Gas())),
msg.Data(),
}
Expand Down
18 changes: 18 additions & 0 deletions l2geth/core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,24 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
}
return callStateManager(input, evm, contract)
}

// Only in the case where EnableArbitraryContractDeployment is
// set, allows codepath to be skipped when it is not set
if EnableArbitraryContractDeployment != nil {
// When the address manager is called
if contract.Address() == WhitelistAddress {
// If the first four bytes match `isDeployerAllowed(address)`
if bytes.Equal(input[0:4], isDeployerAllowedSig) {
// Already checked to make sure this value is not nil
switch *EnableArbitraryContractDeployment {
case EnableArbitraryContractDeploymentTrue:
return AbiBytesTrue, nil
case EnableArbitraryContractDeploymentFalse:
return AbiBytesFalse, nil
}
}
}
}
}

if contract.CodeAddr != nil {
Expand Down
37 changes: 31 additions & 6 deletions l2geth/core/vm/ovm_state_dump.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
package vm

import (
"fmt"
"os"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)

// AbiBytesTrue represents the ABI encoding of "true" as a byte slice
var AbiBytesTrue = common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000001")
var (
// AbiBytesTrue represents the ABI encoding of "true" as a byte slice
AbiBytesTrue = common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000001")

// AbiBytesFalse represents the ABI encoding of "false" as a byte slice
var AbiBytesFalse = common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000")
// AbiBytesFalse represents the ABI encoding of "false" as a byte slice
AbiBytesFalse = common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000")

// UsingOVM is used to enable or disable functionality necessary for the OVM.
var UsingOVM bool
// UsingOVM is used to enable or disable functionality necessary for the OVM.
UsingOVM bool
// EnableArbitraryContractDeployment is used to override the
// deployer whitelist
EnableArbitraryContractDeployment *bool

// These are aliases to the pointer EnableArbitraryContractDeployment
EnableArbitraryContractDeploymentTrue bool = true
EnableArbitraryContractDeploymentFalse bool = false

WhitelistAddress = common.HexToAddress("0x4200000000000000000000000000000000000002")
isDeployerAllowedSig = crypto.Keccak256([]byte("isDeployerAllowed(address)"))[:4]
)

func init() {
UsingOVM = os.Getenv("USING_OVM") == "true"
value := os.Getenv("ROLLUP_ENABLE_ARBITRARY_CONTRACT_DEPLOYMENT")
if value != "" {
switch value {
case "true":
EnableArbitraryContractDeployment = &EnableArbitraryContractDeploymentTrue
case "false":
EnableArbitraryContractDeployment = &EnableArbitraryContractDeploymentFalse
default:
panic(fmt.Sprintf("Unknown ROLLUP_ENABLE_ARBITRARY_CONTRACT_DEPLOYMENT value: %s", value))
}
}
}
2 changes: 1 addition & 1 deletion l2geth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eth-optimism/l2geth",
"version": "0.4.13",
"version": "0.4.15",
"private": true,
"devDependencies": {}
}
5 changes: 5 additions & 0 deletions l2geth/rollup/sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -142,6 +143,10 @@ func NewSyncService(ctx context.Context, cfg Config, txpool *core.TxPool, bc *co
cfg.MinL2GasLimit = value
}

if vm.EnableArbitraryContractDeployment != nil {
log.Info("Setting arbitrary contract deployment", "value", *vm.EnableArbitraryContractDeployment)
}

service := SyncService{
ctx: ctx,
cancel: cancel,
Expand Down
1 change: 1 addition & 0 deletions ops/docker/Dockerfile.batch-submitter
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

FROM omgx/builder AS builder

FROM node:14-alpine
Expand Down
1 change: 1 addition & 0 deletions ops/docker/Dockerfile.deployer
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM omgx/builder AS builder

FROM node:14-alpine

RUN apk add --no-cache git curl python bash jq
Expand Down
11 changes: 11 additions & 0 deletions packages/batch-submitter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 0.3.14

### Patch Changes

- 39cea8fd: Removes the call to `appendQueueBatch` from the batch submitter
- Updated dependencies [e0be02e1]
- Updated dependencies [7f7f35c3]
- Updated dependencies [8da04505]
- @eth-optimism/core-utils@0.6.0
- @eth-optimism/contracts@0.4.13

## 0.3.13

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/batch-submitter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eth-optimism/batch-submitter",
"version": "0.3.13",
"version": "0.3.14",
"private": true,
"description": "[Optimism] Batch submission for sequencer & aggregators",
"main": "dist/index",
Expand Down Expand Up @@ -34,8 +34,8 @@
},
"dependencies": {
"@eth-optimism/common-ts": "^0.1.5",
"@eth-optimism/contracts": "^0.4.11",
"@eth-optimism/core-utils": "^0.5.5",
"@eth-optimism/contracts": "^0.4.13",
"@eth-optimism/core-utils": "^0.6.0",
"@eth-optimism/ynatm": "^0.2.2",
"@ethersproject/abstract-provider": "^5.4.1",
"@ethersproject/providers": "^5.4.4",
Expand Down
Loading

0 comments on commit 88794f5

Please sign in to comment.