risc0_zkvm/host/prove_info.rs
1// Copyright 2025 RISC Zero, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Struct containing information about a prover's execution including the receipt.
16
17use crate::Receipt;
18
19/// Information returned by the prover including receipt as well as other information useful for debugging
20#[non_exhaustive]
21pub struct ProveInfo {
22 /// receipt from the computation
23 pub receipt: Receipt,
24
25 /// stats about cycle counts of the execution
26 pub stats: SessionStats,
27}
28
29/// Struct containing information about a prover's cycle count after running the guest program
30#[derive(Debug)]
31#[non_exhaustive]
32pub struct SessionStats {
33 /// Count of segments in this proof request
34 pub segments: usize,
35
36 /// Total cycles run within guest
37 pub total_cycles: u64,
38
39 /// User cycles run within guest
40 pub user_cycles: u64,
41
42 /// Paging cycles run within guest
43 pub paging_cycles: u64,
44
45 /// Reserved cycles run within guest
46 pub reserved_cycles: u64,
47}