Skip to content

Commit

Permalink
chore(program): memory allocation (#425)
Browse files Browse the repository at this point in the history
* chore: forget memory zkvm

* add
  • Loading branch information
ratankaliani authored Mar 8, 2025
1 parent 9763801 commit b8c2e85
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
Binary file modified elf/range-elf-bump
Binary file not shown.
Binary file modified elf/range-elf-embedded
Binary file not shown.
5 changes: 4 additions & 1 deletion scripts/prove/bin/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ use tracing::debug;
async fn main() -> Result<()> {
let args = HostExecutorArgs::parse();

dotenv::from_path(&args.env_file)?;
dotenv::from_path(&args.env_file).expect(&format!(
"Environment file not found: {}",
args.env_file.display()
));
utils::setup_logger();

let data_fetcher = OPSuccinctDataFetcher::new_with_rollup_config().await?;
Expand Down
6 changes: 3 additions & 3 deletions utils/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn build_all() {
// elf_name: Some("aggregation-elf".to_string()),
// output_directory: Some("../../elf".to_string()),
// docker: true,
// tag: "v4.1.2".to_string(),
// tag: "v4.1.3".to_string(),
// workspace_directory: Some("../../".to_string()),
// ..Default::default()
// },
Expand All @@ -25,7 +25,7 @@ pub fn build_all() {
// elf_name: Some("range-elf-bump".to_string()),
// output_directory: Some("../../elf".to_string()),
// docker: true,
// tag: "v4.1.2".to_string(),
// tag: "v4.1.3".to_string(),
// workspace_directory: Some("../../".to_string()),
// ..Default::default()
// },
Expand All @@ -37,7 +37,7 @@ pub fn build_all() {
// elf_name: Some("range-elf-embedded".to_string()),
// output_directory: Some("../../elf".to_string()),
// docker: true,
// tag: "v4.1.2".to_string(),
// tag: "v4.1.3".to_string(),
// workspace_directory: Some("../../".to_string()),
// features: vec!["embedded".to_string()],
// ..Default::default()
Expand Down
12 changes: 6 additions & 6 deletions utils/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use op_alloy_consensus::OpBlock;
use op_alloy_consensus::OpTxEnvelope;
use op_alloy_consensus::OpTxType;
use std::fmt::Debug;
use std::mem::forget;
use std::sync::Arc;
use tracing::error;
use tracing::info;
Expand Down Expand Up @@ -159,10 +158,10 @@ where
// Only need to forget resources on non-zkvm targets
#[cfg(target_os = "zkvm")]
{
forget(driver);
forget(l1_provider);
forget(oracle);
forget(rollup_config);
std::mem::forget(driver);
std::mem::forget(l1_provider);
std::mem::forget(oracle);
std::mem::forget(rollup_config);
}

Ok(boot_clone)
Expand Down Expand Up @@ -349,6 +348,7 @@ where
driver.cursor.write().advance(origin, tip_cursor);

// Add forget calls to save cycles
forget(block);
#[cfg(target_os = "zkvm")]
std::mem::forget(block);
}
}
2 changes: 1 addition & 1 deletion utils/host/src/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ impl OPSuccinctDataFetcher {

// Creates the data directory if it doesn't exist, or no-ops if it does. Used to store the
// witness data.
fs::create_dir_all(&data_directory)?;
fs::create_dir_all(&data_directory).expect("Failed to create data directory");

Ok(OPSuccinctHost {
kona_args: SingleChainHost {
Expand Down

0 comments on commit b8c2e85

Please sign in to comment.