From c10824640dbea91f56b0ac44d679e369b9213e58 Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:19:49 +0700 Subject: [PATCH 1/7] feat: change from composite to succint proof --- host/src/bin/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/host/src/bin/main.rs b/host/src/bin/main.rs index 9bc5dea..c188f9e 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,23 @@ 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 -----"); From ed78d476759fae608e42c86041d542cedb49a12b Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:23:15 +0700 Subject: [PATCH 2/7] fix: dependency sorting --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } From acb5385cd3e40ca1bc37892dbd97d91496f8ed59 Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:25:32 +0700 Subject: [PATCH 3/7] fix: cargofmt --- host/src/bin/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/host/src/bin/main.rs b/host/src/bin/main.rs index c188f9e..08c85c1 100644 --- a/host/src/bin/main.rs +++ b/host/src/bin/main.rs @@ -126,7 +126,9 @@ fn main() { // 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_with_opts(env, CONSENSUS_STF_ELF, &opts).unwrap(); + let prove_info = prover + .prove_with_opts(env, CONSENSUS_STF_ELF, &opts) + .unwrap(); info!("Proving complete"); @@ -135,7 +137,10 @@ fn main() { info!("Seal size: {:#?}", receipt.seal_size()); info!("Receipt: {:#?}", receipt); - info!("New state root: {:?}", receipt.journal.decode::().unwrap()); + info!( + "New state root: {:?}", + receipt.journal.decode::().unwrap() + ); receipt.verify(CONSENSUS_STF_ID).unwrap(); info!("Verfication complete"); From 54f29cc99947f0be3bd4d9501fef96917a766e76 Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:25:53 +0700 Subject: [PATCH 4/7] fix: install rust nightly for github workflow --- .github/workflows/core-rust.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/core-rust.yml b/.github/workflows/core-rust.yml index da6c94a..3f2af7d 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 From 308e98184002e3ee9e6c87ad1d6ec868b5f14106 Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:32:16 +0700 Subject: [PATCH 5/7] fix: cargo sort --- host/Cargo.toml | 8 ++++---- lib/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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/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'] } From 5fd7f1d9798e013c4a2b944e877ede7579fa3025 Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:38:05 +0700 Subject: [PATCH 6/7] feat: cargo sort to check workspace --- .github/workflows/core-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/core-rust.yml b/.github/workflows/core-rust.yml index 3f2af7d..ab2d881 100644 --- a/.github/workflows/core-rust.yml +++ b/.github/workflows/core-rust.yml @@ -36,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 From b402a914900832bbaba56be6f44ffd0ef6588f98 Mon Sep 17 00:00:00 2001 From: unnawut Date: Thu, 5 Jun 2025 15:41:06 +0700 Subject: [PATCH 7/7] fix: cargo sort --- methods/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" }