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

[pull] develop from ethereum-optimism:develop #70

Merged
merged 46 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d168005
chore: reduce hardhat timeout to 20 seconds (#968)
maurelian May 28, 2021
245136f
fix: force LF line endings for scripts to avoid docker problems on Wi…
smartcontracts May 28, 2021
4e03f8a
feat: add hardhat deploy instructions to readme (#965)
karlfloersch May 29, 2021
a64f816
feat: fees v2 (#976)
tynes May 29, 2021
11a9296
Add static analysis action (#848)
elenadimitrova May 31, 2021
5a79849
build(deps): bump ws from 7.4.4 to 7.4.6 in /ops/docker/hardhat (#987)
dependabot[bot] May 31, 2021
86708bb
feat[message-relayer]: relay tx generator (#952)
smartcontracts Jun 1, 2021
1293825
backwards compatible dtl syncing (#986)
tynes Jun 1, 2021
5e3c5d1
fix[smock]: fix broken call assertions for overloaded functions (#996)
smartcontracts Jun 2, 2021
064c03a
fix[message-relayer]: remove spreadsheet mode (#998)
smartcontracts Jun 2, 2021
8082d16
Lower local rollup timestamp refresh (#985)
K-Ho Jun 2, 2021
c2b6e14
feat: fees v3 (#999)
tynes Jun 2, 2021
750a502
fix: remove dead coders (#1001)
tynes Jun 2, 2021
9d39121
docs[message-relayer]: add a README and improve the interface for gen…
smartcontracts Jun 2, 2021
e52ccd9
dtl: log error stack for failed http request (#995)
tynes Jun 2, 2021
a02392b
Add rpc-proxy service for whitelisting JSON RPC methods to the sequen…
optimisticben Jun 2, 2021
8e2bfd0
feat: deployment config for fee oracle contract (#936)
karlfloersch Jun 2, 2021
b355be0
ops: expose debug namespace (#1007)
tynes Jun 2, 2021
5e4eaea
fix(sync-service): prevent underflows (#1015)
gakonst Jun 3, 2021
d2ad599
test: remove duplicate value in array (#1014)
snario Jun 3, 2021
1c1e405
ci: tag docker image for canary with abbreviated GITHUB_SHA (#1006)
snario Jun 3, 2021
55ee461
refactor: improve logging for transactions being submitted to chain w…
snario Jun 3, 2021
ed9fc79
ci: upload logs for failed integration tests (#1020)
snario Jun 4, 2021
8ac4c74
fix(dtl): improve slow blocking JSON parsing that occurs during l2 sy…
timmyers Jun 4, 2021
e3dc90c
fix: lint errors in dtl (#1025)
karlfloersch Jun 6, 2021
a75f05b
fix[dtl]: fix dtl bug breaking verifiers (#1011)
smartcontracts Jun 7, 2021
cb4a928
fix: deterministic blockhashes (#1032)
tynes Jun 8, 2021
0cbaa9a
Version Packages (#978)
github-actions[bot] Jun 8, 2021
958477b
ci: add sync test's own workflow (#1031)
annieke Jun 8, 2021
1b69241
fix(dtl): incorrect parsing of eth_getBlockRange result (#1037)
timmyers Jun 8, 2021
0c18e19
Version Packages (#1045)
github-actions[bot] Jun 8, 2021
859437f
build(deps): bump glob-parent from 5.1.1 to 5.1.2 (#1036)
dependabot[bot] Jun 9, 2021
989a302
l2geth: optimize loops (#1027)
tynes Jun 9, 2021
c451060
Enable custom tagging of release docker image (#1048)
snario Jun 9, 2021
f03bb3e
ci: fix indentation issue of canary workflow
snario Jun 9, 2021
85d5ce1
ci: fix typo with GITHUB_SHA
snario Jun 9, 2021
cc74271
fix: typo in USE_HARDHAT config (#1023)
karlfloersch Jun 9, 2021
cc6c7f0
l2geth: bump to go 1.15 (#1058)
tynes Jun 10, 2021
98b7839
Change monotonicity band-aid code to log warnings not errors (#1060)
snario Jun 10, 2021
baa3b76
Ensure Sentry is correctly set up for DTL and MR (#1054)
snario Jun 11, 2021
85362d4
Add more logging information to monotonicity violation logs (#1066)
snario Jun 11, 2021
c520100
fix: monotonicity auto healer (#1070)
karlfloersch Jun 11, 2021
e389ba1
Version Packages (#1053)
github-actions[bot] Jun 11, 2021
6d7b12b
fix: comment out codeowners (#1073)
smartcontracts Jun 13, 2021
f409ce7
fix[l2geth]: off-by-one sometimes breaking replica sync (#1082)
smartcontracts Jun 14, 2021
d9fd67d
fix(l2geth): Log 'end of OVM execution' correctly (#1080)
maurelian Jun 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/chilled-books-grab.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/dull-fishes-type.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/lazy-toes-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/l2geth': patch
---

Fixes an off-by-one error that would sometimes break replica syncing when stopping and restarting geth.
5 changes: 0 additions & 5 deletions .changeset/neat-melons-lie.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nervous-bobcats-grow.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/ten-pumas-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/l2geth': patch
---

Correctly log 'end of OVM execution' message.
5 changes: 0 additions & 5 deletions .changeset/unlucky-shoes-bake.md

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
32 changes: 18 additions & 14 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
l2geth/ @smartcontracts @tynes @karlfloersch
packages/specs/l2geth/ @smartcontracts @tynes @karlfloersch
packages/contracts/ @smartcontracts @ben-chain @maurelian @elenadimitrova
packages/specs/protocol/ @smartcontracts @ben-chain @maurelian
ops/ @tynes @karlfloersch
packages/hardhat-ovm/ @smartcontracts
packages/smock/ @smartcontracts @maurelian
packages/core-utils/ @smartcontracts @annieke @ben-chain
packages/common-ts/ @annieke
packages/core-utils/src/watcher.ts @K-Ho
packages/message-relayer/ @K-Ho
packages/batch-submitter/ @annieke @karlfloersch
packages/data-transport-layer/ @annieke
integration-tests/ @tynes
# CODEOWNERS can be disruptive because it automatically requests review from individuals across the
# board. We still like to use this file to track who's working on what, but all lines are commented
# out so that GitHub won't trigger review requests.

# l2geth/ @smartcontracts @tynes @karlfloersch
# packages/specs/l2geth/ @smartcontracts @tynes @karlfloersch
# packages/contracts/ @smartcontracts @ben-chain @maurelian @elenadimitrova
# packages/specs/protocol/ @smartcontracts @ben-chain @maurelian
# ops/ @tynes @karlfloersch
# packages/hardhat-ovm/ @smartcontracts
# packages/smock/ @smartcontracts @maurelian
# packages/core-utils/ @smartcontracts @annieke @ben-chain
# packages/common-ts/ @annieke
# packages/core-utils/src/watcher.ts @K-Ho
# packages/message-relayer/ @K-Ho
# packages/batch-submitter/ @annieke @karlfloersch
# packages/data-transport-layer/ @annieke
# integration-tests/ @tynes
18 changes: 18 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,21 @@ jobs:
yarn compile
yarn compile:ovm
yarn test:integration:ovm

- 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,ethereumoptimism/integration-tests'
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
29 changes: 23 additions & 6 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ name: Publish Packages (canary)

on:
# enable users to manually trigger with workflow_dispatch
workflow_dispatch: {}
workflow_dispatch:
inputs:
customImageName:
description: 'Custom Docker Image Tag (keep empty for git hash)'
required: false
default: '0.0.0-rc-0'

jobs:
canary-publish:
Expand Down Expand Up @@ -66,6 +71,18 @@ jobs:
run: |
node ops/scripts/ci-versions.js ${{ toJSON(steps.changesets.outputs.publishedPackages) }}

- name: Docker Image Name
id: docker_image_name
run: |
if [ $CUSTOM_IMAGE_NAME == '' ]
then
echo "::set-output name=canary-docker-tag::${GITHUB_SHA::8}"
else
echo "::set-output name=canary-docker-tag::prerelease-$CUSTOM_IMAGE_NAME"
fi
env:
CUSTOM_IMAGE_NAME: ${{ github.event.inputs.customImageName }}


# The below code is duplicated, would be ideal if we could use a matrix with a
# key/value being dynamically generated from the `publishedPackages` output
Expand Down Expand Up @@ -155,7 +172,7 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.message-relayer
push: true
tags: ethereumoptimism/message-relayer:${{ needs.builder.outputs.message-relayer }}
tags: ethereumoptimism/message-relayer:${{ steps.docker_image_name.outputs.canary-docker-tag }}

batch-submitter:
name: Publish Batch Submitter Version ${{ needs.builder.outputs.batch-submitter }}
Expand All @@ -181,7 +198,7 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.batch-submitter
push: true
tags: ethereumoptimism/batch-submitter:${{ needs.builder.outputs.batch-submitter }}
tags: ethereumoptimism/batch-submitter:${{ steps.docker_image_name.outputs.canary-docker-tag }}

data-transport-layer:
name: Publish Data Transport Layer Version ${{ needs.builder.outputs.data-transport-layer }}
Expand All @@ -207,7 +224,7 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.data-transport-layer
push: true
tags: ethereumoptimism/data-transport-layer:${{ needs.builder.outputs.data-transport-layer }}
tags: ethereumoptimism/data-transport-layer:${{ steps.docker_image_name.outputs.canary-docker-tag }}

contracts:
name: Publish Deployer Version ${{ needs.builder.outputs.contracts }}
Expand All @@ -233,7 +250,7 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.deployer
push: true
tags: ethereumoptimism/deployer:${{ needs.builder.outputs.contracts }}
tags: ethereumoptimism/deployer:${{ steps.docker_image_name.outputs.canary-docker-tag }}

integration_tests:
name: Publish Integration tests ${{ needs.builder.outputs.integration-tests }}
Expand All @@ -259,4 +276,4 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.integration-tests
push: true
tags: ethereumoptimism/integration-tests:${{ needs.builder.outputs.integration-tests }}
tags: ethereumoptimism/integration-tests:${{ steps.docker_image_name.outputs.canary-docker-tag }}
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ jobs:
push: true
tags: ethereumoptimism/l2geth:${{ needs.release.outputs.l2geth }}

- name: Publish rpc-proxy
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.rpc-proxy
push: true
tags: ethereumoptimism/rpc-proxy:${{ needs.release.outputs.l2geth }}

# pushes the base builder image to dockerhub
builder:
name: Prepare the base builder image for the services
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Static analysis

on:
push:
branches:
- master
- develop
pull_request:
workflow_dispatch:

env:
PYTEST_ADDOPTS: "--color=yes"

jobs:
slither:
name: Slither run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Fetch history
run: git fetch

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install Dependencies
# only install dependencies if there was a change in the deps
# if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install

- name: Build
run: yarn build

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install Slither
run: pip3 install slither-analyzer

- name: Run analysis
working-directory: ./packages/contracts
shell: bash
run: yarn test:slither
continue-on-error: true
44 changes: 44 additions & 0 deletions .github/workflows/sync-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: sync-tests

on:
push:
branches:
- 'master'
- 'develop'
- 'regenesis/*'
pull_request:
workflow_dispatch:

jobs:
integration-sync-test:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build the services
working-directory: ./ops
run: ./scripts/build-ci.sh

- name: Bring the stack up
working-directory: ./ops
run: docker-compose up -d && ./scripts/wait-for-sequencer.sh

- name: Run the sync tests
working-directory: ./integration-tests
run: |
yarn
yarn test:sync
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ cache-ovm
l2geth/build/bin
packages/contracts/deployments/custom
packages/contracts/coverage*
packages/contracts/@ens*
packages/contracts/@openzeppelin*
packages/contracts/hardhat*

packages/data-transport-layer/db

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.17.0
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Extensive documentation is available [here](http://community.optimism.io/docs/)
* [`message-relayer`](./packages/message-relayer): Service for relaying L2 messages to L1
* [`l2geth`](./l2geth): Fork of [go-ethereum v1.9.10](https://github.com/ethereum/go-ethereum/tree/v1.9.10) implementing the [OVM](https://research.paradigm.xyz/optimism#optimistic-geth).
* [`integration-tests`](./integration-tests): Integration tests between a L1 testnet, `l2geth`,
* [`ops`](./ops): Contains Dockerfiles for containerizing each service involved in the protocol,
* [`ops`](./ops): Contains Dockerfiles for containerizing each service involved in the protocol,
as well as a docker-compose file for bringing up local testnets easily

## Quickstart

### Installation

Dependency management is done using `yarn`.
Dependency management is done using `yarn`.

```bash
git clone git@github.com:ethereum-optimism/optimism.git
Expand Down Expand Up @@ -67,7 +67,7 @@ you can run `yarn lerna run test --parallel --since master`
#### Running the integration tests

The integration tests first require bringing up the Optimism stack. This is done via
a Docker Compose network. For better performance, we also recommend enabling Docker
a Docker Compose network. For better performance, we also recommend enabling Docker
BuildKit

```bash
Expand Down Expand Up @@ -110,3 +110,11 @@ can be hard to filter through. In order to view the logs from a specific service
```
docker-compose logs --follow <service name>
```
### Static analysis

To run `slither` locally in `./packages/contracts` do

```
pip3 install slither-analyzer
yarn test:slither
```
3 changes: 2 additions & 1 deletion examples/truffle/truffle-config-ovm.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
host: '127.0.0.1',
port: 8545,
gasPrice: 0,
gas: 54180127,
}
},
compilers: {
Expand All @@ -31,4 +32,4 @@ module.exports = {
}
}
}
}
}
8 changes: 8 additions & 0 deletions integration-tests/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @eth-optimism/integration-tests

## 0.0.7

### Patch Changes

- d1680052: Reduce test timeout from 100 to 20 seconds
- c2b6e14b: Implement the latest fee spec such that the L2 gas limit is scaled and the tx.gasPrice/tx.gasLimit show correctly in metamask
- 77108d37: Add verifier sync test and extra docker-compose functions

## 0.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const enableGasReport = !!process.env.ENABLE_GAS_REPORT

const config: HardhatUserConfig = {
mocha: {
timeout: 100000,
timeout: 20000,
},
networks: {
optimism: {
Expand Down
Loading