From b628676c9579f0d33d48113c000bf3ee0cecb84e Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 12:10:00 -0300 Subject: [PATCH 01/10] Init --- .github/scripts/publish_report.sh | 22 ++++ .github/workflows/daily_reports.yml | 180 ++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 .github/scripts/publish_report.sh create mode 100644 .github/workflows/daily_reports.yml diff --git a/.github/scripts/publish_report.sh b/.github/scripts/publish_report.sh new file mode 100644 index 0000000..7e99a8e --- /dev/null +++ b/.github/scripts/publish_report.sh @@ -0,0 +1,22 @@ +curl -X POST $1 \ +-H 'Content-Type: application/json; charset=utf-8' \ +--data @- < + ${{ github.event_name == 'workflow_dispatch' + && secrets.TEST_CHANNEL_SLACK + || format( + '{0} {1}', + secrets.ETHREX_L1_SLACK_WEBHOOK, + secrets.ETHREX_L2_SLACK_WEBHOOK + ) + }} + run: | + for webhook in $SLACK_WEBHOOKS; do + if [ "${{ needs.sdk-integration-test.result }}" == "success" && "${{ needs.cli-integration-test.result }}" == "success"]; then + sh .github/scripts/publish_hive.sh "$webhook" "Rex is up to date." + fi + if [ "${{ needs.sdk-integration-test.result }}" != "success" ]; then + sh .github/scripts/publish_hive.sh "$webhook" "Rex sdk is outdated." + fi + if [ "${{ needs.cli-integration-test.result }}" != "success" ]; then + sh .github/scripts/publish_hive.sh "$webhook" "Rex cli is outdated." + fi + done + echo "Sending Results" >> $GITHUB_STEP_SUMMARY + From f7b5aea212adc3dfd014d2610c9c58fce5d02bc5 Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 14:53:23 -0300 Subject: [PATCH 02/10] Uncomment tests --- .github/workflows/daily_reports.yml | 252 +++++++++++++--------------- 1 file changed, 119 insertions(+), 133 deletions(-) diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index c8cb59b..6147a00 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -18,60 +18,60 @@ jobs: 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 + - 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 cli-integration-test: name: Integration Test - CLI @@ -83,67 +83,65 @@ jobs: with: tool-cache: false large-packages: false - # - name: Checkout sources - # uses: actions/checkout@v4 - # - name: Setup Rust Environment - # uses: ./.github/actions/setup-rust + - 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 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 - # cd ethrex - # git checkout 187e8c27f9b9a22948cd82b0b3f79866c16ac489 - # 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: 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 - # make cli - # cd cli - # PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 - # killall ethrex_prover -s SIGINT + - 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 + make cli + cd cli + PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 + killall ethrex_prover -s SIGINT post-daily-report: name: Post report to slack @@ -154,27 +152,15 @@ jobs: uses: actions/checkout@v4 - name: Check if any job failed - env: - SLACK_WEBHOOKS: > - ${{ github.event_name == 'workflow_dispatch' - && secrets.TEST_CHANNEL_SLACK - || format( - '{0} {1}', - secrets.ETHREX_L1_SLACK_WEBHOOK, - secrets.ETHREX_L2_SLACK_WEBHOOK - ) - }} run: | - for webhook in $SLACK_WEBHOOKS; do - if [ "${{ needs.sdk-integration-test.result }}" == "success" && "${{ needs.cli-integration-test.result }}" == "success"]; then - sh .github/scripts/publish_hive.sh "$webhook" "Rex is up to date." - fi - if [ "${{ needs.sdk-integration-test.result }}" != "success" ]; then - sh .github/scripts/publish_hive.sh "$webhook" "Rex sdk is outdated." - fi - if [ "${{ needs.cli-integration-test.result }}" != "success" ]; then - sh .github/scripts/publish_hive.sh "$webhook" "Rex cli is outdated." - fi - done + if [ "${{ needs.sdk-integration-test.result }}" == "success" ] && [ "${{ needs.cli-integration-test.result }}" == "success" ]; then + sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex is up to date." + fi + if [ "${{ needs.sdk-integration-test.result }}" != "success" ]; then + sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex sdk is outdated." + fi + if [ "${{ needs.cli-integration-test.result }}" != "success" ]; then + sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex cli is outdated." + fi echo "Sending Results" >> $GITHUB_STEP_SUMMARY From e04aa644c3587542d385f94b13df5ca5253e09cd Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 15:52:38 -0300 Subject: [PATCH 03/10] Add easy test --- .github/workflows/daily_reports.yml | 8 +++++--- cli/tests/tests.rs | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 cli/tests/tests.rs diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index 6147a00..43ecfd1 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -3,9 +3,11 @@ permissions: name: Daily Reports on: - schedule: - # Every day at UTC 03:00 - - cron: "0 3 * * 1,2,3,4,5" + # schedule: + # # Every day at UTC 03:00 + # - cron: "0 3 * * 1,2,3,4,5" + pull_request: + branches: ["**"] workflow_dispatch: jobs: diff --git a/cli/tests/tests.rs b/cli/tests/tests.rs new file mode 100644 index 0000000..185a4f2 --- /dev/null +++ b/cli/tests/tests.rs @@ -0,0 +1,4 @@ +#[tokio::test] +async fn cli_integration_test() -> Result<(), Box> { + Ok(()) +} From d8fda0925f3ca0b62f2f5722a5fe7aaa83bf30c2 Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 15:55:51 -0300 Subject: [PATCH 04/10] test with only free disk --- .github/workflows/daily_reports.yml | 218 ++++++++++++++-------------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index 43ecfd1..d701461 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -20,60 +20,60 @@ jobs: 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 + # - 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 cli-integration-test: name: Integration Test - CLI @@ -85,64 +85,64 @@ jobs: with: tool-cache: false large-packages: false - - name: Checkout sources - uses: actions/checkout@v4 - - name: Setup Rust Environment - uses: ./.github/actions/setup-rust + # - 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 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: 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 - make cli - cd cli - PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 + # - 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 + # make cli + # cd cli + # PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 killall ethrex_prover -s SIGINT post-daily-report: From da53b7a1c90603750a49876d8d4783d42f711476 Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 15:59:42 -0300 Subject: [PATCH 05/10] daily rexport --- .github/scripts/publish_report.sh | 2 +- .github/workflows/daily_reports.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/publish_report.sh b/.github/scripts/publish_report.sh index 7e99a8e..ddca01d 100644 --- a/.github/scripts/publish_report.sh +++ b/.github/scripts/publish_report.sh @@ -7,7 +7,7 @@ $(jq -n --arg text "$2" '{ "type": "header", "text": { "type": "plain_text", - "text": "Daily Rex report" + "text": "Daily rexport" } }, { diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index d701461..9db4f06 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -143,7 +143,7 @@ jobs: # make cli # cd cli # PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 - killall ethrex_prover -s SIGINT + # killall ethrex_prover -s SIGINT post-daily-report: name: Post report to slack From d2f1e80b0a0189dcfe0699daf8b0613e9a82493d Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 16:11:59 -0300 Subject: [PATCH 06/10] Uncomment test --- .github/workflows/daily_reports.yml | 226 ++++++++++++++-------------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index 9db4f06..b31282c 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -20,60 +20,60 @@ jobs: 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 + - 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 cli-integration-test: name: Integration Test - CLI @@ -85,65 +85,65 @@ jobs: with: tool-cache: false large-packages: false - # - name: Checkout sources - # uses: actions/checkout@v4 - # - name: Setup Rust Environment - # uses: ./.github/actions/setup-rust + - 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 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: 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 - # make cli - # cd cli - # PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 - # killall ethrex_prover -s SIGINT + - 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 + make cli + cd cli + PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1 + killall ethrex_prover -s SIGINT post-daily-report: name: Post report to slack @@ -156,13 +156,13 @@ jobs: - name: Check if any job failed run: | if [ "${{ needs.sdk-integration-test.result }}" == "success" ] && [ "${{ needs.cli-integration-test.result }}" == "success" ]; then - sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex is up to date." + sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex is up to date with ethrex." fi if [ "${{ needs.sdk-integration-test.result }}" != "success" ]; then - sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex sdk is outdated." + sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex SDK is out of sync with ethrex." fi if [ "${{ needs.cli-integration-test.result }}" != "success" ]; then - sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex cli is outdated." + sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex CLI is out of sync with ethrex." fi echo "Sending Results" >> $GITHUB_STEP_SUMMARY From de681b0c4b65f277605ea9c0c6be0d7001a05613 Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 16:49:52 -0300 Subject: [PATCH 07/10] Test failure --- .github/scripts/publish_report.sh | 2 +- .github/workflows/daily_reports.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/scripts/publish_report.sh b/.github/scripts/publish_report.sh index ddca01d..f1df49f 100644 --- a/.github/scripts/publish_report.sh +++ b/.github/scripts/publish_report.sh @@ -7,7 +7,7 @@ $(jq -n --arg text "$2" '{ "type": "header", "text": { "type": "plain_text", - "text": "Daily rexport" + "text": "Rex report" } }, { diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index b31282c..f0d6d4a 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -31,6 +31,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN || '' }} - name: Install ethrex run: | + exit 1 cd .. git clone https://github.com/lambdaclass/ethrex.git echo "ethrex installed successfully" @@ -98,6 +99,7 @@ jobs: - name: Install ethrex run: | + exit 1 cd .. git clone https://github.com/lambdaclass/ethrex.git echo "ethrex installed successfully" @@ -155,9 +157,6 @@ jobs: - name: Check if any job failed run: | - if [ "${{ needs.sdk-integration-test.result }}" == "success" ] && [ "${{ needs.cli-integration-test.result }}" == "success" ]; then - sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex is up to date with ethrex." - fi if [ "${{ needs.sdk-integration-test.result }}" != "success" ]; then sh .github/scripts/publish_report.sh ${{ secrets.TEST_CHANNEL_SLACK }} "Rex SDK is out of sync with ethrex." fi From 7c06b91fd09d3bec2ee4dbb4058fa0d0fa8fe0c4 Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 17:00:41 -0300 Subject: [PATCH 08/10] Add line to prevent skip test --- .github/workflows/daily_reports.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index f0d6d4a..b9e91ef 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -151,6 +151,7 @@ jobs: name: Post report to slack runs-on: ubuntu-latest needs: [sdk-integration-test, cli-integration-test] + if: ${{ always() && needs.sdk-integration-test.result != 'skipped' && cli-integration-test.result != 'skipped' }} steps: - name: Checkout sources uses: actions/checkout@v4 From 2c9f4904b065f188f7f2ca4f7b0a921b77be97aa Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 17:01:52 -0300 Subject: [PATCH 09/10] add needs --- .github/workflows/daily_reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index b9e91ef..2a2cbd2 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -151,7 +151,7 @@ jobs: name: Post report to slack runs-on: ubuntu-latest needs: [sdk-integration-test, cli-integration-test] - if: ${{ always() && needs.sdk-integration-test.result != 'skipped' && cli-integration-test.result != 'skipped' }} + if: ${{ always() && needs.sdk-integration-test.result != 'skipped' && needs.cli-integration-test.result != 'skipped' }} steps: - name: Checkout sources uses: actions/checkout@v4 From c3b5da6de72c93f0acb6720fa831f3c3d2d879fe Mon Sep 17 00:00:00 2001 From: Lucas Rack Date: Tue, 22 Jul 2025 17:04:53 -0300 Subject: [PATCH 10/10] remove exit 1 and do it with schedule --- .github/workflows/daily_reports.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/daily_reports.yml b/.github/workflows/daily_reports.yml index 2a2cbd2..163acaf 100644 --- a/.github/workflows/daily_reports.yml +++ b/.github/workflows/daily_reports.yml @@ -3,11 +3,9 @@ permissions: name: Daily Reports on: - # schedule: - # # Every day at UTC 03:00 - # - cron: "0 3 * * 1,2,3,4,5" - pull_request: - branches: ["**"] + schedule: + # Every day at UTC 03:00 + - cron: "0 3 * * 1,2,3,4,5" workflow_dispatch: jobs: @@ -31,7 +29,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN || '' }} - name: Install ethrex run: | - exit 1 cd .. git clone https://github.com/lambdaclass/ethrex.git echo "ethrex installed successfully" @@ -99,7 +96,6 @@ jobs: - name: Install ethrex run: | - exit 1 cd .. git clone https://github.com/lambdaclass/ethrex.git echo "ethrex installed successfully"