Skip to content

fix(sdk): fix deposit through contract call and add withdrawal test #172

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

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ba6d5e8
Initial commit
Mechanix97 Jul 15, 2025
0db89a5
Add actions
Mechanix97 Jul 15, 2025
ccdf5e2
Dont make cli
Mechanix97 Jul 15, 2025
d974e23
run l1 locally
Mechanix97 Jul 15, 2025
39c1d99
Remove biuld l1 docker
Mechanix97 Jul 15, 2025
27ebaba
Build image again
Mechanix97 Jul 15, 2025
8eedf95
try with ../ethrex
Mechanix97 Jul 15, 2025
8867bc2
Try new test
Mechanix97 Jul 16, 2025
c56a169
change path
Mechanix97 Jul 16, 2025
2c62f10
try this
Mechanix97 Jul 16, 2025
790fd38
change path
Mechanix97 Jul 16, 2025
dd2cd27
Run all
Mechanix97 Jul 16, 2025
e1ba062
no eth client
Mechanix97 Jul 16, 2025
25c7ac5
Add client
Mechanix97 Jul 16, 2025
fca7aa9
Add ethres l2 env
Mechanix97 Jul 16, 2025
a746d29
--lib in tests job
Mechanix97 Jul 16, 2025
ae01df3
Use old commit
Mechanix97 Jul 16, 2025
2345ea1
remove validium
Mechanix97 Jul 16, 2025
8dfdce7
remove install contracts
Mechanix97 Jul 16, 2025
a71d4f7
new cargo lock
Mechanix97 Jul 16, 2025
4843d61
clean docker cache
Mechanix97 Jul 16, 2025
3f02070
remove clean cache
Mechanix97 Jul 16, 2025
541613c
try free disk
Mechanix97 Jul 16, 2025
5fe323c
More tests
Mechanix97 Jul 16, 2025
dd4690d
Merge branch 'main' into mecha/ci-integration-test
Mechanix97 Jul 17, 2025
a7905f3
Remove changes
Mechanix97 Jul 17, 2025
e7cd4a0
Add deposit through contract call
Mechanix97 Jul 17, 2025
2bbcb55
Deposit through contract call working
Mechanix97 Jul 18, 2025
b86b07e
Merge branch 'main' into mecha/ci-integration-test
Mechanix97 Jul 18, 2025
cb8672d
Fix spaces
Mechanix97 Jul 18, 2025
b1614ef
add sleep time
Mechanix97 Jul 18, 2025
e512db5
Fix integration test gh
Mechanix97 Jul 18, 2025
a06e060
Potential fix for code scanning alert no. 14: Workflow does not conta…
Mechanix97 Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/pr_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
permissions:
contents: read
name: rex integration tests
on:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
sdk-integration-test:
name: Integration Test - SDK
runs-on: ubuntu-latest

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust

- name: Install solc
uses: pontem-network/get-solc@master
with:
version: v0.8.29
token: ${{ secrets.GITHUB_TOKEN || '' }}

- name: Install ethrex
run: |
cd ..
git clone https://github.com/lambdaclass/ethrex.git
echo "ethrex installed successfully"

# also creates empty verification keys (as workflow runs with exec backend)
- name: Build prover
run: |
cd ../ethrex/crates/l2
make build-prover
mkdir -p prover/zkvm/interface/sp1/out && touch prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk

- name: Build L1 docker image
uses: docker/build-push-action@v6
with:
context: ../ethrex/
file: ../ethrex/crates/blockchain/dev/Dockerfile
tags: ethrex_dev:latest
push: false

- name: Start L1 & Deploy contracts
run: |
cd ../ethrex/crates/l2
touch .env
CI_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_L2_VALIDIUM=false \
docker compose -f docker-compose-l2.yaml up contract_deployer

- name: Start Sequencer
run: |
cd ../ethrex/crates/l2
CI_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_L2_VALIDIUM=false \
ETHREX_WATCHER_BLOCK_DELAY=0 \
docker compose -f docker-compose-l2.yaml up --detach ethrex_l2

- name: Run test
run: |
sudo chmod -R a+rw ../ethrex/crates/l2
cd ../ethrex/crates/l2
RUST_LOG=info,ethrex_prover_lib=debug make init-prover &
docker logs --follow ethrex_l2 &
cd /home/runner/work/rex/rex/sdk
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex-sdk --test tests -- --nocapture --test-threads=1
killall ethrex_prover -s SIGINT

# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
all-tests:
# "Integration Test" is a required check, don't change the name
name: Integration Test
runs-on: ubuntu-latest
needs: [sdk-integration-test]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ always() && needs.sdk-integration-test.result != 'skipped' }}
steps:
- name: Check if any job failed
run: |
if [ "${{ needs.sdk-integration-test.result }}" != "success" ]; then
echo "Job SDK integration test Check failed"
exit 1
fi
72 changes: 0 additions & 72 deletions .github/workflows/pr_main_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,75 +55,3 @@ jobs:

- name: Run tests
run: cargo test --manifest-path sdk/Cargo.toml --lib

integration-test:
name: Integration Test - SDK
runs-on: ubuntu-latest

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust

- name: Install solc
uses: pontem-network/get-solc@master
with:
version: v0.8.29
token: ${{ secrets.GITHUB_TOKEN || '' }}

- name: Install ethrex
run: |
cd ..
git clone https://github.com/lambdaclass/ethrex.git
echo "ethrex installed successfully"

# also creates empty verification keys (as workflow runs with exec backend)
- name: Build prover
run: |
cd ../ethrex/crates/l2
make build-prover
mkdir -p prover/zkvm/interface/sp1/out && touch prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk

- name: Build L1 docker image
uses: docker/build-push-action@v6
with:
context: ../ethrex/
file: ../ethrex/crates/blockchain/dev/Dockerfile
tags: ethrex_dev:latest
push: false

- name: Start L1 & Deploy contracts
run: |
cd ../ethrex/crates/l2
touch .env
CI_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_L2_VALIDIUM=false \
docker compose -f docker-compose-l2.yaml up contract_deployer

- name: Start Sequencer
run: |
cd ../ethrex/crates/l2
CI_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_L2_VALIDIUM=false \
ETHREX_WATCHER_BLOCK_DELAY=0 \
docker compose -f docker-compose-l2.yaml up --detach ethrex_l2

- name: Run test
run: |
sudo chmod -R a+rw ../ethrex/crates/l2
cd ../ethrex/crates/l2
RUST_LOG=info,ethrex_prover_lib=debug make init-prover &
docker logs --follow ethrex_l2 &
cd /home/runner/work/rex/rex/sdk
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex-sdk --test tests -- --nocapture --test-threads=1
killall ethrex_prover -s SIGINT
Loading