Skip to content
This repository was archived by the owner on Dec 5, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
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/neat-melons-lie.md

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@eth-optimism/data-transport-layer': patch
---

Represent gaslimit as a string to avoid an overflow
incorrect parsing of eth_getBlockRange result
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
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
10 changes: 5 additions & 5 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.message-relayer
push: true
tags: ethereumoptimism/message-relayer:${{ needs.builder.outputs.message-relayer }}
tags: ethereumoptimism/message-relayer:${{ GITHUB_SHA::8 }}

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

data-transport-layer:
name: Publish Data Transport Layer Version ${{ needs.builder.outputs.data-transport-layer }}
Expand All @@ -207,7 +207,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:${{ GITHUB_SHA::8 }}

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

integration_tests:
name: Publish Integration tests ${{ needs.builder.outputs.integration-tests }}
Expand All @@ -259,4 +259,4 @@ jobs:
context: .
file: ./ops/docker/Dockerfile.integration-tests
push: true
tags: ethereumoptimism/integration-tests:${{ needs.builder.outputs.integration-tests }}
tags: ethereumoptimism/integration-tests:${{ GITHUB_SHA::8 }}
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 [email protected]: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
6 changes: 3 additions & 3 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eth-optimism/integration-tests",
"version": "0.0.6",
"version": "0.0.7",
"description": "[Optimism] Integration Tests",
"private": true,
"author": "Optimism PBC",
Expand All @@ -17,8 +17,8 @@
"clean": "rimraf cache artifacts artifacts-ovm cache-ovm"
},
"devDependencies": {
"@eth-optimism/contracts": "^0.3.4",
"@eth-optimism/core-utils": "^0.4.4",
"@eth-optimism/contracts": "^0.3.5",
"@eth-optimism/core-utils": "^0.4.5",
"@eth-optimism/hardhat-ovm": "^0.2.2",
"@ethersproject/providers": "^5.0.24",
"@nomiclabs/hardhat-ethers": "^2.0.2",
Expand Down
10 changes: 9 additions & 1 deletion integration-tests/sync-tests/sync-verifier.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Syncing a verifier', () => {
})

describe('Basic transactions', () => {
afterEach(async () => {
after(async () => {
await verifier.stop('verifier')
await verifier.rm()
})
Expand Down Expand Up @@ -97,5 +97,13 @@ describe('Syncing a verifier', () => {
latestSequencerBlock.stateRoot
)
})

it('should have matching block data', async () => {
const sequencerTip = await sequencerProvider.getBlock('latest')
const verifierTip = await provider.getBlock('latest')

expect(sequencerTip.number).to.deep.eq(verifierTip.number)
expect(sequencerTip.hash).to.deep.eq(verifierTip.hash)
})
})
})
6 changes: 5 additions & 1 deletion integration-tests/test/erc20.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Contract, ContractFactory, Wallet } from 'ethers'
import { ethers } from 'hardhat'
import { TxGasLimit, TxGasPrice } from '@eth-optimism/core-utils'
import chai, { expect } from 'chai'
import { GWEI } from './shared/utils'
import { OptimismEnv } from './shared/env'
Expand Down Expand Up @@ -64,7 +65,10 @@ describe('Basic ERC20 interactions', async () => {
const receipt = await transfer.wait()

// The expected fee paid is the value returned by eth_estimateGas
const expectedFeePaid = await ERC20.estimateGas.transfer(other.address, 100)
const gasLimit = await ERC20.estimateGas.transfer(other.address, 100)
const gasPrice = await wallet.getGasPrice()
expect(gasPrice).to.deep.equal(TxGasPrice)
const expectedFeePaid = gasLimit.mul(gasPrice)

// There are two events from the transfer with the first being
// the ETH fee paid and the second of the value transfered (100)
Expand Down
Loading