Skip to content

Commit

Permalink
Merge branch 'matter-labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
thepluck authored Oct 11, 2024
2 parents 9e4b438 + 15bec2f commit b91d92f
Show file tree
Hide file tree
Showing 382 changed files with 20,134 additions and 7,918 deletions.
11 changes: 1 addition & 10 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
* @danipopes @evalir @mattsse

crates/anvil/ @danipopes @mattsse @evalir
crates/cheatcodes/ @danipopes @mattsse @klkvr @evalir
crates/evm/coverage/ @onbjerg
crates/fmt/ @rkrasiuk
crates/linking/ @klkvr
crates/macros/ @danipopes
crates/script/ @danipopes @mattsse @klkvr
crates/wallets/ @klkvr
* @danipopes @klkvr @mattsse
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG-FORM.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: File a bug report
labels: ["T-bug"]
labels: ["T-bug", "T-needs-triage"]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/FEATURE-FORM.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature request
description: Suggest a feature
labels: ["T-feature"]
labels: ["T-feature", "T-needs-triage"]
body:
- type: markdown
attributes:
Expand Down
7 changes: 7 additions & 0 deletions .github/scripts/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail

# We have to ignore at shell level because testdata/ is not a valid Foundry project,
# so running `forge fmt` with `--root testdata` won't actually check anything
shopt -s extglob
cargo run --bin forge -- fmt "$@" $(find testdata -name '*.sol' ! -name Vm.sol)
51 changes: 31 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
CARGO_TERM_COLOR: always
IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
PROFILE: maxperf

jobs:
prepare:
Expand Down Expand Up @@ -135,59 +136,69 @@ jobs:
- name: Build binaries
env:
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
OUT_DIR: target/${{ matrix.target }}/${{ env.PROFILE }}
shell: bash
run: |
set -eo pipefail
target="${{ matrix.target }}"
flags=()
flags=(--target $TARGET --profile $PROFILE --bins
--no-default-features --features rustls,aws-kms,cli,asm-keccak)
# Disable asm-keccak, see https://github.com/alloy-rs/core/issues/711
# # Remove jemalloc, only keep `asm-keccak` if applicable
# if [[ "$target" != *msvc* && "$target" != "aarch64-unknown-linux-gnu" ]]; then
# flags+=(--features asm-keccak)
# fi
# `jemalloc` is not fully supported on MSVC or aarch64 Linux.
if [[ "$TARGET" != *msvc* && "$TARGET" != "aarch64-unknown-linux-gnu" ]]; then
flags+=(--features jemalloc)
fi
cargo build --release --bin forge --bin cast --target "$target" "${flags[@]}"
[[ "$TARGET" == *windows* ]] && ext=".exe"
cargo build "${flags[@]}"
bins=(cast forge)
for name in "${bins[@]}"; do
bin=./target/$target/release/$name
file "$bin" || true
ldd "$bin" || true
$bin --version || true
bin=$OUT_DIR/$name$ext
echo ""
file "$bin" || true
du -h "$bin" || true
ldd "$bin" || true
$bin --version || true
done
- name: Archive binaries
id: artifacts
env:
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
ARCH: ${{ matrix.arch }}
OUT_DIR: target/${{ matrix.target }}/${{ env.PROFILE }}
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
ARCH: ${{ matrix.arch }}
shell: bash
run: |
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
tar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C $OUT_DIR forge cast
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
gtar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C $OUT_DIR forge cast
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
else
cd $OUT_DIR
7z a -tzip "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" forge.exe cast.exe
mv "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
fi
- name: Build man page
id: man
if: matrix.target == 'x86_64-unknown-linux-gnu'
env:
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
OUT_DIR: target/${{ matrix.target }}/${{ env.PROFILE }}
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
shell: bash
run: |
sudo apt-get -y install help2man
help2man -N ./target/${TARGET}/release/forge > forge.1
help2man -N ./target/${TARGET}/release/cast > cast.1
help2man -N $OUT_DIR/forge > forge.1
help2man -N $OUT_DIR/cast > cast.1
gzip forge.1
gzip cast.1
tar -czvf "foundry_man_${VERSION_NAME}.tar.gz" forge.1.gz cast.1.gz
Expand Down
34 changes: 14 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ concurrency:

env:
CARGO_TERM_COLOR: always
TARGET_RUST_VERSION: "nightly-2024-07-19"

jobs:
doctests:
name: doc tests
doctest:
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-04-28
toolchain: ${{ env.TARGET_RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: cargo test
run: cargo test --doc -p forge -p cast@0.0.2
env:
RUST_TEST_THREADS: 2
run: cargo test --doc -p forge

clippy:
name: clippy
Expand All @@ -47,42 +45,40 @@ jobs:
env:
RUSTFLAGS: -Dwarnings

fmt:
name: fmt
rustfmt:
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-04-28
toolchain: ${{ env.TARGET_RUST_VERSION }}
components: rustfmt
- run: cargo fmt --all --check

forge-fmt:
name: forge fmt
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-04-28
toolchain: ${{ env.TARGET_RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: forge fmt
run: cargo run --bin forge -- fmt --check testdata/
shell: bash
run: ./.github/scripts/format.sh --check

feature-checks:
name: feature checks
crate-checks:
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-04-28
toolchain: ${{ env.TARGET_RUST_VERSION }}
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -91,7 +87,6 @@ jobs:
run: cargo hack check

zk-cargo-test:
name: zk-cargo-test
runs-on: ubuntu-22.04-github-hosted-16core

steps:
Expand All @@ -104,7 +99,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-04-28
toolchain: ${{ env.TARGET_RUST_VERSION }}

- name: Run era-test-node
uses: dutterbutter/era-test-node-action@v1
Expand All @@ -115,13 +110,13 @@ jobs:
logFilePath: era_test_node.log
target: x86_64-unknown-linux-gnu
releaseTag: v0.1.0-alpha.25

- name: Run zk tests
env:
RUST_BACKTRACE: full
TEST_MAINNET_URL: http://localhost:8011
run: cargo test zk

check-ci-install:
name: CI install
runs-on: ubuntu-latest
Expand All @@ -132,4 +127,3 @@ jobs:
cd /tmp && curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash
- name: Verify installation
run: forge --version

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ out/
out.json
.idea
.vscode
bloat*
install.log
Loading

0 comments on commit b91d92f

Please sign in to comment.