-
Notifications
You must be signed in to change notification settings - Fork 1
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
Mechanix97
wants to merge
33
commits into
main
Choose a base branch
from
mecha/ci-integration-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
ba6d5e8
Initial commit
Mechanix97 0db89a5
Add actions
Mechanix97 ccdf5e2
Dont make cli
Mechanix97 d974e23
run l1 locally
Mechanix97 39c1d99
Remove biuld l1 docker
Mechanix97 27ebaba
Build image again
Mechanix97 8eedf95
try with ../ethrex
Mechanix97 8867bc2
Try new test
Mechanix97 c56a169
change path
Mechanix97 2c62f10
try this
Mechanix97 790fd38
change path
Mechanix97 dd2cd27
Run all
Mechanix97 e1ba062
no eth client
Mechanix97 25c7ac5
Add client
Mechanix97 fca7aa9
Add ethres l2 env
Mechanix97 a746d29
--lib in tests job
Mechanix97 ae01df3
Use old commit
Mechanix97 2345ea1
remove validium
Mechanix97 8dfdce7
remove install contracts
Mechanix97 a71d4f7
new cargo lock
Mechanix97 4843d61
clean docker cache
Mechanix97 3f02070
remove clean cache
Mechanix97 541613c
try free disk
Mechanix97 5fe323c
More tests
Mechanix97 dd4690d
Merge branch 'main' into mecha/ci-integration-test
Mechanix97 a7905f3
Remove changes
Mechanix97 e7cd4a0
Add deposit through contract call
Mechanix97 2bbcb55
Deposit through contract call working
Mechanix97 b86b07e
Merge branch 'main' into mecha/ci-integration-test
Mechanix97 cb8672d
Fix spaces
Mechanix97 b1614ef
add sleep time
Mechanix97 e512db5
Fix integration test gh
Mechanix97 a06e060
Potential fix for code scanning alert no. 14: Workflow does not conta…
Mechanix97 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
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 | ||
|
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 |
---|---|---|
|
@@ -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 |
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.