perf(core,levm): remove some unnecessary clones and make functions co… #246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: L2 (without proving) | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["**"] | |
paths: | |
- "crates/l2/**" | |
- "crates/vm/levm/**" | |
- ".github/workflows/pr-main_l2.yaml" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CI_ETHREX_WORKDIR: /usr/local/bin | |
jobs: | |
docker-bake: | |
name: "Docker bake" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Bake docker images | |
uses: docker/bake-action@v6 | |
with: | |
workdir: "crates/l2" | |
files: "crates/l2/docker-compose-l2.yaml" | |
set: | | |
ethrex.cache-to=type=local,dest=/tmp/buildx-cache/ethrex,mode=max | |
ethrex_l2.cache-to=type=local,dest=/tmp/buildx-cache/ethrex_l2,mode=max | |
contract_deployer.cache-to=type=local,dest=/tmp/buildx-cache/contract_deployer,mode=max | |
- name: Upload docker artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: buildx-cache | |
path: /tmp/buildx-cache | |
integration-test: | |
# "Integration Test" is a required check, don't change the name | |
name: Integration Test | |
runs-on: ubuntu-latest | |
needs: [docker-bake] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Rustup toolchain install | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Download buildx cache | |
uses: actions/download-artifact@v4 | |
with: | |
name: buildx-cache | |
path: /tmp/buildx-cache | |
- name: Bake docker images | |
uses: docker/bake-action@v6 | |
with: | |
workdir: "crates/l2" | |
files: "crates/l2/docker-compose-l2.yaml" | |
load: true | |
set: | | |
ethrex.cache-from=type=local,src=/tmp/buildx-cache/ethrex | |
ethrex_l2.cache-from=type=local,src=/tmp/buildx-cache/ethrex_l2 | |
contract_deployer.cache-from=type=local,src=/tmp/buildx-cache/contract_deployer | |
- name: Build prover | |
run: | | |
cd crates/l2 | |
make build-prover | |
- name: Build test | |
run: | | |
cargo test l2 --no-run --release | |
- name: Run test | |
run: | | |
cd crates/l2 | |
cp configs/prover_client_config_example.toml configs/prover_client_config.toml | |
cp configs/sequencer_config_example.toml configs/sequencer_config.toml | |
sed -i 's/listen_ip = "127.0.0.1"/listen_ip = "0.0.0.0"/' configs/sequencer_config.toml | |
make integration-test | |
state-diff-test: | |
# "State Reconstruction Tests" is a required check, don't change the name | |
name: State Reconstruction Tests | |
runs-on: ubuntu-latest | |
needs: [docker-bake] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Rustup toolchain install | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Download buildx cache | |
uses: actions/download-artifact@v4 | |
with: | |
name: buildx-cache | |
path: /tmp/buildx-cache | |
- name: Bake docker images | |
uses: docker/bake-action@v6 | |
with: | |
workdir: "crates/l2" | |
files: "crates/l2/docker-compose-l2.yaml" | |
load: true | |
set: | | |
ethrex.cache-from=type=local,src=/tmp/buildx-cache/ethrex | |
ethrex_l2.cache-from=type=local,src=/tmp/buildx-cache/ethrex_l2 | |
contract_deployer.cache-from=type=local,src=/tmp/buildx-cache/contract_deployer | |
- name: Set up Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install solc | |
run: | | |
sudo add-apt-repository ppa:ethereum/ethereum | |
sudo apt-get update && sudo apt-get -y install solc | |
- name: Run tests | |
run: | | |
cd crates/l2 | |
cp configs/prover_client_config_example.toml configs/prover_client_config.toml | |
cp configs/sequencer_config_example.toml configs/sequencer_config.toml | |
sed -i 's/listen_ip = "127.0.0.1"/listen_ip = "0.0.0.0"/' configs/sequencer_config.toml | |
make state-diff-test |