Refactor of daily workflow #24
Workflow file for this run
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: VM Block Run | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| blocks: | |
| type: string | |
| description: Comma separated block numbers (e.g "10,50,70") | |
| required: true | |
| pull_request: | |
| env: | |
| RANGE_SIZE: 2 | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| blocks: ${{ steps.parse-blocks.outputs.blocks_list }} | |
| steps: | |
| - name: Checkout Native | |
| uses: actions/checkout@v4 | |
| with: | |
| path: cairo_native | |
| - name: Parse blocks file | |
| id: parse-blocks | |
| run: | | |
| content=`cat ./cairo_native/.github/replay-blocks.txt` | |
| echo "blocks_list=$(jq 'split(",")' -Rc <(echo $content))" >> $GITHUB_OUTPUT | |
| echo "$content" >> ./blocks.txt | |
| - name: Save blocks list | |
| uses: actions/cache/save@v4.2.0 | |
| with: | |
| path: ./blocks.txt | |
| key: blocks-list | |
| run: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| env: | |
| LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ | |
| MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ | |
| TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ | |
| RPC_ENDPOINT_TESTNET: ${{ secrets.RPC_ENDPOINT_TESTNET }} | |
| RPC_ENDPOINT_MAINNET: ${{ secrets.RPC_ENDPOINT_MAINNET }} | |
| strategy: | |
| max-parallel: 25 | |
| matrix: | |
| block: ${{ fromJson(needs.setup.outputs.blocks) }} | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./starknet-replay | |
| steps: | |
| - name: Checkout Native | |
| uses: actions/checkout@v4 | |
| with: | |
| path: cairo_native | |
| # We checkout replay as it's the main repository for this workflow | |
| - name: Checkout Replay | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: lambdaclass/starknet-replay | |
| path: starknet-replay | |
| - name: Restore RPC Calls | |
| id: restore-rpc-calls | |
| uses: actions/cache/restore@v4.2.0 | |
| with: | |
| path: starknet-replay/cache | |
| key: cache-${{matrix.block}} | |
| # Install dependencies | |
| - uses: ./cairo_native/.github/actions/install-linux-deps | |
| - name: Setup rust env | |
| uses: dtolnay/rust-toolchain@1.84.1 | |
| - name: Retreive cached dependecies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: starknet-replay | |
| - name: Run with VM | |
| # if: steps.restore-rpc-calls.outputs.cache-hit != true | |
| run: | | |
| BLOCK_START=${{ matrix.block }} | |
| BLOCK_END=$(($BLOCK_START + $RANGE_SIZE - 1)) | |
| cargo run --release --bin replay --features state_dump,only_cairo_vm block-range $BLOCK_START $BLOCK_END mainnet | |
| # We always upload the dump, even if the job fails | |
| - name: Upload dumps | |
| uses: actions/upload-artifact@v4 | |
| if: steps.restore-rpc-calls.outputs.cache-hit != true | |
| with: | |
| name: dump-${{matrix.block}}-vm | |
| path: starknet-replay/state_dumps/vm | |
| - name: Save RPC Calls | |
| uses: actions/cache/save@v4.2.0 | |
| if: steps.restore-rpc-calls.outputs.cache-hit != true | |
| with: | |
| path: starknet-replay/cache | |
| key: ${{ steps.restore-rpc-calls.outputs.cache-primary-key }} | |
| merge-dumps: | |
| needs: [run] | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Download dumps | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: dump-*-vm | |
| path: state_dumps/vm | |
| merge-multiple: true | |
| continue-on-error: true | |
| - name: Save dumps | |
| uses: actions/cache/save@v4.2.0 | |
| with: | |
| path: state_dumps/vm | |
| key: dumps-vm |