Skip to content

refactor(storage): cleanup heades table #4036

refactor(storage): cleanup heades table

refactor(storage): cleanup heades table #4036

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Limits workflow concurrency to only the latest commit in the PR.
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
needs: python-starkhash
steps:
# Required for the python environment
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- uses: taiki-e/install-action@nextest
- uses: actions/setup-python@v4
id: setup_python
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: 'py/requirements*.txt'
# Workaround for setup-python issue #330 (https://github.com/actions/setup-python/issues/330)
- uses: actions/cache@v3
id: python_cache
with:
path: ${{ env.pythonLocation }}/**/site-packages
key: site-packages-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('py/requirements*.txt') }}-${{ hashFiles('py/pyproject.toml') }}
- run: |
pip install -r py/requirements-dev.txt
pip install -e py/.
# Install fresh starknet_pathfinder_crypto
- uses: actions/download-artifact@v3
with:
name: pathfinder-starkhash-wheels
- name: Install Pedersen hash Python wrapper
run: |
pip install --no-index --force-reinstall ./starknet_pathfinder_crypto-*.whl
- name: Compile unit tests
run: timeout 25m cargo nextest run --all-targets --all-features --workspace --locked --no-run
- name: Run unit tests
run: timeout 5m cargo nextest run --no-fail-fast --all-targets --all-features --workspace --locked
- name: Run integration tests
run: timeout 3m cargo test --test integration* --locked
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings -D rust_2018_idioms
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
doc:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- run: cargo doc --no-deps --document-private-items
dep-sort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-sort
version: "^1.0.9"
- uses: Swatinem/rust-cache@v2
- run: |
cargo sort --check --workspace
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: read msrv
id: msrv
run: |
msrv=$(grep -P "rust-version =" crates/pathfinder/Cargo.toml | awk '{print $3}' | tr -d '"')
echo Found msrc: $msrv
echo "MSRV=$msrv" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.MSRV }}
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: check
run: cargo check
python:
runs-on: ubuntu-latest
needs: python-starkhash
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup_python
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: 'py/requirements*.txt'
# Workaround for setup-python issue #330 (https://github.com/actions/setup-python/issues/330)
- uses: actions/cache@v3
id: python_cache
with:
path: ${{ env.pythonLocation }}/**/site-packages
key: site-packages-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('py/requirements*.txt') }}-${{ hashFiles('py/pyproject.toml') }}
- name: Install Python dependencies
run: |
pip install -r py/requirements-dev.txt
pip install -e py/.[dev]
- uses: actions/download-artifact@v3
with:
name: pathfinder-starkhash-wheels
- name: Install Pedersen hash Python wrapper
run: |
pip install --no-index --force-reinstall ./starknet_pathfinder_crypto-*.whl
- name: Test (python)
run: |
cd py
python -m pytest
- name: Formatting (python)
run: |
cd py
python -m black --check .
- name: Lints (python)
run: |
cd py
python -m flake8 src/ tests/ tools/
python-starkhash:
name: Compile Python Pedersen hash wrapper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "crates/stark_hash_python"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: 'py/requirements*.txt'
- uses: messense/maturin-action@v1
with:
command: build
container: off
working-directory: crates/stark_hash_python
args: --release -o dist
- uses: actions/upload-artifact@v3
with:
name: pathfinder-starkhash-wheels
path: crates/stark_hash_python/dist/starknet_pathfinder_crypto*.whl
if-no-files-found: error
fuzz_targets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- uses: rui314/setup-mold@v1
with:
mold-version: 1.4.1
make-default: false
- name: Enable mold
run: |
mkdir -p $HOME/.cargo
cat << EOF >> $HOME/.cargo/config.toml
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/mold"]
EOF
cat $HOME/.cargo/config.toml
- uses: Swatinem/rust-cache@v2
with:
key: "mold"
- run: cargo install cargo-fuzz
- name: stark_hash
run: cargo fuzz build
working-directory: crates/stark_hash
load_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "crates/load-test"
- name: cargo check
run: |
cd crates/load-test
cargo check