From fc804912e485f3dd16556ec66a1c28c10b95b45d Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Sun, 17 Sep 2023 11:57:49 -0600 Subject: [PATCH 01/20] ci: gomu gomu no gatling workflow integration --- .github/workflows/gomu-gomu-no-gatling.yml | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/gomu-gomu-no-gatling.yml diff --git a/.github/workflows/gomu-gomu-no-gatling.yml b/.github/workflows/gomu-gomu-no-gatling.yml new file mode 100644 index 0000000000..5bdf6dce8b --- /dev/null +++ b/.github/workflows/gomu-gomu-no-gatling.yml @@ -0,0 +1,57 @@ +name: Benchmarks - Gomu Gomu no Gatling + +on: + workflow_dispatch: + pull_request: + branches: [main] + + +jobs: + benchmark_job: + runs-on: [self-hosted, linux, benchmark] + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run Gomu Gomu no Gatling Action + uses: keep-starknet-strange/gomu-gomu-no-gatling@main + with: + config_path: 'config.yml' + + # config template + # + # rpc: + # url: "http://localhost:9944" + + # setup: + # erc20_contract: + # v1: + # path: contracts/v2.1.0/openzeppelin_ERC20.sierra.json + # casm_path: contracts/v2.1.0/openzeppelin_ERC20.casm.json + + # erc721_contract: + # v1: + # path: contracts/v2.1.0/openzeppelin_ERC721.sierra.json + # casm_path: contracts/v2.1.0/openzeppelin_ERC721.casm.json + + # account_contract: + # v1: + # path: contracts/v2.1.0/openzeppelin_Account.sierra.json + # casm_path: contracts/v2.1.0/openzeppelin_Account.casm.json + + # fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" + # num_accounts: 3 + + # run: + # num_erc20_transfers: 5 + # num_erc721_mints: 5 + + # report: + # num_blocks: 3 + # reports_dir: "reports" + + # deployer: + # salt: 1 + # address: "0x0000000000000000000000000000000000000000000000000000000000000002" + # signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" + \ No newline at end of file From 4e6d9d5564e46dc0110c094521b84e1384c62b88 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Sun, 17 Sep 2023 12:06:08 -0600 Subject: [PATCH 02/20] workflow rename --- .github/workflows/gomu-gomu-no-gatling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gomu-gomu-no-gatling.yml b/.github/workflows/gomu-gomu-no-gatling.yml index 5bdf6dce8b..cd696ae1c4 100644 --- a/.github/workflows/gomu-gomu-no-gatling.yml +++ b/.github/workflows/gomu-gomu-no-gatling.yml @@ -1,4 +1,4 @@ -name: Benchmarks - Gomu Gomu no Gatling +name: Workflow - Pull Request / Gomu Gomu no Gatling on: workflow_dispatch: From 3386bec7c4163f3536fed03fbe545e6b60bedc63 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Tue, 19 Sep 2023 16:37:21 -0600 Subject: [PATCH 03/20] benchmark config and madara command in workflow --- .github/workflows/gomu-gomu-no-gatling.yml | 72 ++++++++-------------- benchmark.yml | 35 +++++++++++ 2 files changed, 61 insertions(+), 46 deletions(-) create mode 100644 benchmark.yml diff --git a/.github/workflows/gomu-gomu-no-gatling.yml b/.github/workflows/gomu-gomu-no-gatling.yml index cd696ae1c4..47bfe4447f 100644 --- a/.github/workflows/gomu-gomu-no-gatling.yml +++ b/.github/workflows/gomu-gomu-no-gatling.yml @@ -1,57 +1,37 @@ name: Workflow - Pull Request / Gomu Gomu no Gatling on: - workflow_dispatch: - pull_request: - branches: [main] - - + workflow_dispatch: + pull_request: + branches: [main] + jobs: benchmark_job: runs-on: [self-hosted, linux, benchmark] steps: + # Caching Step (based on Task - Test Madara Commands) + - name: Cache Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} + fail-on-cache-miss: true + + # Checkout code - name: Checkout code uses: actions/checkout@v3 - + + # Run Madara + - name: Run Madara --dev + run: madara --dev + + # Run Gomu Gomu no Gatling Action - name: Run Gomu Gomu no Gatling Action - uses: keep-starknet-strange/gomu-gomu-no-gatling@main + uses: keep-starknet-strange/gomu-gomu-no-gatling@main with: - config_path: 'config.yml' - - # config template - # - # rpc: - # url: "http://localhost:9944" - - # setup: - # erc20_contract: - # v1: - # path: contracts/v2.1.0/openzeppelin_ERC20.sierra.json - # casm_path: contracts/v2.1.0/openzeppelin_ERC20.casm.json - - # erc721_contract: - # v1: - # path: contracts/v2.1.0/openzeppelin_ERC721.sierra.json - # casm_path: contracts/v2.1.0/openzeppelin_ERC721.casm.json - - # account_contract: - # v1: - # path: contracts/v2.1.0/openzeppelin_Account.sierra.json - # casm_path: contracts/v2.1.0/openzeppelin_Account.casm.json - - # fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" - # num_accounts: 3 - - # run: - # num_erc20_transfers: 5 - # num_erc721_mints: 5 - - # report: - # num_blocks: 3 - # reports_dir: "reports" - - # deployer: - # salt: 1 - # address: "0x0000000000000000000000000000000000000000000000000000000000000002" - # signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" - \ No newline at end of file + config_path: 'benchmark.yml' diff --git a/benchmark.yml b/benchmark.yml new file mode 100644 index 0000000000..bccb2ef697 --- /dev/null +++ b/benchmark.yml @@ -0,0 +1,35 @@ +rpc: + url: "http://localhost:9944" + + setup: + erc20_contract: + v1: + path: configs/cairo-contracts/cairo_1/erc20.sierra.json + casm_path: configs/cairo-contracts/cairo_1/erc20.casm.json + + # erc721_contract: + # v1: + # path: contracts/v2.1.0/openzeppelin_ERC721.sierra.json + # casm_path: contracts/v2.1.0/openzeppelin_ERC721.casm.json + + account_contract: + v1: + path: configs/cairo-contracts/cairo_1/NoValidateAccount.sierra.json + casm_path: configs/cairo-contracts/cairo_1/NoValidateAccount.casm.json + + fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" + num_accounts: 3 + + run: + num_erc20_transfers: 5 + # num_erc721_mints: 5 + + report: + num_blocks: 3 + reports_dir: "reports" + + deployer: + salt: 1 + address: "0x0000000000000000000000000000000000000000000000000000000000000002" + signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" + \ No newline at end of file From 2343153c7c4bd8f11c0aec7d8a1536b441923336 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Tue, 19 Sep 2023 16:41:49 -0600 Subject: [PATCH 04/20] workflow tweak --- .github/workflows/gomu-gomu-no-gatling.yml | 6 +-- benchmark.yml | 61 ++++++++++------------ 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/.github/workflows/gomu-gomu-no-gatling.yml b/.github/workflows/gomu-gomu-no-gatling.yml index 47bfe4447f..5f98a108f9 100644 --- a/.github/workflows/gomu-gomu-no-gatling.yml +++ b/.github/workflows/gomu-gomu-no-gatling.yml @@ -27,11 +27,11 @@ jobs: uses: actions/checkout@v3 # Run Madara - - name: Run Madara --dev - run: madara --dev + - name: Run Madara + run: target/release/madara --dev # Run Gomu Gomu no Gatling Action - name: Run Gomu Gomu no Gatling Action - uses: keep-starknet-strange/gomu-gomu-no-gatling@main + uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: config_path: 'benchmark.yml' diff --git a/benchmark.yml b/benchmark.yml index bccb2ef697..d3163f5aeb 100644 --- a/benchmark.yml +++ b/benchmark.yml @@ -1,35 +1,28 @@ rpc: - url: "http://localhost:9944" - - setup: - erc20_contract: - v1: - path: configs/cairo-contracts/cairo_1/erc20.sierra.json - casm_path: configs/cairo-contracts/cairo_1/erc20.casm.json - - # erc721_contract: - # v1: - # path: contracts/v2.1.0/openzeppelin_ERC721.sierra.json - # casm_path: contracts/v2.1.0/openzeppelin_ERC721.casm.json - - account_contract: - v1: - path: configs/cairo-contracts/cairo_1/NoValidateAccount.sierra.json - casm_path: configs/cairo-contracts/cairo_1/NoValidateAccount.casm.json - - fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" - num_accounts: 3 - - run: - num_erc20_transfers: 5 - # num_erc721_mints: 5 - - report: - num_blocks: 3 - reports_dir: "reports" - - deployer: - salt: 1 - address: "0x0000000000000000000000000000000000000000000000000000000000000002" - signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" - \ No newline at end of file + url: "http://localhost:9944" + +setup: + erc20_contract: + v0: contracts/v0/ERC20.json + + erc721_contract: + v0: contracts/v0/ERC721.json + + account_contract: + v0: contracts/v0/OpenzeppelinAccount.json + + fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" + num_accounts: 3 + +run: + num_erc20_transfers: 1200 + num_erc721_mints: 1200 + +report: + num_blocks: 4 + reports_dir: "reports" + +deployer: + salt: 1 + address: "0x0000000000000000000000000000000000000000000000000000000000000002" + signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" \ No newline at end of file From 5c6e645390d436ffa5cccb5508749d54c85af4ec Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Tue, 19 Sep 2023 19:28:59 -0600 Subject: [PATCH 05/20] changelog update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45077d2f8a..84a2deceb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ - chore: cairo-contracts compilation scripts & docs are updated, cairo_0 contracts recompiled - chore: rebase of core deps and 0.12.1 - +- ci: add gomu gomu no gatling pr benchmark workflow ## v0.1.0 - ci: rm codespell task and rm .codespellignore From e1b99388cfc086074c783ef3d75722557da7bca3 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Tue, 19 Sep 2023 19:36:30 -0600 Subject: [PATCH 06/20] tweak --- .github/workflows/gomu-gomu-no-gatling.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gomu-gomu-no-gatling.yml b/.github/workflows/gomu-gomu-no-gatling.yml index 5f98a108f9..8379ac0a38 100644 --- a/.github/workflows/gomu-gomu-no-gatling.yml +++ b/.github/workflows/gomu-gomu-no-gatling.yml @@ -9,9 +9,8 @@ jobs: benchmark_job: runs-on: [self-hosted, linux, benchmark] steps: - # Caching Step (based on Task - Test Madara Commands) - - name: Cache Cargo - uses: actions/cache@v3 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: | ~/.cargo/bin/ @@ -20,17 +19,9 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} - fail-on-cache-miss: true - - # Checkout code - - name: Checkout code - uses: actions/checkout@v3 - - # Run Madara + fail-on-cache-miss: true - name: Run Madara run: target/release/madara --dev - - # Run Gomu Gomu no Gatling Action - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: From 6042a5dc508dc3f5b3d5f6aa9daef250f27aadc8 Mon Sep 17 00:00:00 2001 From: d-roak Date: Wed, 20 Sep 2023 12:54:09 +0900 Subject: [PATCH 07/20] restructure ci --- .github/workflows/benchmarks.yml | 88 ++-------------------- .github/workflows/gomu-gomu-no-gatling.yml | 28 ------- .github/workflows/pull-request.yml | 15 +--- .github/workflows/push.yml | 19 ++--- 4 files changed, 16 insertions(+), 134 deletions(-) delete mode 100644 .github/workflows/gomu-gomu-no-gatling.yml diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 8df11765cc..54e6eb9e1b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -10,57 +10,6 @@ jobs: runs-on: [self-hosted, linux, benchmark] steps: - uses: actions/checkout@v3 - with: - clean: false - - name: Build tests and install benchmark projects - run: |- - cd tests - npm clean-install - npm run build - cd ../benchmarking - npm i - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: - ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ - github.run_id }} - fail-on-cache-miss: true - - name: Run benchmark - run: | - cd benchmarking - npm run test:ci - - name: Compare result - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: "customBiggerIsBetter" - output-file-path: ./benchmarking/reports/metrics.json - alert-threshold: "120%" - github-token: ${{ secrets.GITHUB_TOKEN }} - fail-on-alert: true - summary-always: ${{ github.ref == 'refs/heads/main' }} - comment-always: false - comment-on-alert: false - auto-push: ${{ github.ref == 'refs/heads/main' }} - - benchmark-with-state-root: - runs-on: [self-hosted, linux, benchmark] - steps: - - uses: actions/checkout@v3 - with: - clean: false - - name: Build tests and install benchmark projects - run: |- - cd tests - npm clean-install - npm run build - cd ../benchmarking - npm i - uses: actions/cache@v3 with: path: | @@ -69,36 +18,11 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: - ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ - github.run_id }} + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} fail-on-cache-miss: true - restore-keys: | - ${{ runner.os }}-cargo - - name: Setup rust toolchain - if: steps.cache.outputs.cache-hit != 'true' - run: rustup show - - name: Setup build deps - run: | - sudo apt-get update - sudo apt-get install -y clang llvm libudev-dev protobuf-compiler - - name: Build the project - run: | - cargo build --release --workspace - - name: Run benchmark - run: | - cd benchmarking - npm run test:ci-state-root:erc20 - - name: Compare result - uses: benchmark-action/github-action-benchmark@v1 + - name: Run Madara + run: target/release/madara --dev + - name: Run Gomu Gomu no Gatling Action + uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: - tool: "customBiggerIsBetter" - output-file-path: ./benchmarking/reports/metrics-state-root.json - alert-threshold: "120%" - github-token: ${{ secrets.GITHUB_TOKEN }} - fail-on-alert: true - summary-always: ${{ github.ref == 'refs/heads/main' }} - comment-always: false - comment-on-alert: false - benchmark-data-dir-path: "dev/bench-with-state-root" - auto-push: ${{ github.ref == 'refs/heads/main' }} + config_path: 'benchmark.yml' diff --git a/.github/workflows/gomu-gomu-no-gatling.yml b/.github/workflows/gomu-gomu-no-gatling.yml deleted file mode 100644 index 8379ac0a38..0000000000 --- a/.github/workflows/gomu-gomu-no-gatling.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Workflow - Pull Request / Gomu Gomu no Gatling - -on: - workflow_dispatch: - pull_request: - branches: [main] - -jobs: - benchmark_job: - runs-on: [self-hosted, linux, benchmark] - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} - fail-on-cache-miss: true - - name: Run Madara - run: target/release/madara --dev - - name: Run Gomu Gomu no Gatling Action - uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main - with: - config_path: 'benchmark.yml' diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 661485255b..673e40267f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -36,14 +36,7 @@ jobs: uses: ./.github/workflows/tests-coverage.yml needs: [rust_build] - # benchmark: - # name: Run benchmarks - # uses: ./.github/workflows/benchmarks.yml - # needs: [rust_build, tests] - # permissions: - # # deployments permission to deploy GitHub pages website - # deployments: write - # # contents permission to update benchmark contents in gh-pages branch - # contents: write - # # post on the pull-request page - # pull-requests: write + benchmark: + name: Run benchmarks + uses: ./.github/workflows/benchmarks.yml + needs: [rust_build, tests] diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8b4ca870b7..2204424b27 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -23,23 +23,16 @@ jobs: tests: name: Run tests and coverage uses: ./.github/workflows/tests-coverage.yml - needs: [rust_build] + needs: rust_build - # benchmark: - # name: Run benchmarks - # uses: ./.github/workflows/benchmarks.yml - # needs: [rust_build, tests] - # permissions: - # # deployments permission to deploy GitHub pages website - # deployments: write - # # contents permission to update benchmark contents in gh-pages branch - # contents: write - # # post on the pull-request page - # pull-requests: write + benchmark: + name: Run benchmarks + uses: ./.github/workflows/benchmarks.yml + needs: [rust_build, tests] rustdoc: name: Deploy docs to GitHub Pages uses: ./.github/workflows/rustdoc.yml - needs: tests + needs: benchmark permissions: contents: write From 28cbcfb7a3ad8571f302e01b739ebe202c4536ae Mon Sep 17 00:00:00 2001 From: d-roak Date: Wed, 20 Sep 2023 12:57:28 +0900 Subject: [PATCH 08/20] rm inexistent tests-coverage --- .github/workflows/pull-request.yml | 7 +------ .github/workflows/push.yml | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index aea8b9897c..9948798a4b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -31,12 +31,7 @@ jobs: uses: ./.github/workflows/linters-cargo.yml needs: rust_build - tests: - name: Run tests and coverage - uses: ./.github/workflows/tests-coverage.yml - needs: rust_build - benchmark: name: Run benchmarks uses: ./.github/workflows/benchmarks.yml - needs: [rust_build, tests] + needs: rust_build diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2204424b27..75a26ac6c4 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -20,15 +20,10 @@ jobs: uses: ./.github/workflows/linters-cargo.yml needs: rust_build - tests: - name: Run tests and coverage - uses: ./.github/workflows/tests-coverage.yml - needs: rust_build - benchmark: name: Run benchmarks uses: ./.github/workflows/benchmarks.yml - needs: [rust_build, tests] + needs: rust_build rustdoc: name: Deploy docs to GitHub Pages From e0cbc8bffa7e0ce67b9baed93b63afa5321485dc Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Wed, 20 Sep 2023 13:21:39 -0600 Subject: [PATCH 09/20] prettier lint --- .github/workflows/benchmarks.yml | 6 ++++-- CHANGELOG.md | 1 + benchmark.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 54e6eb9e1b..4b59b36409 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -18,11 +18,13 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} + key: + ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ + github.run_id }} fail-on-cache-miss: true - name: Run Madara run: target/release/madara --dev - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: - config_path: 'benchmark.yml' + config_path: "benchmark.yml" diff --git a/CHANGELOG.md b/CHANGELOG.md index c0cfb84aa1..eb0d9bc1c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ contracts recompiled - chore: rebase of core deps and 0.12.1 - ci: add gomu gomu no gatling pr benchmark workflow + ## v0.1.0 - ci: rm codespell task and rm .codespellignore diff --git a/benchmark.yml b/benchmark.yml index d3163f5aeb..ce8c4a9d61 100644 --- a/benchmark.yml +++ b/benchmark.yml @@ -25,4 +25,4 @@ report: deployer: salt: 1 address: "0x0000000000000000000000000000000000000000000000000000000000000002" - signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" \ No newline at end of file + signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" From d2842c0ec0edda978af059f6808c19bcb58a2204 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Wed, 20 Sep 2023 13:36:50 -0600 Subject: [PATCH 10/20] database fix --- .github/workflows/benchmarks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 4b59b36409..e6b6be9989 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -22,6 +22,7 @@ jobs: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} fail-on-cache-miss: true + - run: rm -rf /home/ubuntu/.madara/chains/dev - name: Run Madara run: target/release/madara --dev - name: Run Gomu Gomu no Gatling Action From db2467d7d4edf90bb4a5cd163314a2a374f5b751 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Wed, 20 Sep 2023 15:26:06 -0600 Subject: [PATCH 11/20] run madara in background workflow --- .github/workflows/benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index e6b6be9989..ae00e8e255 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -23,8 +23,8 @@ jobs: github.run_id }} fail-on-cache-miss: true - run: rm -rf /home/ubuntu/.madara/chains/dev - - name: Run Madara - run: target/release/madara --dev + - name: Run Madara in background + run: target/release/madara --dev & sleep 15 - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: From 5042c7c02d713ea94414ee97378275763c439e47 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Fri, 22 Sep 2023 22:56:46 -0600 Subject: [PATCH 12/20] cargolock --- Cargo.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c12c12bff5..4c6314afa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6077,7 +6077,7 @@ dependencies = [ [[package]] name = "madara" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "blockifier", @@ -6140,7 +6140,7 @@ dependencies = [ [[package]] name = "madara-runtime" -version = "0.2.0" +version = "0.3.0" dependencies = [ "blockifier", "frame-benchmarking", @@ -6229,7 +6229,7 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "mc-block-proposer" -version = "0.2.0" +version = "0.3.0" dependencies = [ "futures", "futures-timer", @@ -6289,7 +6289,7 @@ dependencies = [ [[package]] name = "mc-db" -version = "0.2.0" +version = "0.3.0" dependencies = [ "ethers", "kvdb-rocksdb", @@ -6305,7 +6305,7 @@ dependencies = [ [[package]] name = "mc-mapping-sync" -version = "0.2.0" +version = "0.3.0" dependencies = [ "futures", "futures-timer", @@ -6326,7 +6326,7 @@ dependencies = [ [[package]] name = "mc-rpc" -version = "0.2.0" +version = "0.3.0" dependencies = [ "blockifier", "frame-support", @@ -6362,7 +6362,7 @@ dependencies = [ [[package]] name = "mc-rpc-core" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anyhow", "assert_matches", @@ -6393,7 +6393,7 @@ dependencies = [ [[package]] name = "mc-storage" -version = "0.2.0" +version = "0.3.0" dependencies = [ "blockifier", "frame-support", @@ -6598,7 +6598,7 @@ dependencies = [ [[package]] name = "mp-block" -version = "0.2.0" +version = "0.3.0" dependencies = [ "blockifier", "mp-felt", @@ -6612,7 +6612,7 @@ dependencies = [ [[package]] name = "mp-commitments" -version = "0.2.0" +version = "0.3.0" dependencies = [ "bitvec", "derive_more", @@ -6630,7 +6630,7 @@ dependencies = [ [[package]] name = "mp-digest-log" -version = "0.2.0" +version = "0.3.0" dependencies = [ "assert_matches", "mp-block", @@ -6640,7 +6640,7 @@ dependencies = [ [[package]] name = "mp-fee" -version = "0.2.0" +version = "0.3.0" dependencies = [ "blockifier", "mp-state", @@ -6650,7 +6650,7 @@ dependencies = [ [[package]] name = "mp-felt" -version = "0.2.0" +version = "0.3.0" dependencies = [ "cairo-vm", "hex", @@ -6665,7 +6665,7 @@ dependencies = [ [[package]] name = "mp-hashers" -version = "0.2.0" +version = "0.3.0" dependencies = [ "mp-felt", "parity-scale-codec", @@ -6677,7 +6677,7 @@ dependencies = [ [[package]] name = "mp-sequencer-address" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "parity-scale-codec", @@ -6688,7 +6688,7 @@ dependencies = [ [[package]] name = "mp-state" -version = "0.2.0" +version = "0.3.0" dependencies = [ "blockifier", "starknet_api", @@ -6696,7 +6696,7 @@ dependencies = [ [[package]] name = "mp-storage" -version = "0.2.0" +version = "0.3.0" dependencies = [ "parity-scale-codec", "serde", @@ -6704,7 +6704,7 @@ dependencies = [ [[package]] name = "mp-transactions" -version = "0.2.0" +version = "0.3.0" dependencies = [ "assert_matches", "blockifier", @@ -7581,7 +7581,7 @@ dependencies = [ [[package]] name = "pallet-starknet" -version = "0.2.0" +version = "0.3.0" dependencies = [ "assert_matches", "blockifier", From bfa3bb7515705a137875312bd49278c7bcf017f7 Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Sat, 23 Sep 2023 07:24:02 -0600 Subject: [PATCH 13/20] config path tweak --- .github/workflows/benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index ae00e8e255..14ef8d1d6e 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -28,4 +28,4 @@ jobs: - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: - config_path: "benchmark.yml" + config_path: "./benchmark.yml" From d2b04b9fba2a3a6f0391e94badb88964195109ae Mon Sep 17 00:00:00 2001 From: Daniel Bejarano Date: Sat, 23 Sep 2023 07:24:02 -0600 Subject: [PATCH 14/20] config path tweak --- .github/workflows/benchmarks.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index ae00e8e255..e49502670e 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -25,7 +25,11 @@ jobs: - run: rm -rf /home/ubuntu/.madara/chains/dev - name: Run Madara in background run: target/release/madara --dev & sleep 15 + - name: List Working level directories and files + run: ls -la + - name: Print Working Directory + run: pwd - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: - config_path: "benchmark.yml" + config_path: "./config/default.yaml" From 7e48051f1fd2d5a42e2ad0133bbde0d5b4fe1f46 Mon Sep 17 00:00:00 2001 From: d-roak Date: Sun, 24 Sep 2023 00:22:56 +0900 Subject: [PATCH 15/20] revert path for benchmark config; correct contract paths --- .github/workflows/benchmarks.yml | 2 +- benchmark.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 2431cf29c3..ae00e8e255 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -28,4 +28,4 @@ jobs: - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: - config_path: "/home/ubuntu/actions-runner-bench/_work/madara/madara/benchmark.yml/benchmark.yml" + config_path: "benchmark.yml" diff --git a/benchmark.yml b/benchmark.yml index ce8c4a9d61..7dee577897 100644 --- a/benchmark.yml +++ b/benchmark.yml @@ -3,13 +3,13 @@ rpc: setup: erc20_contract: - v0: contracts/v0/ERC20.json + v0: configs/cairo-contracts/ERC20.json erc721_contract: - v0: contracts/v0/ERC721.json + v0: configs/cairo-contracts/ERC721.json account_contract: - v0: contracts/v0/OpenzeppelinAccount.json + v0: configs/cairo-contracts/OpenzeppelinAccount.json fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" num_accounts: 3 From d8dc35156125612e6f2f5b69355a2d94215ef5da Mon Sep 17 00:00:00 2001 From: d-roak Date: Sun, 24 Sep 2023 00:43:33 +0900 Subject: [PATCH 16/20] run on gh managed machine; kill madara after benchmark --- .github/workflows/benchmarks.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index ae00e8e255..962f5204fb 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -7,7 +7,7 @@ on: jobs: benchmark: - runs-on: [self-hosted, linux, benchmark] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/cache@v3 @@ -22,10 +22,11 @@ jobs: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} fail-on-cache-miss: true - - run: rm -rf /home/ubuntu/.madara/chains/dev - name: Run Madara in background run: target/release/madara --dev & sleep 15 - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: config_path: "benchmark.yml" + - name: Stop Madara + run: killall madara From e531a4619ae66f33f11914fbbc0e2320da7a276d Mon Sep 17 00:00:00 2001 From: d-roak Date: Fri, 13 Oct 2023 05:44:36 +0900 Subject: [PATCH 17/20] add setup; change bootstrap and shutdown of madara --- .github/workflows/benchmarks.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 962f5204fb..64978fbb75 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -22,11 +22,17 @@ jobs: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} fail-on-cache-miss: true + - name: Setup Madara + run: target/release/madara setup --chain=dev --from-remote - name: Run Madara in background - run: target/release/madara --dev & sleep 15 + id: madara + run: | + target/release/madara --dev & + echo "RUN_PID=$\!" >> "$GITHUB_OUTPUT" + while ! echo exit | nc localhost 9944; do sleep 1; done - name: Run Gomu Gomu no Gatling Action uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main with: config_path: "benchmark.yml" - name: Stop Madara - run: killall madara + run: kill "${{ steps.madara.outputs.RUN_PID }}" From 5528cfa285784ea6a050e0df63815e16afa353cd Mon Sep 17 00:00:00 2001 From: d-roak Date: Thu, 19 Oct 2023 00:48:45 +0900 Subject: [PATCH 18/20] prettier --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5a295563cd..72678e67a8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -43,4 +43,4 @@ jobs: benchmark: name: Run benchmarks uses: ./.github/workflows/benchmarks.yml - needs: madara_commands \ No newline at end of file + needs: madara_commands From 24fee9b4fc61e2564e0fcc3e4c431cbe69fd52a5 Mon Sep 17 00:00:00 2001 From: d-roak Date: Thu, 19 Oct 2023 00:57:55 +0900 Subject: [PATCH 19/20] change cache retrieval in benchmark action --- .github/workflows/benchmarks.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 64978fbb75..deb2cbcf4a 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -12,12 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/cache@v3 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ + path: target/release/madara key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} From ec111c1767c478b82d0afb65f5128e90ce0e7f8b Mon Sep 17 00:00:00 2001 From: d-roak Date: Thu, 19 Oct 2023 09:40:34 +0900 Subject: [PATCH 20/20] change contracts paths --- benchmark.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark.yml b/benchmark.yml index 7dee577897..ee1d3b9631 100644 --- a/benchmark.yml +++ b/benchmark.yml @@ -3,13 +3,13 @@ rpc: setup: erc20_contract: - v0: configs/cairo-contracts/ERC20.json + v0: configs/genesis-assets/ERC20.json erc721_contract: - v0: configs/cairo-contracts/ERC721.json + v0: configs/genesis-assets/ERC721.json account_contract: - v0: configs/cairo-contracts/OpenzeppelinAccount.json + v0: configs/genesis-assets/OpenzeppelinAccount.json fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" num_accounts: 3