-
Notifications
You must be signed in to change notification settings - Fork 50
feat: add load-test payload worker for base-load-test integration #171
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
base: main
Are you sure you want to change the base?
Changes from all commits
35db44b
39fbbe5
884b02c
6193660
01d084d
ed5fbe8
2cd345c
174a912
714dca3
c6b342c
b42da26
86d1fde
2490bbc
1779c3f
4339627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,96 @@ | ||||||||||||||||||||||||||||||||
| name: Load Test | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| build-binaries: | ||||||||||||||||||||||||||||||||
| name: Build binaries | ||||||||||||||||||||||||||||||||
| uses: ./.github/workflows/_build-binaries.yaml | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| load-test: | ||||||||||||||||||||||||||||||||
| name: Run load test benchmark | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||
| needs: [build-binaries] | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - name: Harden the runner (Audit all outbound calls) | ||||||||||||||||||||||||||||||||
| uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| egress-policy: audit | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Set up Go | ||||||||||||||||||||||||||||||||
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Download base-reth-node | ||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| name: base-reth-node | ||||||||||||||||||||||||||||||||
| path: ${{ runner.temp }}/bin/ | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Download builder | ||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| name: builder | ||||||||||||||||||||||||||||||||
| path: ${{ runner.temp }}/bin/ | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Download base-load-test | ||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| name: base-load-test | ||||||||||||||||||||||||||||||||
| path: ${{ runner.temp }}/bin/ | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Make binaries executable | ||||||||||||||||||||||||||||||||
| run: chmod +x ${{ runner.temp }}/bin/* | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Run load test benchmark | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| mkdir -p ${{ runner.temp }}/data-dir | ||||||||||||||||||||||||||||||||
| mkdir -p ${{ runner.temp }}/output | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| go run benchmark/cmd/main.go \ | ||||||||||||||||||||||||||||||||
| --log.level info \ | ||||||||||||||||||||||||||||||||
| run \ | ||||||||||||||||||||||||||||||||
| --config configs/examples/load-test.yml \ | ||||||||||||||||||||||||||||||||
| --root-dir ${{ runner.temp }}/data-dir \ | ||||||||||||||||||||||||||||||||
| --output-dir ${{ runner.temp }}/output \ | ||||||||||||||||||||||||||||||||
| --builder-bin ${{ runner.temp }}/bin/builder \ | ||||||||||||||||||||||||||||||||
| --base-reth-node-bin ${{ runner.temp }}/bin/base-reth-node \ | ||||||||||||||||||||||||||||||||
| --load-test-bin ${{ runner.temp }}/bin/base-load-test | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Setup Node.js | ||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| node-version: "20" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Build Report | ||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| cp -r ${{ runner.temp }}/output/ ./output/ || true | ||||||||||||||||||||||||||||||||
| pushd report | ||||||||||||||||||||||||||||||||
| npm install | ||||||||||||||||||||||||||||||||
| npm run build | ||||||||||||||||||||||||||||||||
| popd | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Upload Output | ||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| name: load-test-output | ||||||||||||||||||||||||||||||||
| path: ${{ runner.temp }}/output/ | ||||||||||||||||||||||||||||||||
| retention-days: 7 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Upload Report | ||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| name: load-test-report | ||||||||||||||||||||||||||||||||
| path: report/dist/ | ||||||||||||||||||||||||||||||||
| retention-days: 7 | ||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+96
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI about 18 hours ago In general, the fix is to add an explicit The single best fix here, without changing functionality, is to add a root-level permissions:
contents: readNo additional imports, methods, or definitions are needed; this is purely a YAML configuration change within the workflow file.
Suggested changeset
1
.github/workflows/load-test.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Load test throughput test | ||
| description: Test builder throughput using base-load-test binary as transaction generator | ||
| payloads: | ||
| - name: Load Test | ||
| type: load-test | ||
| id: load-test | ||
| sender_count: 10 | ||
| transactions: | ||
| - weight: 70 | ||
| type: transfer | ||
| - weight: 20 | ||
| type: calldata | ||
| max_size: 256 | ||
| - weight: 10 | ||
| type: precompile | ||
| target: sha256 | ||
|
|
||
| benchmarks: | ||
| - variables: | ||
| - type: payload | ||
| value: load-test | ||
| - type: node_type | ||
| value: builder | ||
| - type: validator_node_type | ||
| value: base-reth-node | ||
| - type: num_blocks | ||
| value: 10 | ||
| - type: gas_limit | ||
| value: 1000000000 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI about 18 hours ago
In general, the fix is to add an explicit
permissions:block to the workflow (at the top level or per job) that grants only the minimal scopes required. Because this workflow only reads the repository and uses artifacts, it can safely usecontents: readand no other write scopes. Definingpermissionsat the workflow root applies to all jobs that do not override it.The best fix here is to add a root-level
permissions:block just after theon:block, settingcontents: read. This documents that the workflow only needs read access to the repo contents and ensures theGITHUB_TOKENwill not unexpectedly have broader privileges if organization or repository defaults change. No functional behavior of the workflow changes, since none of the steps require write access to repository contents or other resources.Concretely:
.github/workflows/load-test.yaml.workflow_dispatch:) and before theconcurrency:block, insert:No imports or additional methods are needed because this is purely a YAML configuration change for the workflow.