refactor: move provider to background thread #3840
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: EDR Benchmarks | |
| on: | |
| # Deliberately do not run on merge_group | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| working-directory: js/benchmark | |
| concurrency: | |
| group: ${{github.workflow}}-${{github.ref}} | |
| # Don't cancel in progress jobs in main | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| benchmarks-test: | |
| name: Benchmarks test | |
| environment: github-action-benchmark | |
| runs-on: edr-benchmark-runner | |
| # Only run for trusted collaborators since third-parties could run malicious code on the self-hosted benchmark runner. | |
| if: github.ref == 'refs/heads/main' || github.repository == github.event.pull_request.head.repo.full_name | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - uses: socketdev/action@ba6de6cc0565af1f42295590380973573297e31f # v1.3.2 | |
| with: | |
| mode: firewall | |
| - uses: ./.github/actions/setup-node | |
| - uses: ./.github/actions/setup-rust | |
| - name: Install packages | |
| run: sfw pnpm install --frozen-lockfile --prefer-offline | |
| - name: Run benchmark tests | |
| run: pnpm test | |
| js-scenario-benchmark: | |
| name: Run JS scenario runner benchmark for Hardhat Node style workload | |
| environment: github-action-benchmark | |
| runs-on: edr-benchmark-runner | |
| needs: benchmarks-test | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - uses: socketdev/action@ba6de6cc0565af1f42295590380973573297e31f # v1.3.2 | |
| with: | |
| mode: firewall | |
| - uses: ./.github/actions/setup-node | |
| - uses: ./.github/actions/setup-rust | |
| - name: Install packages | |
| run: sfw pnpm install --frozen-lockfile --prefer-offline | |
| - name: Run benchmark | |
| run: pnpm run providerBenchmark | |
| - name: Validate regressions | |
| run: pnpm run verifyProviderBenchmark | |
| - name: Generate report for github-action-benchmark | |
| run: pnpm run --silent reportProviderBenchmark | tee scenario-report.json | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1 | |
| with: | |
| tool: customSmallerIsBetter | |
| output-file-path: js/benchmark/scenario-report.json | |
| gh-repository: github.com/nomic-foundation-automation/edr-benchmark-results | |
| gh-pages-branch: main | |
| benchmark-data-dir-path: bench | |
| github-token: ${{ secrets.BENCHMARK_GITHUB_TOKEN }} | |
| # Only save the data for main branch pushes. For PRs we only compare | |
| auto-push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} | |
| alert-threshold: "110%" | |
| # Only fail on pull requests, don't break CI in main | |
| fail-on-alert: ${{ github.event_name == 'pull_request' }} | |
| # Enable Job Summary for PRs | |
| summary-always: true | |
| max-items-in-chart: 50 | |
| js-soltests-benchmark: | |
| name: Run JS Solidity test runner benchmark | |
| environment: github-action-benchmark | |
| runs-on: edr-benchmark-runner | |
| needs: benchmarks-test | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - uses: socketdev/action@ba6de6cc0565af1f42295590380973573297e31f # v1.3.2 | |
| with: | |
| mode: firewall | |
| - uses: ./.github/actions/setup-node | |
| - uses: ./.github/actions/setup-rust | |
| - name: Cache EDR RPC cache | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: | | |
| **/edr-cache | |
| key: edr-rs-rpc-cache-v1 | |
| - name: Install packages | |
| run: sfw pnpm install --frozen-lockfile --prefer-offline | |
| - name: Run benchmark and generate report for github-action-benchmark | |
| env: | |
| ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }} | |
| run: pnpm run --silent soltestsBenchmark --benchmark-output soltest-report.json | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1 | |
| with: | |
| tool: customSmallerIsBetter | |
| output-file-path: js/benchmark/soltest-report.json | |
| gh-repository: github.com/nomic-foundation-automation/edr-benchmark-results | |
| gh-pages-branch: main | |
| benchmark-data-dir-path: soltests | |
| github-token: ${{ secrets.BENCHMARK_GITHUB_TOKEN }} | |
| # Only save the data for main branch pushes. For PRs we only compare | |
| auto-push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} | |
| alert-threshold: "110%" | |
| # Only fail on pull requests, don't break CI in main | |
| fail-on-alert: ${{ github.event_name == 'pull_request' }} | |
| # Enable Job Summary for PRs | |
| summary-always: true | |
| max-items-in-chart: 1000 |