-
Notifications
You must be signed in to change notification settings - Fork 110
refactor(l1,l2): separate binaries #4829
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
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
cd8736f
Start grouping l2 deps under an l2 feature flag
ilitteri 1086d93
Added missing constant
fedacking df1697b
L1 compiles without sdk
fedacking 1dea512
Fixed build dependency
fedacking a157af1
fixed linter
fedacking 8e5d50c
separated build rs files
fedacking d60dfdc
Compiles l2
fedacking 17e1029
Fixed defaults
fedacking 0fd5a7a
Update server.rs
fedacking 8f5de90
Lint temporary change
fedacking ca3bf67
made make test and lint work
fedacking 343b368
Added sql to lint
fedacking ef27d43
minor fix
fedacking 40864eb
Clippy for expect
fedacking 48498dc
Update sp1.rs
fedacking d91e7e8
Merge remote-tracking branch 'origin/main' into separate_binaries
fedacking 0f47a2f
Update Cargo.toml
fedacking a7dc856
simplified build.rs
fedacking e1ccbaa
Update Makefile
fedacking 7e33114
Merge branch 'main' into separate_binaries
ManuelBilbao c19180f
Merge branch 'main' into separate_binaries
ManuelBilbao 8dee125
Add dev as default feature
ManuelBilbao 589a1a5
Update release workflow
ManuelBilbao f2ebcf4
fix(l1,l2): include proper l2 flags
fedacking a2ef5e1
Set feature flags in L2 docker compose and Makefile
ManuelBilbao 8b727d4
Format + lint ci fix
fedacking bd5fb56
reorg test fixed
fedacking ada9ce1
Merge remote-tracking branch 'origin/main' into separate_binaries
fedacking 2e3813c
workflow
fedacking e689d50
fixed feature flags in docker compose
fedacking baadb00
Merge branch 'main' into separate_binaries
fedacking efbff58
fixed cli (hopefully)
fedacking 794a496
Update docker-compose.yaml
fedacking 387083c
Main l2
fedacking 64dcb57
Update docker-compose.yaml
fedacking bedc357
Update pr-main_l2.yaml
fedacking 71dc4ca
Update pr-main_l2.yaml
fedacking 86735fa
added var of artifact_path
fedacking fcf059a
test
fedacking 7bbf0e8
Update action.yml
fedacking 27d4bf5
stringified?
fedacking 4a54899
String token
fedacking 48d71bb
Fixed build args
fedacking 6bd632c
Cleanup
fedacking 308126a
Added docker push action
fedacking 0ec5d37
Update tag_release.yaml
fedacking 3a5d101
fix(l1,l2): fixed build flags for docker compose
fedacking 19f44da
Merge remote-tracking branch 'origin/main' into separate_binaries
fedacking 2c46cc2
Compiles + Lint
fedacking 0d65640
Merge branch 'main' of github.com:lambdaclass/ethrex into separate_bi…
ilitteri 1b411d8
Add build args
ManuelBilbao 7a1fc08
Rename binaries
ManuelBilbao f58e350
Merge branch 'main' into separate_binaries
ManuelBilbao 26bc4db
Merge branch 'main' of github.com:lambdaclass/ethrex into separate_bi…
ilitteri 7274c98
Use draft and prerelease on release candidate
ManuelBilbao b4fbbff
Merge branch 'main' into separate_binaries
ManuelBilbao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,11 +52,11 @@ | |
touch crates/l2/prover/src/guest_program/src/sp1/out/riscv32im-succinct-zkvm-elf | ||
|
||
- name: Run cargo check | ||
run: cargo check --workspace | ||
run: cargo check --workspace --features l2,l2-sql | ||
|
||
- name: Run cargo clippy | ||
run: | | ||
cargo clippy --workspace -- -D warnings | ||
cargo clippy --workspace --features l2,l2-sql -- -D warnings | ||
make lint | ||
|
||
- name: Run cargo fmt | ||
|
@@ -86,10 +86,37 @@ | |
name: ethrex_image | ||
path: /tmp/ethrex_image.tar | ||
|
||
# We build the docker image for the l2 usage. It needs to add | ||
# The build args for l2. | ||
build-docker-l2: | ||
name: Build docker image L2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build L2 docker image | ||
uses: ./.github/actions/build-docker | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
tags: ethrex:main-l2 | ||
artifact_path: ethrex_image_l2.tar | ||
build_args: BUILD_FLAGS=--features l2 | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ethrex_image_l2 | ||
path: /tmp/ethrex_image_l2.tar | ||
|
||
integration-test: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
name: Integration Test - ${{ matrix.name }} | ||
runs-on: ubuntu-latest | ||
needs: build-docker | ||
needs: [build-docker, build-docker-l2] | ||
strategy: | ||
matrix: | ||
include: | ||
|
@@ -145,7 +172,7 @@ | |
|
||
- name: Build test | ||
run: | | ||
cargo test l2 --no-run --release | ||
cargo test l2 --features l2 --no-run --release | ||
|
||
- name: Start Web3Signer | ||
if: matrix.web3signer | ||
|
@@ -163,6 +190,16 @@ | |
run: | | ||
docker load --input /tmp/ethrex_image.tar | ||
|
||
- name: Download ethrex L2 image artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ethrex_image_l2 | ||
path: /tmp | ||
|
||
- name: Load ethrex L2 image | ||
run: | | ||
docker load --input /tmp/ethrex_image_l2.tar | ||
|
||
- name: Start L1 | ||
run: | | ||
cd crates/l2 | ||
|
@@ -258,7 +295,7 @@ | |
integration-test-tdx: | ||
name: Integration Test - TDX | ||
runs-on: ubuntu-latest | ||
needs: build-docker | ||
needs: [build-docker, build-docker-l2] | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
|
@@ -288,6 +325,16 @@ | |
run: | | ||
docker load --input /tmp/ethrex_image.tar | ||
|
||
- name: Download ethrex L2 image artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ethrex_image_l2 | ||
path: /tmp | ||
|
||
- name: Load ethrex L2 image | ||
run: | | ||
docker load --input /tmp/ethrex_image_l2.tar | ||
|
||
- name: Set up Nix | ||
uses: cachix/install-nix-action@v31 | ||
|
||
|
@@ -355,7 +402,7 @@ | |
state-diff-test: | ||
name: State Reconstruction Tests | ||
runs-on: ubuntu-latest | ||
needs: build-docker | ||
needs: [build-docker, build-docker-l2] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
@@ -372,6 +419,16 @@ | |
run: | | ||
docker load --input /tmp/ethrex_image.tar | ||
|
||
- name: Download ethrex L2 image artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ethrex_image_l2 | ||
path: /tmp | ||
|
||
- name: Load ethrex L2 image | ||
run: | | ||
docker load --input /tmp/ethrex_image_l2.tar | ||
|
||
- name: Install solc | ||
uses: lambdaclass/get-solc@master | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,29 +22,45 @@ jobs: | |
- ubuntu-22.04 | ||
- ubuntu-24.04-arm | ||
- macos-latest | ||
gpu: | ||
- true | ||
- false | ||
stack: | ||
- l1 | ||
- l2 | ||
- l2_gpu | ||
exclude: | ||
- platform: macos-latest | ||
stack: l2_gpu | ||
include: | ||
- platform: ubuntu-22.04 | ||
os: linux | ||
arch: x86_64 | ||
prover_features: sp1,risc0 | ||
cpu_flags: RUSTFLAGS='-C target-cpu=x86-64-v2' | ||
- platform: ubuntu-24.04-arm | ||
os: linux | ||
arch: aarch64 | ||
prover_features: sp1 | ||
- platform: macos-latest | ||
os: macos | ||
arch: aarch64 | ||
- gpu: true | ||
- platform: macos-latest | ||
stack: l2 | ||
features: l2,l2-sql | ||
- platform: ubuntu-22.04 | ||
stack: l2 | ||
features: l2,l2-sql,sp1,risc0 | ||
- platform: ubuntu-22.04 | ||
stack: l2_gpu | ||
features: l2,l2-sql,sp1,risc0,gpu | ||
- platform: ubuntu-24.04-arm | ||
stack: l2 | ||
features: l2,l2-sql,sp1 | ||
- platform: ubuntu-24.04-arm | ||
stack: l2_gpu | ||
features: l2,l2-sql,sp1,gpu | ||
- stack: l2_gpu | ||
gpu_flags: NVCC_PREPEND_FLAGS='-arch=sm_70' | ||
gpu_feature: ",gpu" | ||
l2_suffix: "-l2" | ||
gpu_suffix: "-gpu" | ||
exclude: | ||
- platform: macos-latest | ||
gpu: true | ||
- stack: l2 | ||
l2_suffix: "-l2" | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
|
@@ -57,10 +73,8 @@ jobs: | |
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rustup toolchain install | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ vars.RUST_VERSION }} | ||
- name: Setup Rust Environment | ||
uses: ./.github/actions/setup-rust | ||
|
||
- name: Install SP1 (only Linux) | ||
if: ${{ matrix.os == 'linux' }} | ||
|
@@ -89,7 +103,7 @@ jobs: | |
|
||
- name: Install CUDA (only Linux x86 GPU) | ||
uses: Jimver/[email protected] | ||
if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.gpu }} | ||
if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }} | ||
id: cuda-toolkit | ||
with: | ||
cuda: "12.9.0" | ||
|
@@ -116,11 +130,12 @@ jobs: | |
|
||
- name: Build ethrex | ||
run: | | ||
COMPILE_CONTRACTS=true ${{ matrix.cpu_flags }} ${{ matrix.gpu_flags }} cargo build --release --features "${{ matrix.prover_features }}${{ matrix.gpu_feature }}" --bin ethrex | ||
mv target/release/ethrex ethrex-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.gpu_suffix }} | ||
COMPILE_CONTRACTS=true ${{ matrix.cpu_flags }} ${{ matrix.gpu_flags }} cargo build --release --features "${{ matrix.features }}" --bin ethrex | ||
chmod +x target/release/ethrex | ||
mv target/release/ethrex ethrex${{ matrix.l2_suffix }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.gpu_suffix }} | ||
|
||
- name: Copy verification keys | ||
if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.gpu }} # Run only once | ||
if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }} # Run only once | ||
run: | | ||
mkdir -p ./verification_keys | ||
mv crates/l2/prover/src/guest_program/src/risc0/out/riscv32im-risc0-vk verification_keys/ethrex-riscv32im-risc0-vk | ||
|
@@ -129,11 +144,11 @@ jobs: | |
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ethrex-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.gpu_suffix }} | ||
path: ethrex-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.gpu_suffix }} | ||
name: ethrex${{ matrix.l2_suffix }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.gpu_suffix }} | ||
path: ethrex${{ matrix.l2_suffix }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.gpu_suffix }} | ||
|
||
- name: Upload verification keys | ||
if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.gpu }} # Run only once | ||
if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }} # Run only once | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: verification_keys | ||
|
@@ -183,8 +198,8 @@ jobs: | |
run: echo "TAG_VERSION=$(echo ${{ github.ref_name }} | tr -d v)" >> $GITHUB_ENV | ||
|
||
# Pushes to ghcr.io/lambdaclass/ethrex | ||
- name: Build and push Docker image | ||
id: push | ||
- name: Build and push L1 Docker image | ||
id: push_l1 | ||
uses: ./.github/actions/build-docker | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
|
@@ -193,7 +208,19 @@ jobs: | |
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_VERSION }} | ||
|
||
# Creates a draft release on GitHub with the binaries | ||
# Pushes to ghcr.io/lambdaclass/ethrex | ||
- name: Build and push L2 Docker image | ||
id: push_l2 | ||
uses: ./.github/actions/build-docker | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-l2,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_VERSION }}-l2 | ||
build_args: BUILD_FLAGS=--features l2,l2-sql | ||
|
||
# Creates a release on GitHub with the binaries | ||
finalize-release: | ||
needs: | ||
- build-ethrex | ||
|
@@ -218,6 +245,9 @@ jobs: | |
echo "PREVIOUS_TAG: $name" | ||
echo "PREVIOUS_TAG=$name" >> $GITHUB_ENV | ||
|
||
- name: Check release type | ||
run: echo "TAG_SUFFIX=$(echo ${{ github.ref_name }}- | cut -d- -f2)" >> $GITHUB_ENV | ||
|
||
- name: Update CHANGELOG | ||
id: changelog | ||
uses: requarks/changelog-action@v1 | ||
|
@@ -233,8 +263,8 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ./bin/**/* | ||
draft: false | ||
prerelease: false | ||
draft: ${{ startsWith(env.TAG_SUFFIX, 'rc') }} | ||
prerelease: ${{ startsWith(env.TAG_SUFFIX, 'rc') }} | ||
tag_name: ${{ github.ref_name }} | ||
name: "ethrex: ${{ github.ref_name }}" | ||
body: > | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.