Skip to content

Commit

Permalink
Merge pull request #400 from OffchainLabs/develop
Browse files Browse the repository at this point in the history
Release Develop Branch
  • Loading branch information
edfelten authored Aug 31, 2020
2 parents d4dc5a2 + 9406835 commit 5b18063
Show file tree
Hide file tree
Showing 997 changed files with 224,843 additions and 113,653 deletions.
179 changes: 70 additions & 109 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ aliases:
paths:
- ~/.cache/yarn
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- &restore_python_cache
keys:
- python-packages-v2-{{ .Branch }}-{{ checksum "packages/arb-compiler-evm/requirements.txt" }}
- python-packages-v2-{{ .Branch }}-
- python-packages-v2-
- &save_python_cache
paths:
- ~/.local/lib/python3.7/site-packages
key: python-packages-v2-{{ .Branch }}-{{ checksum "packages/arb-compiler-evm/requirements.txt" }}
- &restore_ethbridge_cache
keys:
- yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
Expand All @@ -36,16 +27,8 @@ aliases:
key: go-mod-v7-{{ .Branch }}-{{ checksum "packages/arb-validator/go.sum" }}
paths:
- ~/go/pkg/mod
- &restore_conan_cache
keys:
- conan-packages-v2-{{ .Branch }}-{{ checksum "packages/arb-avm-cpp/conanfile.txt" }}
- conan-packages-v2-{{ .Branch }}-
- conan-packages-v2-
- &save_conan_cache
paths:
- ~/.conan/data
key: conan-packages-v2-{{ .Branch }}-{{ checksum "packages/arb-avm-cpp/conanfile.txt" }}
- &test-path /tmp/test-results
- &ethbridge-test-path /tmp/test-results/ethbridge.xml
version: 2
workflows:
version: 2
Expand All @@ -59,16 +42,14 @@ workflows:
requires:
- go-deps
- cpp-avm
- ethbridge
- backend-integration:
requires:
- go-deps
- cpp-avm
- ethbridge
jobs:
go-deps:
docker:
- image: offchainlabs/backend-base:0.2.1
- image: offchainlabs/backend-base:0.2.8
steps:
- checkout
- restore_cache: *restore_go_cache
Expand All @@ -88,46 +69,13 @@ jobs:
- restore_cache: *restore_yarn_cache
- run: yarn install --cache-folder ~/.cache/yarn
- save_cache: *save_yarn_cache
- restore_cache: *restore_python_cache
- run:
command: | # use pipenv to install dependencies
pip3 install --user -r requirements.txt
python3 setup.py install --user
working_directory: /home/user/project/packages/arb-compiler-evm
- save_cache: *save_python_cache
- run:
name: test arb-compiler-evm
command: |
python3 setup.py nosetests --processes=2 --process-timeout=120 --with-coverage --cover-package=arbitrum --with-xunit --xunit-file=${TEST_RESULTS}/arb-compiler-evm.xml
working_directory: /home/user/project/packages/arb-compiler-evm
- run:
name: test arb-provider-ethers
command: |
yarn
yarn test --coverage --ci --runInBand --reporters=default --reporters=jest-junit
yarn test:ci --reporter-options output=${TEST_RESULTS}/arb-provider-ethers.xml
yarn lint --format junit -o ${TEST_RESULTS}/arb-provider-ethers-lint.xml
environment:
JEST_JUNIT_OUTPUT_DIR: *test-path
JEST_JUNIT_OUTPUT_NAME: arb-provider-ethers.xml
working_directory: /home/user/project/packages/arb-provider-ethers
- run:
name: test arb-provider-web3
command: |
yarn test --pass-with-no-tests --coverage --ci --runInBand --reporters=default --reporters=jest-junit
yarn lint --format junit -o ${TEST_RESULTS}/arb-provider-web3-lint.xml
environment:
JEST_JUNIT_OUTPUT_DIR: *test-path
JEST_JUNIT_OUTPUT_NAME: arb-provider-web3.xml
working_directory: /home/user/project/packages/arb-provider-web3
- run:
name: test arb-provider-truffle
command: |
yarn test --pass-with-no-tests --coverage --ci --runInBand --reporters=default --reporters=jest-junit
yarn lint --format junit -o ${TEST_RESULTS}/arb-provider-truffle-lint.xml
environment:
JEST_JUNIT_OUTPUT_DIR: *test-path
JEST_JUNIT_OUTPUT_NAME: arb-provider-truffle.xml
working_directory: /home/user/project/packages/arb-provider-truffle
- run:
name: Upload Coverage to Codecov
command: codecovbash
Expand All @@ -136,70 +84,87 @@ jobs:
path: *test-path
ethbridge:
docker:
- image: offchainlabs/ethbridge-base:0.2.0
- image: offchainlabs/ethbridge-base:0.2.1
environment: # environment variables for the build itself
TEST_RESULTS: *test-path # path to where test results will be saved
steps:
- checkout
- run: mv /home/user/project/packages/arb-bridge-eth /home/user/
- run: mkdir -p $TEST_RESULTS
- restore_cache: *restore_yarn_cache
- run:
name: install
command: |
yarn
echo arbitrum > ~/password.txt
mkdir data
geth --datadir data init geth/ethbridge.json
cp geth/keystore/* data/keystore
working_directory: /home/user/arb-bridge-eth
yarn install --cache-folder ~/.cache/yarn
yarn build
working_directory: /home/user/project
- run:
command: geth --datadir data --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcport 7545 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --allow-insecure-unlock --unlock 0x81183c9c61bdf79db7330bbcda47be30c0a85064 --password ~/password.txt --mine
name: test arb-bridge-eth
command: |
yarn test:coverage
yarn lint:js --format junit -o ${TEST_RESULTS}/arb-bridge-eth-lint.xml
yarn lint:solidity
environment:
MOCHA_FILE: *ethbridge-test-path
working_directory: /home/user/project/packages/arb-bridge-eth
- run:
command: yarn buidler node
background: true
working_directory: /home/user/arb-bridge-eth
- run: while ! nc -z localhost 7545; do sleep 2; done
working_directory: /home/user/project/packages/arb-bridge-eth
- run: while ! nc -z localhost 8545; do sleep 2; done
- run:
name: test arb-bridge-eth
name: test arb-bridge-eth gas usage
command: |
truffle migrate --network parity
working_directory: /home/user/arb-bridge-eth
- run: cat /home/user/arb-bridge-eth/bridge_eth_addresses.json
- run: killall geth
- persist_to_workspace: # store the built files into the workspace for other jobs.
root: /home/user/arb-bridge-eth
paths:
- data
yarn test:gas:ci
working_directory: /home/user/project/packages/arb-bridge-eth
- run:
name: codechecks
command: npx codechecks
working_directory: /home/user/project
- run:
name: Upload Coverage to Codecov
command: codecovbash -R /home/user/project -c -F unit
working_directory: /home/user/project/packages
- store_test_results:
path: *test-path

cpp-avm:
docker:
- image: offchainlabs/cpp-base:0.2.0
- image: offchainlabs/cpp-base:0.2.5
environment: # environment variables for the build itself
TEST_RESULTS: *test-path # path to where test results will be saved
steps:
- checkout
- run:
name: 'Pull Submodules'
command: |
git submodule update --init --recursive
- run: mkdir -p $TEST_RESULTS
- restore_cache: *restore_conan_cache
- run:
command: |
mkdir -p packages/arb-avm-cpp/build
cd packages/arb-avm-cpp/build
conan install ..
mkdir -p packages/arb-avm-cpp/debug
cd packages/arb-avm-cpp/debug
cmake -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=True ..
cmake --build . -j 2
cp lib/lib* ../cmachine/
- save_cache: *save_conan_cache
cd ../
./scripts/install-cmachine-debug
- run:
name: test arb-avm-cpp
command: |
./bin/avm_tests -r junit > ${TEST_RESULTS}/arb-avm-cpp.xml
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info --output-file coverage.info '*/.conan/*' '/usr/*' '*/tests/*' '*/external/*'
lcov --remove coverage.info --output-file coverage.info '/usr/*' '*/tests/*' '*/external/*'
lcov --list coverage.info
working_directory: /home/user/project/packages/arb-avm-cpp/build
working_directory: /home/user/project/packages/arb-avm-cpp/debug
- persist_to_workspace: # store the built files into the workspace for other jobs.
root: /home/user/project/packages/arb-avm-cpp/cmachine
paths:
- ./*.a
- run: codecovbash -R /home/user/project
- run: codecovbash -R /home/user/project -c -F unit
- store_test_results:
path: *test-path
backend:
docker:
- image: offchainlabs/backend-base:0.2.3
- image: offchainlabs/backend-base:0.2.8
environment: # environment variables for the build itself
TEST_RESULTS: *test-path # path to where test results will be saved
steps:
Expand All @@ -210,20 +175,13 @@ jobs:
- run:
command: |
echo arbitrum > ~/password.txt
cp -r /home/user/workspace/data /home/user/project/packages/arb-bridge-eth
cp /home/user/workspace/*.a /home/user/project/packages/arb-avm-cpp/cmachine
- restore_cache: *restore_go_cache
- run:
command: |
cd packages/arb-validator
export CGO_LDFLAGS="-lgcov --coverage"
go install -v ./...
- run:
name: start geth
command: geth --datadir data --rpc --rpcaddr 'localhost' --rpcport 7545 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --ws --wsaddr 0.0.0.0 --wsport 7546 --wsorigins '*' --wsapi personal,admin,db,eth,net,web3,miner,shh,txpool,debug --allow-insecure-unlock --unlock 0x81183c9c61bdf79db7330bbcda47be30c0a85064 --password ~/password.txt --mine
background: true
working_directory: /home/user/project/packages/arb-bridge-eth
- run: while ! nc -z localhost 7545; do sleep 2; done
- run:
name: test arb-util
command: |
Expand All @@ -241,14 +199,6 @@ jobs:
cd arb-avm-cpp
gotestsum --format short-verbose --junitfile ${TEST_RESULTS}/arb-avm-cpp.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$ARB_PACKAGES ./...
working_directory: /home/user/project/packages/arb-avm-cpp
- run:
name: test arb-avm-go
command: |
cd ..
export ARB_PACKAGES=$(go list ./... | grep -v 'evilRollupServer' | awk -vORS=, '{ print "github.com/offchainlabs/arbitrum/"substr($1,21) }' | sed 's/,$/\n/')
cd arb-avm-go
gotestsum --format short-verbose --junitfile ${TEST_RESULTS}/arb-avm-go.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$ARB_PACKAGES ./...
working_directory: /home/user/project/packages/arb-avm-go
- run:
name: test arb-validator-core
command: |
Expand Down Expand Up @@ -276,13 +226,31 @@ jobs:
cd arb-provider-go
gotestsum --format short-verbose --junitfile ${TEST_RESULTS}/arb-provider-go.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$ARB_PACKAGES ./...
working_directory: /home/user/project/packages/arb-provider-go
- run:
name: test arb-evm
command: |
export CGO_LDFLAGS="-lgcov --coverage"
cd ..
export ARB_PACKAGES=$(go list ./... | grep -v 'evilRollupServer' | awk -vORS=, '{ print "github.com/offchainlabs/arbitrum/"substr($1,21) }' | sed 's/,$/\n/')
cd arb-evm
gotestsum --format short-verbose --junitfile ${TEST_RESULTS}/arb-evm.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$ARB_PACKAGES ./...
working_directory: /home/user/project/packages/arb-evm
- run:
name: test arb-tx-aggregator
command: |
export CGO_LDFLAGS="-lgcov --coverage"
cd ..
export ARB_PACKAGES=$(go list ./... | grep -v 'evilRollupServer' | awk -vORS=, '{ print "github.com/offchainlabs/arbitrum/"substr($1,21) }' | sed 's/,$/\n/')
cd arb-tx-aggregator
gotestsum --format short-verbose --junitfile ${TEST_RESULTS}/arb-tx-aggregator.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$ARB_PACKAGES ./...
working_directory: /home/user/project/packages/arb-tx-aggregator
- run: codecovbash -R /home/user/project -c -F unit
- store_test_results:
path: *test-path

backend-integration:
docker:
- image: offchainlabs/backend-base:0.2.3
- image: offchainlabs/backend-base:0.2.8
environment: # environment variables for the build itself
TEST_RESULTS: *test-path # path to where test results will be saved
steps:
Expand All @@ -293,20 +261,13 @@ jobs:
- run:
command: |
echo arbitrum > ~/password.txt
cp -r /home/user/workspace/data /home/user/project/packages/arb-bridge-eth
cp /home/user/workspace/*.a /home/user/project/packages/arb-avm-cpp/cmachine
- restore_cache: *restore_go_cache
- run:
command: |
cd packages/arb-validator
export CGO_LDFLAGS="-lgcov --coverage"
go install -v ./...
- run:
name: start geth
command: geth --datadir data --rpc --rpcaddr 'localhost' --rpcport 7545 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --ws --wsaddr 0.0.0.0 --wsport 7546 --wsorigins '*' --wsapi personal,admin,db,eth,net,web3,miner,shh,txpool,debug --allow-insecure-unlock --unlock 0x81183c9c61bdf79db7330bbcda47be30c0a85064 --password ~/password.txt --mine
background: true
working_directory: /home/user/project/packages/arb-bridge-eth
- run: while ! nc -z localhost 7545; do sleep 2; done
- run:
name: test fibgo
command: |
Expand Down
11 changes: 7 additions & 4 deletions .circleci/images/backend-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM debian:buster-slim

RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \
apt-get install -y curl git golang librocksdb-dev libgmp-dev sudo netcat-openbsd && \
apt-get install -y curl git librocksdb-dev libgmp-dev sudo netcat-openbsd gcc g++ && \
rm -rf /var/lib/apt/lists/* && \
curl https://get.parity.io -L | bash /dev/stdin -r stable && \
curl https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz --output go1.13.3.linux-amd64.tar.gz && \
tar -xf go1.13.3.linux-amd64.tar.gz && \
mv go /usr/local && \
useradd -ms /bin/bash user
USER user
WORKDIR /home/user/
ENV PATH="/home/user/go/bin:/home/user/bin:/home/user/.local/bin:/home/user/.yarn/bin:${PATH}"
RUN mkdir bin && curl -s https://codecov.io/bash > ~/bin/codecovbash && \
ENV PATH="/usr/local/go/bin:/home/user/go/bin:/home/user/bin:/home/user/.local/bin:/home/user/.yarn/bin:${PATH}"
RUN export GOROOT=/usr/local/go && \
mkdir bin && curl -s https://codecov.io/bash > ~/bin/codecovbash && \
chmod +x /home/user/bin/codecovbash && \
curl -O https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.9-01744997.tar.gz && \
tar xvzf geth-linux-amd64-1.9.9-01744997.tar.gz && \
Expand Down
34 changes: 4 additions & 30 deletions .circleci/images/cpp-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,18 @@
### --------------------------------------------------------------------
### Dockerfile
### arb-validator
### Note: run depends on mounting `/home/user/contract.ao` as a volume
### cpp-base
### --------------------------------------------------------------------

# FROM alpine:3.10
# # Alpine dependencies
# RUN apk update && apk add --no-cache bash boost-dev cmake curl findutils g++ git \
# make musl-dev perl python3 python3-dev && \
# apk add rocksdb-dev --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && \
# pip3 install --upgrade pip && \
# pip3 install conan && \
# addgroup -g 1000 -S user && \
# adduser -u 1000 -S user -G user -s /bin/ash -h /home/user && \
# mkdir -p /usr/local/etc && \
# chown -R user:user /usr/local/bin /usr/local/share /usr/local/etc
# USER user
# WORKDIR "/home/user/"
# RUN wget https://codecov.io/bash && chmod +x bash && \
# mv bash /usr/local/bin/codecovbash && \
# conan profile new default --detect && \
# conan profile update settings.compiler.libcxx=libstdc++11 default && \
# conan remote add nonstd-lite https://api.bintray.com/conan/martinmoene/nonstd-lite && \
# wget http://downloads.sourceforge.net/ltp/lcov-1.14.tar.gz && \
# tar -xvf lcov-1.14.tar.gz && cd lcov-1.14 && make install

FROM debian:buster-slim

RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \
apt-get install -y cmake curl git g++ libboost-dev libboost-filesystem-dev \
lcov librocksdb-dev make python3 python3-dev python3-pip && \
lcov librocksdb-dev make libgmp-dev libssl-dev \
autotools-dev dh-autoreconf && \
rm -rf /var/lib/apt/lists/* && \
python3 -m pip install --upgrade pip && \
pip3 install conan && \
useradd -ms /bin/bash user
USER user
WORKDIR /home/user/
ENV PATH="/home/user/go/bin:/home/user/bin:/home/user/.local/bin:/home/user/.yarn/bin:${PATH}"
RUN mkdir bin && curl -s https://codecov.io/bash > ~/bin/codecovbash && \
chmod +x /home/user/bin/codecovbash && \
conan profile new default --detect && \
conan profile update settings.compiler.libcxx=libstdc++11 default && \
conan remote add nonstd-lite https://api.bintray.com/conan/martinmoene/nonstd-lite
chmod +x /home/user/bin/codecovbash
4 changes: 2 additions & 2 deletions .circleci/images/ethbridge-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM ethereum/client-go:stable

RUN apk add --no-cache bash curl findutils git mercurial nodejs npm psmisc python2 sudo && \
RUN apk add --no-cache bash curl findutils git mercurial nodejs npm psmisc python2 sudo make g++ && \
addgroup -g 1000 -S user && \
adduser -u 1000 -S user -G user -s /bin/ash -h /home/user
USER user
WORKDIR /home/user/
ENV PATH="/home/user/bin:/home/user/.local/bin:/home/user/.npm-global/bin:${PATH}"
RUN mkdir -p /home/user/.npm-global && \
npm config set prefix "/home/user/.npm-global" && \
npm install -g truffle yarn && \
npm install -g yarn && \
mkdir bin && curl -s https://codecov.io/bash > ~/bin/codecovbash && \
chmod +x /home/user/bin/codecovbash
ENTRYPOINT ["/bin/ash"]
Loading

0 comments on commit 5b18063

Please sign in to comment.