8000 feat: use profile_report! in the client by leruaa · Pull Request #130 · succinctlabs/rsp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: use profile_report! in the client #130

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

8000
Merged
merged 2 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions bin/client-op/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ sp1_zkvm::entrypoint!(main);
use rsp_client_executor::{
executor::{OpClientExecutor, DESERIALZE_INPUTS},
io::{CommittedHeader, OpClientExecutorInput},
utils::profile_report,
};
use std::sync::Arc;

pub fn main() {
// Read the input.
println!("cycle-tracker-report-start: {}", DESERIALZE_INPUTS);
let input = sp1_zkvm::io::read_vec();
let input = bincode::deserialize::<OpClientExecutorInput>(&input).unwrap();
println!("cycle-tracker-report-end: {}", DESERIALZE_INPUTS);
let input = profile_report!(DESERIALZE_INPUTS, {
let input = sp1_zkvm::io::read_vec();
bincode::deserialize::<OpClientExecutorInput>(&input).unwrap()
});

// Execute the block.
let executor = OpClientExecutor::optimism(Arc::new((&input.genesis).try_into().unwrap()));
Expand Down
9 changes: 5 additions & 4 deletions bin/client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ sp1_zkvm::entrypoint!(main);
use rsp_client_executor::{
executor::{EthClientExecutor, DESERIALZE_INPUTS},
io::{CommittedHeader, EthClientExecutorInput},
utils::profile_report,
};
use std::sync::Arc;

pub fn main() {
// Read the input.
println!("cycle-tracker-report-start: {}", DESERIALZE_INPUTS);
let input = sp1_zkvm::io::read_vec();
let input = bincode::deserialize::<EthClientExecutorInput>(&input).unwrap();
println!("cycle-tracker-report-end: {}", DESERIALZE_INPUTS);
let input = profile_report!(DESERIALZE_INPUTS, {
let input = sp1_zkvm::io::read_vec();
bincode::deserialize::<EthClientExecutorInput>(&input).unwrap()
});

// Execute the block.
let executor = EthClientExecutor::eth(
Expand Down
2 changes: 1 addition & 1 deletion crates/executor/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// Client program input data types.
pub mod io;
#[macro_use]
mod utils;
pub mod utils;
pub mod custom;
pub mod error;
pub mod executor;
Expand Down
6 changes: 5 additions & 1 deletion crates/executor/client/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Profile the given code block cycle count.
#[allow(unused_macros)]
#[macro_export]
macro_rules! profile {
($name:expr, $block:block) => {{
#[cfg(target_os = "zkvm")]
Expand All @@ -18,6 +18,7 @@ macro_rules! profile {
}

/// Profile the given code block and add the cycle count to the execution report.
#[macro_export]
macro_rules! profile_report {
($name:expr, $block:block) => {{
#[cfg(target_os = "zkvm")]
Expand All @@ -34,3 +35,6 @@ macro_rules! profile_report {
}
}};
}

pub use profile;
pub use profile_report;
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.85.0"
components = ["rustfmt"]
components = ["rustfmt", "clippy"]
Loading
0