Skip to content

Commit

Permalink
Merge branch 'master' into da-integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bacv committed Sep 16, 2024
2 parents d903548 + d2db454 commit 61ede44
Show file tree
Hide file tree
Showing 28 changed files with 777 additions and 690 deletions.
52 changes: 28 additions & 24 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
profile: minimal
toolchain: stable
override: true
- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo binstall -y cargo-risczero && cargo risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/cargo@v1
with:
command: check
Expand All @@ -41,7 +48,7 @@ jobs:
fail-fast: false # all OSes should be tested even if one fails (default: true)
matrix:
feature: [ libp2p, "libp2p,mixnet" ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ ubuntu-latest, macos-latest ] # drop windows for now as risc0 does not support it
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -70,6 +77,13 @@ jobs:
- name: Setup build environment (Windows)
if: matrix.os == 'windows-latest'
uses: ./.github/actions/mingw-env
- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo binstall -y cargo-risczero && cargo risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo build
uses: actions-rs/cargo@v1
with:
Expand All @@ -78,6 +92,9 @@ jobs:
- name: Cargo test (Other OSes)
if: matrix.os != 'windows-latest'
uses: actions-rs/cargo@v1
env:
RISC0_DEV_MODE: true
CONSENSUS_SLOT_TIME: 5
with:
command: test
args: --all --no-default-features --features ${{ matrix.feature }}
Expand All @@ -87,35 +104,16 @@ jobs:
env:
# Because Windows runners in Github Actions tend to be slow.
SLOW_TEST_ENV: true
RISC0_DEV_MODE: true
CONSENSUS_SLOT_TIME: 5
with:
command: test
args: --all --no-default-features --features ${{ matrix.feature }}
args: --no-default-features --features ${{ matrix.feature }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: integration-test-artifacts
path: tests/.tmp*

risc0:
name: Risc0 tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install risc0
run: cargo install cargo-risczero && cargo risczero install
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path proof_of_leadership/risc0/prover/Cargo.toml


lints:
name: Rust lints
Expand All @@ -136,7 +134,13 @@ jobs:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo binstall -y cargo-risczero && cargo risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,24 @@ jobs:
toolchain: stable
override: true
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
with:
command: build
args: --all --no-default-features --features libp2p
- uses: actions-rs/cargo@v1
continue-on-error: true
- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo binstall -y cargo-risczero && cargo risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
cargo install grcov;
cargo test --no-default-features --features libp2p
cargo binstall -y grcov;
cargo build --no-default-features --features libp2p
rm -rf target/debug/{build,incremental,deps}
cargo test --no-default-features --features libp2p --no-run
rm -rf target/debug/{build,incremental,deps}
mkdir /tmp/cov;
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov;
env:
SLOW_TEST_ENV: true
RISC0_DEV_MODE: true
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ members = [
"consensus/cryptarchia-engine",
"ledger/cryptarchia-ledger",
"cl/cl",
"proof_of_leadership/proof_statements",
"tests",
]
exclude = ["proof_of_leadership/risc0/risc0_proofs"]
Expand Down
14 changes: 12 additions & 2 deletions ledger/cryptarchia-ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ blake2 = "0.10"
rpds = "1"
thiserror = "1"
serde = { version = "1.0", features = ["derive"], optional = true }
serde_test = "1.0.176"
# TODO: we only need types definition from this crate
cryptarchia-engine = { path = "../../consensus/cryptarchia-engine" }
cl = { path = "../../cl/cl" }
risc0-zkvm = { version = "1.0", optional = true }
leader_proof_statements = { path = "../../proof_of_leadership/proof_statements" }
nomos_pol_risc0_proofs = { path = "../../proof_of_leadership/risc0/risc0_proofs", optional = true }
nomos_pol_prover = { path = "../../proof_of_leadership/risc0/prover", optional = true }
rand = "0.8.5"
rand_core = "0.6.0"
sha2 = "0.10"

nomos-utils = { path = "../../nomos-utils", optional = true }

[features]
serde = ["dep:serde", "nomos-utils/serde", "rpds/serde"]
serde = ["dep:serde", "nomos-utils/serde", "rpds/serde"]
risc0_proof = ["risc0-zkvm", "nomos_pol_risc0_proofs"]
prove = ["nomos_pol_prover"]
162 changes: 0 additions & 162 deletions ledger/cryptarchia-ledger/src/coin.rs

This file was deleted.

Loading

0 comments on commit 61ede44

Please sign in to comment.