Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 3e823d3

Browse files
authored
Merge pull request #104 from crytic/rc-1
Next release candidate
2 parents 8914c2d + 6f75d8d commit 3e823d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1983
-1994
lines changed

.github/workflows/docker.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,30 @@ jobs:
88
docker:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- name: Set up QEMU
12+
uses: docker/setup-qemu-action@v2
1213

13-
- name: GitHub Login
14-
uses: azure/docker-login@v1
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v2
16+
id: buildx
1517
with:
16-
login-server: docker.pkg.github.com
18+
install: true
19+
20+
- name: DockerHub Login
21+
uses: docker/login-action@v2
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
25+
26+
- name: GitHub Container Registry Login
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ghcr.io
1730
username: ${{ github.actor }}
1831
password: ${{ secrets.GITHUB_TOKEN }}
1932

2033
- name: Set Docker Package and Version
21-
env:
22-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
34+
id: version
2335
run: |
2436
set +e
2537
_=$(echo "$GITHUB_REF" | grep "^refs/heads/")
@@ -41,20 +53,18 @@ jobs:
4153
PKG=etheno
4254
fi
4355
set -e
44-
echo "::set-env name=PKG::$PKG"
45-
echo "::set-env name=VER::$VER"
56+
echo "::set-output name=PKG::$PKG"
57+
echo "::set-output name=VER::$VER"
4658
47-
- name: Docker Build
48-
run: docker build -t $PKG:$VER .
4959
50-
- name: DockerHub Login
51-
uses: azure/docker-login@v1
60+
- name: Docker build and push
61+
uses: docker/build-push-action@v3
5262
with:
53-
login-server: registry.hub.docker.com
54-
username: ${{ secrets.DOCKERHUB_USERNAME }}
55-
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
56-
57-
- name: Docker Push
58-
run: |
59-
docker tag $PKG:$VER registry.hub.docker.com/trailofbits/$PKG:$VER
60-
docker push registry.hub.docker.com/trailofbits/$PKG:$VER
63+
push: true
64+
target: final
65+
platforms: |
66+
linux/arm64/v8
67+
linux/amd64
68+
tags: |
69+
trailofbits/${{ steps.version.outputs.PKG }}:${{ steps.version.outputs.VER }}
70+
ghcr.io/${{ github.repository }}/${{ steps.version.outputs.PKG }}:${{ steps.version.outputs.VER }}

.github/workflows/pythonpublish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Upload Python Package
55

66
on:
77
release:
8-
types: [created]
8+
types: [published]
99

1010
jobs:
1111
deploy:
@@ -15,13 +15,14 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Set up Python
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: '3.x'
21-
- name: Install dependencies
21+
- name: Install and upgrade dependencies
2222
run: |
2323
python -m pip install --upgrade pip
2424
pip install setuptools wheel twine
25+
pip install --upgrade setuptools wheel twine
2526
- name: Build and publish
2627
env:
2728
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
*.pyc
33
build
44
dist
5+
venv/
6+
*egg*
7+
init.json
8+
tests/drizzle/node_modules/
9+
tests/drizzle/artifacts/
10+
tests/drizzle/yarn.lock
11+
tests/drizzle/cache/

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,24 @@
22

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

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

7+
## 0.3.0 - 2022-07-08
8+
9+
### Changed
10+
- We are now using `ganache` instead of `ganache-cli` for running Ganache
11+
- Using the latest Flask version
12+
- Python 3.7.x is now the lowest allowed version
13+
14+
### Fixed
15+
- Fixed a bug that occurred when a `JSONRPCError` was being logged
16+
- Fixed a bug that occurred when using non-hex strings during Ganache initialization
17+
- Fixed a bug that prevented Ganache from being used from within a Docker container
18+
19+
### Removed
20+
- Removed Manticore integration and all associated command-line parameters
21+
- Removed Echidna integration and all associated command-line parameters
22+
- Removed `examples/` folder since it is outdated and uses deprecated features
723
## 0.2.3 — 2019-06-27
824

925
### Added

Dockerfile

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,84 @@
1-
FROM ubuntu:bionic
2-
MAINTAINER Evan Sultanik
3-
4-
RUN DEBIAN_FRONTEND=noninteractive \
5-
apt-get update && apt-get install -y --no-install-recommends \
1+
# syntax=docker/dockerfile:1.3
2+
FROM ubuntu:focal AS python-wheels
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4+
build-essential \
5+
ca-certificates \
6+
cmake \
67
curl \
8+
python3-dev \
9+
python3-pip \
10+
python3-setuptools
11+
12+
# Needed for rusty-rlp wheel
13+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
14+
ENV PATH="/root/.cargo/bin:${PATH}"
15+
16+
RUN --mount=type=bind,target=/etheno \
17+
cd /etheno && \
18+
pip3 install --no-cache-dir --upgrade pip setuptools && \
19+
pip3 wheel --no-cache-dir -w /wheels \
20+
https://github.com/cburgdorf/rusty-rlp/archive/refs/tags/0.1.15.tar.gz \
21+
.
22+
23+
24+
FROM ubuntu:focal AS ganache
25+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
26+
build-essential \
727
ca-certificates \
28+
curl \
29+
gnupg \
30+
lsb-release
31+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \
32+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs
33+
RUN npm install --omit=dev --location=global --prefix /opt/node ganache truffle
34+
35+
36+
FROM ubuntu:focal AS final
37+
LABEL org.opencontainers.image.authors="Evan Sultanik"
38+
39+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
840
bash-completion \
9-
sudo \
41+
ca-certificates \
42+
curl \
43+
gpg-agent \
44+
libudev-dev \
45+
locales \
1046
python3 \
11-
libpython3-dev \
1247
python3-pip \
13-
python3-setuptools \
14-
git \
15-
build-essential \
1648
software-properties-common \
17-
locales-all locales \
18-
libudev-dev \
19-
gpg-agent \
20-
&& apt-get clean \
49+
sudo \
2150
&& rm -rf /var/lib/apt/lists/*
2251

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

30-
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/*
31-
32-
RUN npm install --production -g ganache-cli truffle && npm --force cache clean
33-
34-
# BEGIN Install Echidna
35-
36-
COPY --from=trailofbits/echidna:latest /root/.local/bin/echidna-test /usr/local/bin/echidna-test
37-
38-
RUN update-locale LANG=en_US.UTF-8 && locale-gen en_US.UTF-8
39-
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
59+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \
60+
apt-get install -y --no-install-recommends nodejs \
61+
&& rm -rf /var/lib/apt/lists/*
4062

41-
# END Install Echidna
63+
COPY --from=ganache /opt/node /usr/local/
4264

43-
RUN useradd -m etheno
44-
RUN usermod -aG sudo etheno
45-
USER etheno
46-
WORKDIR /home/etheno
47-
USER root
48-
WORKDIR /root
65+
# BEGIN Install Etheno
66+
RUN --mount=type=bind,target=/mnt/etheno \
67+
--mount=type=bind,target=/mnt/wheels,source=/wheels,from=python-wheels \
68+
cd /mnt/etheno && \
69+
pip3 install --no-cache-dir --upgrade pip setuptools && \
70+
pip3 install --no-cache-dir --no-index --find-links /mnt/wheels .
4971

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

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

5677
USER etheno
57-
ENV HOME=/home/etheno PATH=$PATH:/home/etheno/.local/bin
58-
WORKDIR /home/etheno
78+
ENV HOME=/home/etheno
5979

60-
COPY --chown=etheno:etheno LICENSE setup.py etheno/
61-
COPY --chown=etheno:etheno etheno/*.py etheno/etheno/
62-
RUN cd etheno && \
63-
pip3 install --no-cache-dir --user '.[manticore]' && \
64-
cd .. && \
65-
rm -rf etheno
66-
67-
COPY --chown=etheno:etheno examples examples/
80+
# Use the DOCKER env variable to set hostname accordingly
81+
ENV DOCKER=1
82+
WORKDIR /home/etheno
6883

6984
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)