diff --git a/.github/workflows/core-rust.yml b/.github/workflows/core-rust.yml index da6c94a..ab2d881 100644 --- a/.github/workflows/core-rust.yml +++ b/.github/workflows/core-rust.yml @@ -17,8 +17,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Rust nightly + run: rustup install nightly + + - name: Install rustfmt for nightly + run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt + - name: Run rustfmt - run: cargo fmt -- --check + run: cargo +nightly fmt -- --check cargo-sort: runs-on: ubuntu-latest @@ -30,7 +36,7 @@ jobs: run: cargo install cargo-sort - name: Run cargo sort - run: cargo sort --grouped --check + run: cargo sort --workspace --grouped --check build: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index af0f46f..8aa4ce7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,8 @@ edition = "2024" [workspace.dependencies] ethereum_ssz = "0.8.2" -tracing = "0.1.40" ream-consensus = { git = "https://github.com/ReamLabs/ream", package = "ream-consensus" } +tracing = "0.1.40" [patch.crates-io] ethereum_hashing = { git = "https://github.com/ReamLabs/ethereum_hashing" } diff --git a/host/Cargo.toml b/host/Cargo.toml index 91e7d8a..395733f 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -8,14 +8,14 @@ name = "consenzero-script" path = "src/bin/main.rs" [dependencies] -serde_json = { version = "1.0", default-features = false, features = ["alloc"] } -serde = { version = "1.0.200", default-features = false, features = ["derive"] } -derive_more = { version = "2.0.1", features = ["full"] } clap = { version = "4.0", features = ["derive", "env"] } -hex = "0.4.3" +derive_more = { version = "2.0.1", features = ["full"] } dotenv = "0.15.0" +hex = "0.4.3" methods = { path = "../methods" } risc0-zkvm = { version = "2.0.1" } +serde = { version = "1.0.200", default-features = false, features = ["derive"] } +serde_json = { version = "1.0", default-features = false, features = ["alloc"] } tracing = { workspace = true } tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/host/src/bin/main.rs b/host/src/bin/main.rs index 9bc5dea..08c85c1 100644 --- a/host/src/bin/main.rs +++ b/host/src/bin/main.rs @@ -1,5 +1,5 @@ use clap::Parser; -use risc0_zkvm::{default_prover, ExecutorEnv}; +use risc0_zkvm::{default_prover, ExecutorEnv, ProverOpts}; use tracing::{error, info}; use ream_consensus::deneb::beacon_state::BeaconState as ReamBeaconState; @@ -122,15 +122,28 @@ fn main() { // Execute the program let prover = default_prover(); + let opts = ProverOpts::succinct(); // Proof information by proving the specified ELF binary. // This struct contains the receipt along with statistics about execution of the guest - let prove_info = prover.prove(env, CONSENSUS_STF_ELF).unwrap(); + let prove_info = prover + .prove_with_opts(env, CONSENSUS_STF_ELF, &opts) + .unwrap(); + + info!("Proving complete"); // Extract the receipt. let receipt = prove_info.receipt; + info!("Seal size: {:#?}", receipt.seal_size()); + info!("Receipt: {:#?}", receipt); + info!( + "New state root: {:?}", + receipt.journal.decode::().unwrap() + ); + receipt.verify(CONSENSUS_STF_ID).unwrap(); + info!("Verfication complete"); info!("----- Cycle Tracker End -----"); diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 0269bb5..69a0cb6 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] ethereum_ssz = { workspace = true } +serde = { version = "1.0.200", default-features = false, features = ["derive"] } snap = "1.1.1" tracing = { workspace = true } -serde = { version = "1.0.200", default-features = false, features = ["derive"] } # ReamBeaconState alloy-primitives = { version = "0.8", features = ['serde'] } diff --git a/methods/Cargo.toml b/methods/Cargo.toml index 74536a0..34768fb 100644 --- a/methods/Cargo.toml +++ b/methods/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "methods" -version = "0.1.0" edition = "2024" +version = "0.1.0" [build-dependencies] risc0-build = { version = "2.0.1" }