fix: improve leaf index validation #1253
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: Build | |
| on: | |
| push: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| prt-contracts: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Install Cartesi Machine | |
| uses: ./.github/actions/cartesi-machine | |
| with: | |
| version: 0.19.0 | |
| suffix-version: "" | |
| - name: Setup env | |
| run: | | |
| just setup-local | |
| - name: Build, format check and test prt contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just check-fmt | |
| just build-smart-contracts | |
| just test-disputes | |
| just test-stf | |
| dave-contracts: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Download PRT contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just install-deps | |
| - name: Download Rollups contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just install-deps | |
| - name: Build, format check and test Dave consensus contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just check-fmt | |
| just build-smart-contracts | |
| just test | |
| prt-honeypot: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Install Cartesi Machine | |
| uses: ./.github/actions/cartesi-machine | |
| with: | |
| version: 0.19.0 | |
| - name: Download PRT contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just install-deps | |
| - name: Download Rollups contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just install-deps | |
| - name: Build devnet | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just build-devnet | |
| - name: Download deps | |
| working-directory: ./test/programs/ | |
| run: | | |
| just download-deps | |
| - name: Rust build | |
| run: | | |
| just build | |
| - name: Build honeypot | |
| working-directory: ./test/programs/ | |
| run: | | |
| just build-honeypot-snapshot | |
| - name: Test prt-rollups | |
| timeout-minutes: 20 | |
| run: | | |
| just test-rollups-honeypot-ci | |
| - name: Show failing log | |
| if: failure() | |
| run: | | |
| echo '▼▼▼ failing-step dave.log ▼▼▼' | |
| cat ./prt/tests/rollups/dave.log | |
| echo '▲▲▲ end log ▲▲▲' | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Install dependencies | |
| env: | |
| XGENEXT2_VERSION: 1.5.6 | |
| ARCH: amd64 | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y --no-install-recommends \ | |
| build-essential git wget \ | |
| libslirp-dev \ | |
| libclang-dev \ | |
| liblua5.4-dev lua5.4 \ | |
| xxd jq sqlite3 libc6 clang libarchive13 | |
| wget -O xgenext2fs.deb https://github.com/cartesi/genext2fs/releases/download/v${XGENEXT2_VERSION}/xgenext2fs_${ARCH}.deb | |
| sudo apt-get install -y ./xgenext2fs.deb | |
| rm ./xgenext2fs.deb | |
| xgenext2fs --version | |
| - name: Install Cartesi Machine | |
| working-directory: ./machine/emulator | |
| run: | | |
| make bundle-boost | |
| make | |
| sudo make install | |
| - name: Setup env | |
| run: | | |
| just setup-local | |
| - name: Rust fmt and check | |
| run: | | |
| just check-fmt-rust-workspace | |
| just check-rust-workspace | |
| - name: Rust build | |
| run: | | |
| just build | |
| - name: Rust test workspace | |
| run: | | |
| just test-rust-workspace | |
| build-release-node: | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| target: x86_64-unknown-linux-gnu | |
| os: ubuntu-24.04 | |
| - arch: arm64 | |
| target: aarch64-unknown-linux-gnu | |
| os: ubuntu-24.04-arm | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ${{ matrix.os }} | |
| container: | |
| image: rust:1.90-bookworm | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y --no-install-recommends \ | |
| build-essential git wget curl \ | |
| liblua5.4-dev lua5.4 \ | |
| libslirp-dev libboost1.81-dev \ | |
| libclang-dev \ | |
| xxd jq sqlite3 | |
| - name: Install dependency for ARM | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| apt-get install -y --no-install-recommends \ | |
| g++-aarch64-linux-gnu | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| with: | |
| setup-qemu: false | |
| setup-rust: false | |
| - name: Contracts | |
| run: | | |
| just -f test/programs/justfile download-deps | |
| just -f prt/contracts/justfile install-deps | |
| just -f cartesi-rollups/contracts/justfile install-deps | |
| just build-smart-contracts | |
| just bind | |
| - name: Cartesi Machine Sys | |
| working-directory: machine/rust-bindings | |
| run: | | |
| cargo build --release -p cartesi-machine-sys --features download_uarch --target ${{ matrix.target }} | |
| - name: Build release | |
| run: | | |
| cargo build --release -p cartesi-rollups-prt-node --target ${{ matrix.target }} | |
| cp -v ./target/${{ matrix.target }}/release/cartesi-rollups-prt-node cartesi-rollups-prt-node | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cartesi-rollups-prt-node-linux-${{ matrix.arch }} | |
| path: | | |
| ./cartesi-rollups-prt-node | |
| if-no-files-found: error | |
| retention-days: 1 | |
| release-node: | |
| needs: [prt-contracts, dave-contracts, prt-honeypot, build, build-release-node] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| target: x86_64-unknown-linux-gnu | |
| - arch: arm64 | |
| target: aarch64-unknown-linux-gnu | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create directory | |
| run: | | |
| mkdir -pv target/${{ matrix.target }}/release | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cartesi-rollups-prt-node-linux-${{ matrix.arch }} | |
| path: target/${{ matrix.target }}/release | |
| - name: Publish artifacts and release | |
| uses: houseabsolute/actions-rust-release@v0 | |
| with: | |
| executable-name: cartesi-rollups-prt-node | |
| target: ${{ matrix.target }} | |
| changes-file: CHANGELOG.md | |
| release-contracts: | |
| needs: [prt-contracts, dave-contracts, prt-honeypot, build] | |
| runs-on: ubuntu-24.04 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Create directory | |
| run: | | |
| mkdir -p upload | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| id: setup | |
| - name: Build PRT Core contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just install-deps | |
| forge clean | |
| forge build src | |
| - name: Build Cartesi Rollups PRT contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just install-deps | |
| forge clean | |
| forge build src | |
| - name: Compress contract artifacts | |
| run: tar -czf "$FILEPATH" prt/contracts/out cartesi-rollups/contracts/out | |
| env: | |
| FILEPATH: upload/cartesi-rollups-prt-contract-artifacts.tar.gz | |
| - name: Build devnet | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just build-devnet | |
| - name: Compress devnet artifacts | |
| run: tar -czf "$FILEPATH" -C cartesi-rollups/contracts deployments state.json | |
| env: | |
| FILEPATH: upload/cartesi-rollups-prt-anvil-${{ steps.setup.outputs.installed-foundry-version }}.tar.gz | |
| - name: Upload files to GitHub Releases | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: upload/* |