|
| 1 | +--- |
| 2 | +name: Benchmarks |
| 3 | +permissions: {} |
| 4 | +"on": |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + paths: |
| 12 | + - 'test/e2e/benchmark/**' |
| 13 | + - 'test/e2e/evm_contract_bench_test.go' |
| 14 | + - 'test/e2e/evm_test_common.go' |
| 15 | + - 'test/e2e/sut_helper.go' |
| 16 | + - 'block/internal/executing/**' |
| 17 | + - '.github/workflows/benchmark.yml' |
| 18 | + workflow_dispatch: |
| 19 | + |
| 20 | +jobs: |
| 21 | + evm-benchmark: |
| 22 | + name: EVM Contract Benchmark |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 30 |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 27 | + - name: Set up Go |
| 28 | + uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 |
| 29 | + with: |
| 30 | + go-version-file: ./go.mod |
| 31 | + - name: Set up Docker Buildx |
| 32 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 |
| 33 | + - name: Install just |
| 34 | + uses: extractions/setup-just@v3 |
| 35 | + - name: Build binaries |
| 36 | + run: just build-evm build-da |
| 37 | + - name: Run EVM benchmarks |
| 38 | + run: | |
| 39 | + cd test/e2e && go test -tags evm -bench=. -benchmem -run='^$' \ |
| 40 | + -timeout=10m --evm-binary=../../build/evm | tee output.txt |
| 41 | + - name: Run Block Executor benchmarks |
| 42 | + run: | |
| 43 | + go test -bench=BenchmarkProduceBlock -benchmem -run='^$' \ |
| 44 | + ./block/internal/executing/... > block_executor_output.txt |
| 45 | + - name: Upload benchmark results |
| 46 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 47 | + with: |
| 48 | + name: evm-benchmark-results |
| 49 | + path: | |
| 50 | + test/e2e/output.txt |
| 51 | + block_executor_output.txt |
| 52 | +
|
| 53 | + spamoor-benchmark: |
| 54 | + name: Spamoor Trace Benchmark |
| 55 | + runs-on: ubuntu-latest |
| 56 | + timeout-minutes: 30 |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 59 | + - name: Set up Go |
| 60 | + uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 |
| 61 | + with: |
| 62 | + go-version-file: ./go.mod |
| 63 | + - name: Set up Docker Buildx |
| 64 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 |
| 65 | + - name: Install just |
| 66 | + uses: extractions/setup-just@v3 |
| 67 | + - name: Build binaries |
| 68 | + run: just build-evm build-da |
| 69 | + - name: Run Spamoor smoke test |
| 70 | + run: | |
| 71 | + cd test/e2e && BENCH_JSON_OUTPUT=spamoor_bench.json go test -tags evm \ |
| 72 | + -run='^TestSpamoorSuite$/^TestSpamoorSmoke$' -v -timeout=15m \ |
| 73 | + ./benchmark/ --evm-binary=../../../build/evm |
| 74 | + - name: Upload benchmark results |
| 75 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 76 | + with: |
| 77 | + name: spamoor-benchmark-results |
| 78 | + path: test/e2e/benchmark/spamoor_bench.json |
| 79 | + |
| 80 | + # TODO: wire up to publish results once additional tests are in place. |
| 81 | + erc20-benchmark: |
| 82 | + name: ERC20 Throughput Benchmark |
| 83 | + runs-on: ubuntu-latest |
| 84 | + timeout-minutes: 20 |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 87 | + - name: Set up Go |
| 88 | + uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 |
| 89 | + with: |
| 90 | + go-version-file: ./go.mod |
| 91 | + - name: Set up Docker Buildx |
| 92 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 |
| 93 | + - name: Install just |
| 94 | + uses: extractions/setup-just@v3 |
| 95 | + - name: Build binaries |
| 96 | + run: just build-evm build-da |
| 97 | + - name: Run ERC20 throughput test |
| 98 | + run: | |
| 99 | + cd test/e2e && go test -tags evm \ |
| 100 | + -run='^TestSpamoorSuite$/^TestERC20Throughput$' -v -timeout=15m \ |
| 101 | + ./benchmark/ --evm-binary=../../../build/evm |
| 102 | +
|
| 103 | + # single job to push all results to gh-pages sequentially, avoiding race conditions |
| 104 | + publish-benchmarks: |
| 105 | + name: Publish Benchmark Results |
| 106 | + needs: [evm-benchmark, spamoor-benchmark] |
| 107 | + runs-on: ubuntu-latest |
| 108 | + permissions: |
| 109 | + contents: write |
| 110 | + issues: write |
| 111 | + pull-requests: write |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 114 | + - name: Download EVM benchmark results |
| 115 | + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
| 116 | + with: |
| 117 | + name: evm-benchmark-results |
| 118 | + - name: Download Spamoor benchmark results |
| 119 | + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
| 120 | + with: |
| 121 | + name: spamoor-benchmark-results |
| 122 | + path: test/e2e/benchmark/ |
| 123 | + |
| 124 | + # only update the benchmark baseline on push/dispatch, not on PRs |
| 125 | + - name: Store EVM Contract Roundtrip result |
| 126 | + if: always() |
| 127 | + uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0 |
| 128 | + with: |
| 129 | + name: EVM Contract Roundtrip |
| 130 | + tool: 'go' |
| 131 | + output-file-path: test/e2e/output.txt |
| 132 | + auto-push: ${{ github.event_name != 'pull_request' }} |
| 133 | + save-data-file: ${{ github.event_name != 'pull_request' }} |
| 134 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 135 | + alert-threshold: '150%' |
| 136 | + fail-on-alert: true |
| 137 | + comment-on-alert: true |
| 138 | + |
| 139 | + # delete local gh-pages so the next benchmark action step fetches fresh from remote |
| 140 | + - name: Reset local gh-pages branch |
| 141 | + if: always() |
| 142 | + run: git branch -D gh-pages || true |
| 143 | + |
| 144 | + - name: Store Block Executor result |
| 145 | + if: always() |
| 146 | + uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0 |
| 147 | + with: |
| 148 | + name: Block Executor Benchmark |
| 149 | + tool: 'go' |
| 150 | + output-file-path: block_executor_output.txt |
| 151 | + auto-push: ${{ github.event_name != 'pull_request' }} |
| 152 | + save-data-file: ${{ github.event_name != 'pull_request' }} |
| 153 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 154 | + alert-threshold: '150%' |
| 155 | + fail-on-alert: true |
| 156 | + comment-on-alert: true |
| 157 | + |
| 158 | + # delete local gh-pages so the next benchmark action step fetches fresh from remote |
| 159 | + - name: Reset local gh-pages branch |
| 160 | + if: always() |
| 161 | + run: git branch -D gh-pages || true |
| 162 | + |
| 163 | + - name: Store Spamoor Trace result |
| 164 | + if: always() |
| 165 | + uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0 |
| 166 | + with: |
| 167 | + name: Spamoor Trace Benchmarks |
| 168 | + tool: 'customSmallerIsBetter' |
| 169 | + output-file-path: test/e2e/benchmark/spamoor_bench.json |
| 170 | + auto-push: ${{ github.event_name != 'pull_request' }} |
| 171 | + save-data-file: ${{ github.event_name != 'pull_request' }} |
| 172 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 173 | + alert-threshold: '150%' |
| 174 | + fail-on-alert: false |
| 175 | + comment-on-alert: true |
0 commit comments