From a39e1d8749c50f06518df3a5b39809453d2be9d1 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Mon, 4 Aug 2025 15:14:28 +0200 Subject: [PATCH 01/15] add a job to run performance tests --- .github/workflows/deploy-and-test.yaml | 58 ++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index cd89b77bbc..db255f676b 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -52,10 +52,10 @@ on: concurrency: group: shared_${{ inputs.environment }}_environment - cancel-in-progress: false + cancel-in-progress: false permissions: - contents: read + contents: read env: DOCKER_REGISTRY: nethermind.jfrog.io @@ -90,7 +90,7 @@ jobs: run: | SOURCE_TAG=${{ env.DOCKER_REGISTRY }}/${{ inputs.source_repo }}/juno:${{ inputs.docker_image_tag }} TARGET_TAG=${{ env.DOCKER_REGISTRY }}/${{ inputs.target_repo }}/juno:${{ inputs.docker_image_tag }} - + if [ "${{ inputs.source_repo }}" = "${{ inputs.target_repo }}" ]; then echo "Source and target repositories are the same, pushing as latest" docker buildx imagetools create -t ${{ env.DOCKER_REGISTRY }}/${{ inputs.target_repo }}/juno:latest $SOURCE_TAG @@ -98,7 +98,7 @@ jobs: echo "Copying image from source to target repository" oras cp -r $SOURCE_TAG $TARGET_TAG,latest fi - + - name: Verify Deployment Version run: | bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.RPC_URL }} ${{ secrets.AUTH_TOKEN }} ${{ inputs.docker_image_tag }} @@ -154,3 +154,53 @@ jobs: STARKNET_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY_3 }} STARKNET_PUBLIC_KEY: ${{ secrets.TEST_ACCOUNT_PUBLIC_KEY_3 }} STARKNET_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS_3 }} + + rps-performance: + needs: [deploy] + # uses: ./.github/workflows/starknet-rs-tests.yml + # secrets: + # STARKNET_RPC: ${{ secrets.RPC_URL }}/v0_8?apikey=${{ secrets.AUTH_TOKEN }} + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + with: + repository: NethermindEth/starknet-rpc-tests + ref: "fix/load-tests" + + # - name: Setup Go + # uses: actions/setup-go@v5 + # with: + # go-version: "1.23" + # + # - name: Install dependencies + # run: go mod download + + - name: Setup K6 + uses: grafana/setup-k6-action@v1 + - name: Run local k6 test + uses: grafana/run-k6-action@v1 + env: + NODE_URL: "${{ secrets.TEST_RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" + # NODE_URL: "${{ secrets.TEST_RPC_URL }}/${{ inputs.rpc_version }}?apikey=${{ secrets.AUTH_TOKEN }}" + NETWORK: "sepolia" + LOAD_FACTOR: 1 + DURATION: "30s" + with: + path: test.js + + # - name: Configure test environment variables + # run: | + # echo + # echo "WS_PROVIDER_URL=${{ secrets.TEST_WS_RPC_URL }}/${{ inputs.rpc_version }}?apikey=${{ secrets.AUTH_TOKEN }}" >> $GITHUB_ENV + # echo "STARKNET_PRIVATE_KEY=${{ secrets.STARKNET_PRIVATE_KEY }}" >> $GITHUB_ENV + # echo "STARKNET_PUBLIC_KEY=${{ secrets.STARKNET_PUBLIC_KEY }}" >> $GITHUB_ENV + # echo "STARKNET_ACCOUNT_ADDRESS=${{ secrets.STARKNET_ACCOUNT_ADDRESS }}" >> $GITHUB_ENV + # + # - name: Run RPC tests + # working-directory: rpc + # env: + # # In starknet version 0.14.0 `pending` block is replaced by 'pre_confirmed' block, + # # thus there will be no more pending transcations with `pending` semantics. + # TESTS_TO_SKIP: "TestSubscribePendingTransactions" + # run: go test -skip "$TESTS_TO_SKIP" -timeout 1200s -v -env testnet . From d08dfe02d0e79d1eba15a4e8fd79baa5baeea045 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Tue, 5 Aug 2025 11:53:33 +0200 Subject: [PATCH 02/15] add github token --- .github/workflows/deploy-and-test.yaml | 34 ++++++++------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index db255f676b..c89e5f9aa0 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -162,19 +162,21 @@ jobs: # STARKNET_RPC: ${{ secrets.RPC_URL }}/v0_8?apikey=${{ secrets.AUTH_TOKEN }} runs-on: ubuntu-latest steps: + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: "starknet-rpc-tests" + - name: Checkout the repo uses: actions/checkout@v4 with: repository: NethermindEth/starknet-rpc-tests ref: "fix/load-tests" - - # - name: Setup Go - # uses: actions/setup-go@v5 - # with: - # go-version: "1.23" - # - # - name: Install dependencies - # run: go mod download + token: ${{ steps.generate-token.outputs.token }} - name: Setup K6 uses: grafana/setup-k6-action@v1 @@ -188,19 +190,3 @@ jobs: DURATION: "30s" with: path: test.js - - # - name: Configure test environment variables - # run: | - # echo - # echo "WS_PROVIDER_URL=${{ secrets.TEST_WS_RPC_URL }}/${{ inputs.rpc_version }}?apikey=${{ secrets.AUTH_TOKEN }}" >> $GITHUB_ENV - # echo "STARKNET_PRIVATE_KEY=${{ secrets.STARKNET_PRIVATE_KEY }}" >> $GITHUB_ENV - # echo "STARKNET_PUBLIC_KEY=${{ secrets.STARKNET_PUBLIC_KEY }}" >> $GITHUB_ENV - # echo "STARKNET_ACCOUNT_ADDRESS=${{ secrets.STARKNET_ACCOUNT_ADDRESS }}" >> $GITHUB_ENV - # - # - name: Run RPC tests - # working-directory: rpc - # env: - # # In starknet version 0.14.0 `pending` block is replaced by 'pre_confirmed' block, - # # thus there will be no more pending transcations with `pending` semantics. - # TESTS_TO_SKIP: "TestSubscribePendingTransactions" - # run: go test -skip "$TESTS_TO_SKIP" -timeout 1200s -v -env testnet . From 8b877d92bfa54774ebef309f3161eeb9e78c0611 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Tue, 5 Aug 2025 12:32:17 +0200 Subject: [PATCH 03/15] fix app_id --- .github/workflows/deploy-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index c89e5f9aa0..c55caa1f9a 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -166,7 +166,7 @@ jobs: id: generate-token uses: actions/create-github-app-token@v1 with: - app-id: ${{ secrets.APP_ID }} + app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} repositories: "starknet-rpc-tests" From d5238ba870c5cb5e21b35c6687c33ae8fac40990 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Tue, 5 Aug 2025 13:44:03 +0200 Subject: [PATCH 04/15] propagate secrets --- .github/workflows/deploy-and-test.yaml | 2 ++ .github/workflows/deploy-dev-and-test.yml | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index c55caa1f9a..dcb4163c3a 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -49,6 +49,8 @@ on: required: true AUTH_TOKEN: required: true + APP_PRIVATE_KEY: + required: true concurrency: group: shared_${{ inputs.environment }}_environment diff --git a/.github/workflows/deploy-dev-and-test.yml b/.github/workflows/deploy-dev-and-test.yml index 28734a5048..94bcf8b933 100644 --- a/.github/workflows/deploy-dev-and-test.yml +++ b/.github/workflows/deploy-dev-and-test.yml @@ -13,7 +13,6 @@ on: permissions: contents: read - jobs: build: # Skip for PRs from forks as they don't have access to secrets @@ -25,7 +24,7 @@ jobs: secrets: ARTIFACTORY_NUBIA_USERNAME: ${{ secrets.ARTIFACTORY_NUBIA_USERNAME }} ARTIFACTORY_NUBIA_TOKEN_DEVELOPER: ${{ secrets.ARTIFACTORY_NUBIA_TOKEN_DEVELOPER }} - + smoke_test_100_blocks: needs: [build] uses: ./.github/workflows/smoke-test.yaml @@ -36,7 +35,7 @@ jobs: APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} ARTIFACTORY_NUBIA_USERNAME: ${{ secrets.ARTIFACTORY_NUBIA_USERNAME }} ARTIFACTORY_NUBIA_TOKEN_DEVELOPER: ${{ secrets.ARTIFACTORY_NUBIA_TOKEN_DEVELOPER }} - + dev_deploy_test: needs: [build] uses: ./.github/workflows/deploy-and-test.yaml @@ -58,4 +57,6 @@ jobs: TEST_ACCOUNT_ADDRESS_3: ${{ secrets.TEST_ACCOUNT_ADDRESS_3 }} TEST_ACCOUNT_PRIVATE_KEY_3: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY_3 }} TEST_ACCOUNT_PUBLIC_KEY_3: ${{ secrets.TEST_ACCOUNT_PUBLIC_KEY_3 }} - AUTH_TOKEN: ${{ secrets.DEV_AUTH_TOKEN }} \ No newline at end of file + AUTH_TOKEN: ${{ secrets.DEV_AUTH_TOKEN }} + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} + From 5209910984d3e1adb8a1d26cd8df37fd8bdb65ed Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Tue, 5 Aug 2025 15:10:32 +0200 Subject: [PATCH 05/15] fix test path --- .github/workflows/deploy-and-test.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index dcb4163c3a..b84579f6d1 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -159,9 +159,6 @@ jobs: rps-performance: needs: [deploy] - # uses: ./.github/workflows/starknet-rs-tests.yml - # secrets: - # STARKNET_RPC: ${{ secrets.RPC_URL }}/v0_8?apikey=${{ secrets.AUTH_TOKEN }} runs-on: ubuntu-latest steps: - name: Generate a token @@ -191,4 +188,4 @@ jobs: LOAD_FACTOR: 1 DURATION: "30s" with: - path: test.js + path: load_tests/test_cases.js From 429d760dea2939a1665292072be7146927f0f83c Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Tue, 5 Aug 2025 21:22:07 +0200 Subject: [PATCH 06/15] port workflow fix --- .github/workflows/deploy-dev-and-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-dev-and-test.yml b/.github/workflows/deploy-dev-and-test.yml index 29400580d9..040cba7eba 100644 --- a/.github/workflows/deploy-dev-and-test.yml +++ b/.github/workflows/deploy-dev-and-test.yml @@ -20,6 +20,8 @@ jobs: if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork permissions: actions: write + contents: read + id-token: write uses: ./.github/workflows/build-image.yaml smoke_test_100_blocks: @@ -52,4 +54,3 @@ jobs: TEST_ACCOUNT_PUBLIC_KEY_3: ${{ secrets.TEST_ACCOUNT_PUBLIC_KEY_3 }} AUTH_TOKEN: ${{ secrets.DEV_AUTH_TOKEN }} APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} - From f199d86fcef09254657b28c944b4b1b2c62947e0 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Wed, 6 Aug 2025 11:53:35 +0200 Subject: [PATCH 07/15] fix? --- .github/workflows/deploy-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index 1f649e0f8b..08010c612b 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -196,4 +196,4 @@ jobs: LOAD_FACTOR: 1 DURATION: "30s" with: - path: load_tests/test_cases.js + path: ./load_tests/test_cases.js From c5230a9b28580c96b066933b1b4dc47f4e9a40d2 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Wed, 6 Aug 2025 12:09:58 +0200 Subject: [PATCH 08/15] provide a proper path --- .github/workflows/deploy-and-test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index 08010c612b..03ee64c07d 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -191,9 +191,8 @@ jobs: uses: grafana/run-k6-action@v1 env: NODE_URL: "${{ secrets.TEST_RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" - # NODE_URL: "${{ secrets.TEST_RPC_URL }}/${{ inputs.rpc_version }}?apikey=${{ secrets.AUTH_TOKEN }}" NETWORK: "sepolia" LOAD_FACTOR: 1 DURATION: "30s" with: - path: ./load_tests/test_cases.js + path: ./starknet-rpc-tests/load_tests/test_cases.js From d528768af73bc6320b6d5c741b1c373b249ede7a Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Wed, 6 Aug 2025 12:41:01 +0200 Subject: [PATCH 09/15] more fixes --- .github/workflows/deploy-and-test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index 03ee64c07d..b2339f84b6 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -184,6 +184,9 @@ jobs: repository: NethermindEth/starknet-rpc-tests ref: "fix/load-tests" token: ${{ steps.generate-token.outputs.token }} + path: starknet-rpc-tests + + - run: ls -la - name: Setup K6 uses: grafana/setup-k6-action@v1 @@ -195,4 +198,4 @@ jobs: LOAD_FACTOR: 1 DURATION: "30s" with: - path: ./starknet-rpc-tests/load_tests/test_cases.js + path: ./starknet-rpc-tests/load-tests/test_cases.js From dd0dcad1fb066c7e30316da38d02973f77220f6a Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Wed, 6 Aug 2025 14:10:12 +0200 Subject: [PATCH 10/15] fix node_url --- .github/workflows/deploy-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index b2339f84b6..ed06de80fc 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -193,7 +193,7 @@ jobs: - name: Run local k6 test uses: grafana/run-k6-action@v1 env: - NODE_URL: "${{ secrets.TEST_RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" + NODE_URL: "${{ secrets.RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" NETWORK: "sepolia" LOAD_FACTOR: 1 DURATION: "30s" From 1da1ff8e6fb28d94c67b0f800e8bda1326d49516 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Wed, 6 Aug 2025 14:11:47 +0200 Subject: [PATCH 11/15] cleanup --- .github/workflows/deploy-and-test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index ed06de80fc..3d6e2292f1 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -186,10 +186,9 @@ jobs: token: ${{ steps.generate-token.outputs.token }} path: starknet-rpc-tests - - run: ls -la - - name: Setup K6 uses: grafana/setup-k6-action@v1 + - name: Run local k6 test uses: grafana/run-k6-action@v1 env: From f067bda6e19e40db8f732b378e378eac963f6432 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Wed, 6 Aug 2025 18:34:10 +0200 Subject: [PATCH 12/15] typo --- .github/workflows/deploy-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index 3d6e2292f1..8a7bb6a200 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -165,7 +165,7 @@ jobs: STARKNET_PUBLIC_KEY: ${{ secrets.TEST_ACCOUNT_PUBLIC_KEY_3 }} STARKNET_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS_3 }} - rps-performance: + rpc-performance: needs: [deploy] runs-on: ubuntu-latest steps: From bf090f3e6a876c794a2854cf438e83d412f4233f Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Mon, 18 Aug 2025 20:14:08 +0200 Subject: [PATCH 13/15] update the load --- .github/workflows/deploy-and-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index e89836ae37..05ce6b0893 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -194,7 +194,7 @@ jobs: env: NODE_URL: "${{ secrets.RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" NETWORK: "sepolia" - LOAD_FACTOR: 1 - DURATION: "30s" + LOAD_FACTOR: 10 + DURATION: "60s" with: path: ./starknet-rpc-tests/load-tests/test_cases.js From 0ae99e5c0ddd1c0b8cea0839456b56d748f33a85 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Mon, 18 Aug 2025 20:37:44 +0200 Subject: [PATCH 14/15] switch to bash --- .github/workflows/deploy-and-test.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index 05ce6b0893..4978e40788 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -189,12 +189,21 @@ jobs: - name: Setup K6 uses: grafana/setup-k6-action@v1 - - name: Run local k6 test - uses: grafana/run-k6-action@v1 + - name: Run k6 (bash) env: NODE_URL: "${{ secrets.RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" NETWORK: "sepolia" LOAD_FACTOR: 10 DURATION: "60s" - with: - path: ./starknet-rpc-tests/load-tests/test_cases.js + run: | + k6 run ./starknet-rpc-tests/load-tests/test_cases.js + + # - name: Run local k6 test + # uses: grafana/run-k6-action@v1 + # env: + # NODE_URL: "${{ secrets.RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" + # NETWORK: "sepolia" + # LOAD_FACTOR: 10 + # DURATION: "60s" + # with: + # path: ./starknet-rpc-tests/load-tests/test_cases.js From e9a4af99e7cdf79bbfa913331bf65e23ffbd0ce9 Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Thu, 21 Aug 2025 12:44:36 +0200 Subject: [PATCH 15/15] pin setup-k6 action --- .github/workflows/deploy-and-test.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/deploy-and-test.yaml b/.github/workflows/deploy-and-test.yaml index 05a15a02f0..e485d259b6 100644 --- a/.github/workflows/deploy-and-test.yaml +++ b/.github/workflows/deploy-and-test.yaml @@ -187,7 +187,7 @@ jobs: path: starknet-rpc-tests - name: Setup K6 - uses: grafana/setup-k6-action@v1 + uses: grafana/setup-k6-action@ffe7d7290dfa715e48c2ccc924d068444c94bde2 - name: Run k6 (bash) env: @@ -197,13 +197,3 @@ jobs: DURATION: "60s" run: | k6 run ./starknet-rpc-tests/load-tests/test_cases.js - - # - name: Run local k6 test - # uses: grafana/run-k6-action@v1 - # env: - # NODE_URL: "${{ secrets.RPC_URL }}?apikey=${{ secrets.AUTH_TOKEN }}" - # NETWORK: "sepolia" - # LOAD_FACTOR: 10 - # DURATION: "60s" - # with: - # path: ./starknet-rpc-tests/load-tests/test_cases.js