|
| 1 | +name: Benchmark Fill Parity |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + geth_repo: |
| 8 | + description: "Geth repository to build" |
| 9 | + required: false |
| 10 | + type: string |
| 11 | + default: "jsign/go-ethereum" |
| 12 | + geth_branch: |
| 13 | + description: "Geth branch to build" |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + default: "jsign-master-t8n-fill-executionwitness" |
| 17 | + benchmark_file: |
| 18 | + description: "Benchmark test file to fill" |
| 19 | + required: false |
| 20 | + type: string |
| 21 | + default: "tests/benchmark/compute/instruction/test_memory.py" |
| 22 | + fill_fork: |
| 23 | + description: "Fork to fill" |
| 24 | + required: false |
| 25 | + type: string |
| 26 | + default: "Amsterdam" |
| 27 | + xdist_workers: |
| 28 | + description: "Number of fill workers" |
| 29 | + required: false |
| 30 | + type: string |
| 31 | + default: "auto" |
| 32 | + |
| 33 | +concurrency: |
| 34 | + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 35 | + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }} |
| 36 | + |
| 37 | +env: |
| 38 | + GETH_REPO: ${{ inputs.geth_repo || 'jsign/go-ethereum' }} |
| 39 | + GETH_BRANCH: ${{ inputs.geth_branch || 'jsign-master-t8n-fill-executionwitness' }} |
| 40 | + BENCHMARK_FILE: ${{ inputs.benchmark_file || 'tests/benchmark/compute/instruction/test_memory.py' }} |
| 41 | + FILL_FORK: ${{ inputs.fill_fork || 'Amsterdam' }} |
| 42 | + XDIST_WORKERS: ${{ inputs.xdist_workers || 'auto' }} |
| 43 | + |
| 44 | +jobs: |
| 45 | + compare-fills: |
| 46 | + name: Compare Python and Geth fills |
| 47 | + runs-on: ubuntu-latest |
| 48 | + timeout-minutes: 120 |
| 49 | + steps: |
| 50 | + - name: Checkout repository |
| 51 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 52 | + with: |
| 53 | + submodules: true |
| 54 | + |
| 55 | + - name: Setup uv |
| 56 | + uses: ./.github/actions/setup-uv |
| 57 | + with: |
| 58 | + enable-cache: "false" |
| 59 | + |
| 60 | + - name: Install dependencies |
| 61 | + run: uv sync --no-progress |
| 62 | + |
| 63 | + - name: Build Geth evm |
| 64 | + uses: ./.github/actions/build-evm-client/geth |
| 65 | + with: |
| 66 | + repo: ${{ env.GETH_REPO }} |
| 67 | + ref: ${{ env.GETH_BRANCH }} |
| 68 | + |
| 69 | + - name: Validate benchmark file input |
| 70 | + shell: bash |
| 71 | + run: | |
| 72 | + case "$BENCHMARK_FILE" in |
| 73 | + ./*) |
| 74 | + echo "benchmark_file must be relative to the repository root without a leading ./" |
| 75 | + exit 1 |
| 76 | + ;; |
| 77 | + tests/benchmark/*.py) |
| 78 | + ;; |
| 79 | + *) |
| 80 | + echo "benchmark_file must be a Python file under tests/benchmark/" |
| 81 | + exit 1 |
| 82 | + ;; |
| 83 | + esac |
| 84 | +
|
| 85 | + if [ ! -f "$BENCHMARK_FILE" ]; then |
| 86 | + echo "benchmark_file does not exist: $BENCHMARK_FILE" |
| 87 | + exit 1 |
| 88 | + fi |
| 89 | +
|
| 90 | + - name: Fill benchmark with Python spec |
| 91 | + run: | |
| 92 | + uv run fill \ |
| 93 | + --clean \ |
| 94 | + --gas-benchmark-values 1 \ |
| 95 | + --fork "$FILL_FORK" \ |
| 96 | + -m blockchain_test \ |
| 97 | + -n "$XDIST_WORKERS" \ |
| 98 | + --output=fixtures_python \ |
| 99 | + --no-html \ |
| 100 | + --basetemp=fill_tmp/python \ |
| 101 | + --log-to fill_logs/python \ |
| 102 | + "$BENCHMARK_FILE" |
| 103 | +
|
| 104 | + - name: Fill benchmark with Geth |
| 105 | + run: | |
| 106 | + uv run fill \ |
| 107 | + --clean \ |
| 108 | + --gas-benchmark-values 1 \ |
| 109 | + --fork "$FILL_FORK" \ |
| 110 | + --evm-bin=evm \ |
| 111 | + -m blockchain_test \ |
| 112 | + -n "$XDIST_WORKERS" \ |
| 113 | + --output=fixtures_geth \ |
| 114 | + --no-html \ |
| 115 | + --basetemp=fill_tmp/geth \ |
| 116 | + --log-to fill_logs/geth \ |
| 117 | + "$BENCHMARK_FILE" |
| 118 | +
|
| 119 | + - name: Compare fixture hashes |
| 120 | + run: uv run hasher compare fixtures_python fixtures_geth |
| 121 | + |
| 122 | + - name: Upload failure artifacts |
| 123 | + if: failure() |
| 124 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 125 | + with: |
| 126 | + name: benchmark-fill-parity-debug |
| 127 | + path: | |
| 128 | + fixtures_python/ |
| 129 | + fixtures_geth/ |
| 130 | + fill_logs/ |
| 131 | + if-no-files-found: ignore |
0 commit comments