Skip to content

Commit 2d57399

Browse files
authored
feat: change from composite to succinct proof (#21)
* feat: change from composite to succint proof * fix: dependency sorting * fix: cargofmt * fix: install rust nightly for github workflow * fix: cargo sort * feat: cargo sort to check workspace * fix: cargo sort
1 parent 6c63ad6 commit 2d57399

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

.github/workflows/core-rust.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20+
- name: Install Rust nightly
21+
run: rustup install nightly
22+
23+
- name: Install rustfmt for nightly
24+
run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
25+
2026
- name: Run rustfmt
21-
run: cargo fmt -- --check
27+
run: cargo +nightly fmt -- --check
2228

2329
cargo-sort:
2430
runs-on: ubuntu-latest
@@ -30,7 +36,7 @@ jobs:
3036
run: cargo install cargo-sort
3137

3238
- name: Run cargo sort
33-
run: cargo sort --grouped --check
39+
run: cargo sort --workspace --grouped --check
3440

3541
build:
3642
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ edition = "2024"
1515

1616
[workspace.dependencies]
1717
ethereum_ssz = "0.8.2"
18-
tracing = "0.1.40"
1918
ream-consensus = { git = "https://github.com/ReamLabs/ream", package = "ream-consensus" }
19+
tracing = "0.1.40"
2020

2121
[patch.crates-io]
2222
ethereum_hashing = { git = "https://github.com/ReamLabs/ethereum_hashing" }

host/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ name = "consenzero-script"
88
path = "src/bin/main.rs"
99

1010
[dependencies]
11-
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
12-
serde = { version = "1.0.200", default-features = false, features = ["derive"] }
13-
derive_more = { version = "2.0.1", features = ["full"] }
1411
clap = { version = "4.0", features = ["derive", "env"] }
15-
hex = "0.4.3"
12+
derive_more = { version = "2.0.1", features = ["full"] }
1613
dotenv = "0.15.0"
14+
hex = "0.4.3"
1715
methods = { path = "../methods" }
1816
risc0-zkvm = { version = "2.0.1" }
17+
serde = { version = "1.0.200", default-features = false, features = ["derive"] }
18+
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
1919
tracing = { workspace = true }
2020
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2121

host/src/bin/main.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clap::Parser;
2-
use risc0_zkvm::{default_prover, ExecutorEnv};
2+
use risc0_zkvm::{default_prover, ExecutorEnv, ProverOpts};
33
use tracing::{error, info};
44

55
use ream_consensus::deneb::beacon_state::BeaconState as ReamBeaconState;
@@ -122,15 +122,28 @@ fn main() {
122122

123123
// Execute the program
124124
let prover = default_prover();
125+
let opts = ProverOpts::succinct();
125126

126127
// Proof information by proving the specified ELF binary.
127128
// This struct contains the receipt along with statistics about execution of the guest
128-
let prove_info = prover.prove(env, CONSENSUS_STF_ELF).unwrap();
129+
let prove_info = prover
130+
.prove_with_opts(env, CONSENSUS_STF_ELF, &opts)
131+
.unwrap();
132+
133+
info!("Proving complete");
129134

130135
// Extract the receipt.
131136
let receipt = prove_info.receipt;
132137

138+
info!("Seal size: {:#?}", receipt.seal_size());
139+
info!("Receipt: {:#?}", receipt);
140+
info!(
141+
"New state root: {:?}",
142+
receipt.journal.decode::<tree_hash::Hash256>().unwrap()
143+
);
144+
133145
receipt.verify(CONSENSUS_STF_ID).unwrap();
146+
info!("Verfication complete");
134147

135148
info!("----- Cycle Tracker End -----");
136149

lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ edition = "2021"
55

66
[dependencies]
77
ethereum_ssz = { workspace = true }
8+
serde = { version = "1.0.200", default-features = false, features = ["derive"] }
89
snap = "1.1.1"
910
tracing = { workspace = true }
10-
serde = { version = "1.0.200", default-features = false, features = ["derive"] }
1111

1212
# ReamBeaconState
1313
alloy-primitives = { version = "0.8", features = ['serde'] }

methods/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "methods"
3-
version = "0.1.0"
43
edition = "2024"
4+
version = "0.1.0"
55

66
[build-dependencies]
77
risc0-build = { version = "2.0.1" }

0 commit comments

Comments
 (0)