Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate PoL into consensus #721

Merged
merged 29 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if its worth it, but we may have a separated workflow for risc0 if needed. Wdyt @bacv ?

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
17 changes: 16 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,34 @@ jobs:
toolchain: stable
override: true
components: llvm-tools-preview
- 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: build
args: --all --no-default-features --features libp2p
- uses: actions-rs/cargo@v1
run: |
mkdir bcp
cp ./target/debug/{nomos-cli, nomos-node, rocks} bcp/
cargo clean
mkdir -p target/debug
cp bcp/* ./target/debug/
- uses: actions-rs/cargo@v1
continue-on-error: true
- run: |
cargo install grcov;
cargo binstall -y grcov;
cargo test --no-default-features --features libp2p
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
Loading