From b3e8a0356e352dc601d07b3b3561ce6a4cae02da Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Wed, 20 Nov 2024 18:11:23 -0800 Subject: [PATCH 1/2] Minimize the size of produced RISC-V binary --- Cargo.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3915b20..fccaffd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,10 @@ members = [ resolver = "2" [workspace.dependencies] -alloy-sol-types = "0.7.7" \ No newline at end of file +alloy-sol-types = "0.7.7" + +## Uncomment to minimize the size of produced RISC-V binary +#[profile.release] +#lto = "fat" +#opt-level = "s" +#strip = "symbols" From 196f904425f92869603a001645982daf85868600 Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Wed, 20 Nov 2024 18:23:51 -0800 Subject: [PATCH 2/2] Update README.md on how to minimize produced binary size. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index c662baf..d1b0a33 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,16 @@ cd program cargo prove build ``` +The produced binary can be found in `target/elf-compilation/riscv32im-succinct-zkvm-elf/release`. +To reduce the size of the binary, uncomment the following lines in `Cargo.toml` (in the project root): + +```toml +[profile.release] +lto = "fat" +opt-level = "s" +strip = "symbols" +``` + ### Execute the Program To run the program without generating a proof: