Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solidity models of L2 precompiled contracts: ArbSys and ArbTxRetryable #105

Draft
wants to merge 90 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
dcc15e5
first step to remove manticore and avoid any logger issues
ggrieco-tob Sep 3, 2021
7828352
more stuff removed
ggrieco-tob Sep 3, 2021
f9ad032
Pin web3 dependency to >=3.16.4
elopez Dec 30, 2021
2b6186a
Pin manticore dependency to <=0.3.6
elopez Dec 30, 2021
a4cff34
Pin rlp version to <3 to stay compatible with manticore
elopez Dec 30, 2021
3a0902c
Update base image and Dockerfile format
elopez Dec 29, 2021
d8d8a60
Remove extra apt-get clean
elopez Dec 29, 2021
2b78c20
Drop Parity installation
elopez Dec 29, 2021
6d0829f
Install etheno globally
elopez Dec 29, 2021
5c8b29a
Update node to latest LTS version (16.x)
elopez Dec 30, 2021
ded7f1d
Simplify user creation
elopez Dec 30, 2021
de5a2c4
Fix Debian interactive installation, drop extra PATH environment
elopez Dec 30, 2021
d7d9df1
Use a separate stage to build python wheels
elopez Dec 30, 2021
1fc4b2d
Reorder apt packages
elopez Dec 30, 2021
24403e6
Re-add pip, use mount points in mnt
elopez Dec 30, 2021
06ff7e8
Drop locales-all to reduce image size
elopez Dec 30, 2021
bb97179
Drop unused `install-libff.sh` script
elopez Dec 30, 2021
ccc8df7
Update GitHub Action to build new Dockerfile and push to GHCR
elopez Dec 30, 2021
34770e6
Merge branch 'master' into dev-remove-manticore
anishnaik May 27, 2022
c41574f
removed manticore-based if statement in main.py
anishnaik May 27, 2022
7ebf117
fix if statement bc master_client is also technically a client
anishnaik May 27, 2022
8cf9e8a
added small todo
anishnaik May 27, 2022
d8b13fe
initial removal of echidna features
anishnaik May 27, 2022
9d69e66
final removal of manticore references
anishnaik Jun 27, 2022
63dd9c3
Release candidate 1 (rc-1) will be the next release of Etheno
anishnaik Jun 27, 2022
e1f7d36
Merge branch 'master' of github.com:crytic/etheno into dev-remove-man…
anishnaik Jun 27, 2022
3ec0d2f
Merge pull request #81 from crytic/dev-remove-manticore
anishnaik Jun 27, 2022
874475e
Merge branch 'rc-1' of github.com:crytic/etheno into dev-remove-echidna
anishnaik Jun 27, 2022
4ded2e9
commented out command line args and added back echidna.py file
anishnaik Jun 28, 2022
084097c
created venv and added back some removed code
anishnaik Jun 28, 2022
f9f3714
something with eggs
anishnaik Jun 28, 2022
3a7e121
Merge pull request #99 from crytic/dev-remove-echidna
anishnaik Jun 28, 2022
7aa9354
initial implementation of the L2 models for Arbitrum
ggrieco-tob Jun 29, 2022
c0bea15
emulation of ticket creation, extension and cancel
ggrieco-tob Jun 29, 2022
151578a
chainid for arbitrum
ggrieco-tob Jun 29, 2022
47ddf60
initial commit of updating ganache to v7.0+
anishnaik Jun 29, 2022
acadd42
Added some todo and one bug fix
anishnaik Jun 30, 2022
40bfb8f
Minor bugfix during event logging
anishnaik Jul 5, 2022
6d7296f
Updated flask shutdown methodology, allow unlimited contract size by …
anishnaik Jul 5, 2022
1bb8ce6
updated flask version and added some todos
anishnaik Jul 5, 2022
411cd0a
remove print statements
anishnaik Jul 5, 2022
caa6758
pin web3 version
anishnaik Jul 5, 2022
0c5e857
Initial documentation changes
anishnaik Jul 5, 2022
73cccc8
Merge branch 'dev-update-ganache' into docker-improvements
anishnaik Jul 6, 2022
12f5c0e
Merge pull request #89 from elopez/docker-improvements
anishnaik Jul 6, 2022
966967f
documentation updated
anishnaik Jul 6, 2022
126ff06
Merge pull request #107 from crytic/dev-update-documentation
anishnaik Jul 6, 2022
aa52872
removed manticore related commands
anishnaik Jul 6, 2022
98ee4c3
dependency nightmare resolved for now
anishnaik Jul 6, 2022
24de259
Use docker stage for ganache, build rusty-rlp wheel
elopez Jul 6, 2022
6bf7b26
Comment disabled setup.py dependencies
elopez Jul 6, 2022
748e42e
Disable cache for pip upgrade
elopez Jul 6, 2022
4857054
Remove extra sudo from node installation
elopez Jul 6, 2022
2855ae4
Upgrade Docker actions
elopez Jul 6, 2022
a323909
Enable multi-arch docker builds
elopez Jul 6, 2022
f57851a
docker hostname is now set properly
anishnaik Jul 7, 2022
643f35d
Merge branch 'rc-1' into dev-update-ganache
anishnaik Jul 7, 2022
0ee6b80
Merge pull request #106 from crytic/dev-update-ganache
anishnaik Jul 7, 2022
4d985dd
changelog and testing docker hub deployment
anishnaik Jul 7, 2022
0e08e3c
Reorder login and pushes, simplify Docker Hub names
elopez Jul 7, 2022
8e9a371
more updates to readme and disabled ganache-cmd cmd-line arg
anishnaik Jul 7, 2022
b972bf0
Merge branch 'rc-1' of github.com:crytic/etheno into rc-1
anishnaik Jul 7, 2022
7ec714e
added back ganache-cmd arg
anishnaik Jul 7, 2022
ad67ec0
i changed my mind, removing ganache-cmd
anishnaik Jul 7, 2022
1160d1c
added small todo
anishnaik Jul 7, 2022
18b87ea
removed rc-1 for testing
anishnaik Jul 7, 2022
1c5f440
v0.3.0-alpha launch
anishnaik Jul 7, 2022
e249419
resolving the continuous dependency nightmare
anishnaik Jul 7, 2022
c92fffc
let's try releasing again
anishnaik Jul 7, 2022
8154ef3
ready for alpha release
anishnaik Jul 7, 2022
abec4e2
loosening flask requirement
anishnaik Jul 7, 2022
242ed37
Apply suggestions from code review
anishnaik Jul 8, 2022
d4616b4
removed all unused code
anishnaik Jul 8, 2022
33d8b95
Merge branch 'rc-1' of github.com:crytic/etheno into rc-1
anishnaik Jul 8, 2022
2f66a9f
updated gitignore
anishnaik Jul 11, 2022
6fb5725
initial fix of not logging function calls in hardhat
anishnaik Jul 11, 2022
74db5e8
initial fix of not logging function calls in hardhat
anishnaik Jul 11, 2022
75770ca
removing unnecessary files
anishnaik Jul 11, 2022
676ef39
fix for transaction hash truncation
anishnaik Jul 11, 2022
68ec28c
Removed unused code and made getting an eth_getTransactionReceipt req…
anishnaik Jul 12, 2022
49a6dce
PEP 8 Compliance
anishnaik Jul 12, 2022
58b6b72
Removed a print statement from etheno.py
anishnaik Jul 12, 2022
0f0ad91
Merge pull request #109 from crytic/logging-bugfix
anishnaik Jul 12, 2022
d917212
Merge branch 'rc-1' of github.com:crytic/etheno into dev-l2-models
anishnaik Jul 12, 2022
38a7334
Isolate ArbSys and ArbRetryable for easier compilation
anishnaik Jul 12, 2022
3cfba58
Removed original arbos file
anishnaik Jul 12, 2022
ab7acd2
Set up Precompiler EthenoPlugin
anishnaik Jul 12, 2022
aea2229
Add override modifiers to all functions in ArbRetryableTxEmulated
anishnaik Jul 13, 2022
774513e
Arbitrum precompile contract deployments complete
anishnaik Jul 13, 2022
ec03e2a
Added small TODO to Dockerfile
anishnaik Jul 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 30 additions & 20 deletions .github/workflows/docker.yml
Expand Up @@ -8,18 +8,30 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: GitHub Login
uses: azure/docker-login@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
login-server: docker.pkg.github.com
install: true

- name: DockerHub Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: GitHub Container Registry Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker Package and Version
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
id: version
run: |
set +e
_=$(echo "$GITHUB_REF" | grep "^refs/heads/")
Expand All @@ -41,20 +53,18 @@ jobs:
PKG=etheno
fi
set -e
echo "::set-env name=PKG::$PKG"
echo "::set-env name=VER::$VER"
echo "::set-output name=PKG::$PKG"
echo "::set-output name=VER::$VER"

- name: Docker Build
run: docker build -t $PKG:$VER .

- name: DockerHub Login
uses: azure/docker-login@v1
- name: Docker build and push
uses: docker/build-push-action@v3
with:
login-server: registry.hub.docker.com
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Docker Push
run: |
docker tag $PKG:$VER registry.hub.docker.com/trailofbits/$PKG:$VER
docker push registry.hub.docker.com/trailofbits/$PKG:$VER
push: true
target: final
platforms: |
linux/arm64/v8
linux/amd64
tags: |
trailofbits/${{ steps.version.outputs.PKG }}:${{ steps.version.outputs.VER }}
ghcr.io/${{ github.repository }}/${{ steps.version.outputs.PKG }}:${{ steps.version.outputs.VER }}
9 changes: 5 additions & 4 deletions .github/workflows/pythonpublish.yml
Expand Up @@ -5,23 +5,24 @@ name: Upload Python Package

on:
release:
types: [created]
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
- name: Install and upgrade dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install --upgrade setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -2,3 +2,10 @@
*.pyc
build
dist
venv/
*egg*
init.json
tests/drizzle/node_modules/
tests/drizzle/artifacts/
tests/drizzle/yarn.lock
tests/drizzle/cache/
18 changes: 17 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,8 +2,24 @@

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [Unreleased](https://github.com/trailofbits/etheno/compare/v0.2.3...HEAD)
## [Unreleased](https://github.com/trailofbits/etheno/compare/v0.3.0...HEAD)

## 0.3.0 - 2022-07-08

### Changed
- We are now using `ganache` instead of `ganache-cli` for running Ganache
- Using the latest Flask version
- Python 3.7.x is now the lowest allowed version

### Fixed
- Fixed a bug that occurred when a `JSONRPCError` was being logged
- Fixed a bug that occurred when using non-hex strings during Ganache initialization
- Fixed a bug that prevented Ganache from being used from within a Docker container

### Removed
- Removed Manticore integration and all associated command-line parameters
- Removed Echidna integration and all associated command-line parameters
- Removed `examples/` folder since it is outdated and uses deprecated features
## 0.2.3 — 2019-06-27

### Added
Expand Down
108 changes: 62 additions & 46 deletions Dockerfile
@@ -1,69 +1,85 @@
FROM ubuntu:bionic
MAINTAINER Evan Sultanik

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
# syntax=docker/dockerfile:1.3
FROM ubuntu:focal AS python-wheels
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
python3-dev \
python3-pip \
python3-setuptools

# Needed for rusty-rlp wheel
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN --mount=type=bind,target=/etheno \
cd /etheno && \
pip3 install --no-cache-dir --upgrade pip setuptools && \
pip3 wheel --no-cache-dir -w /wheels \
https://github.com/cburgdorf/rusty-rlp/archive/refs/tags/0.1.15.tar.gz \
.


FROM ubuntu:focal AS ganache
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
gnupg \
lsb-release
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs
RUN npm install --omit=dev --location=global --prefix /opt/node ganache truffle


FROM ubuntu:focal AS final
LABEL org.opencontainers.image.authors="Evan Sultanik"

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bash-completion \
sudo \
ca-certificates \
curl \
gpg-agent \
libudev-dev \
locales \
python3 \
libpython3-dev \
python3-pip \
python3-setuptools \
git \
build-essential \
software-properties-common \
locales-all locales \
libudev-dev \
gpg-agent \
&& apt-get clean \
sudo \
&& rm -rf /var/lib/apt/lists/*

RUN DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:ethereum/ethereum && \
# NOTE: solc was removed from the below command since the echidna integration is being removed
# If the solc option is added back, --platform linux-amd64 needs to be added to the `docker build` command for M1 machines
RUN add-apt-repository -y ppa:ethereum/ethereum && \
apt-get update && apt-get install -y --no-install-recommends \
solc \
ethereum \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y --no-install-recommends nodejs && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN npm install --production -g ganache-cli truffle && npm --force cache clean

# BEGIN Install Echidna

COPY --from=trailofbits/echidna:latest /root/.local/bin/echidna-test /usr/local/bin/echidna-test

RUN update-locale LANG=en_US.UTF-8 && locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \
apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*

# END Install Echidna
COPY --from=ganache /opt/node /usr/local/

RUN useradd -m etheno
RUN usermod -aG sudo etheno
USER etheno
WORKDIR /home/etheno
USER root
WORKDIR /root
# BEGIN Install Etheno
RUN --mount=type=bind,target=/mnt/etheno \
--mount=type=bind,target=/mnt/wheels,source=/wheels,from=python-wheels \
cd /mnt/etheno && \
pip3 install --no-cache-dir --upgrade pip setuptools && \
pip3 install --no-cache-dir --no-index --find-links /mnt/wheels .

# Install Parity
RUN curl https://get.parity.io -L | bash
RUN useradd -m -G sudo etheno

# Allow passwordless sudo for etheno
RUN echo 'etheno ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

USER etheno
ENV HOME=/home/etheno PATH=$PATH:/home/etheno/.local/bin
WORKDIR /home/etheno
ENV HOME=/home/etheno

COPY --chown=etheno:etheno LICENSE setup.py etheno/
COPY --chown=etheno:etheno etheno/*.py etheno/etheno/
RUN cd etheno && \
pip3 install --no-cache-dir --user '.[manticore]' && \
cd .. && \
rm -rf etheno

COPY --chown=etheno:etheno examples examples/
# Use the DOCKER env variable to set hostname accordingly
ENV DOCKER=1
WORKDIR /home/etheno

# TODO: Need to copy tests and models
CMD ["/bin/bash"]