mirror of
https://github.com/eth-act/ere.git
synced 2026-04-25 03:00:10 -04:00
feat: upgrade ziren & pico & miden (#247)
Co-authored-by: Han <tinghan0110@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ miden-assembly = { workspace = true, features = ["std"] }
|
||||
miden-core = { workspace = true, features = ["std"] }
|
||||
miden-processor = { workspace = true, features = ["std"], optional = true }
|
||||
miden-prover = { workspace = true, features = ["std"], optional = true }
|
||||
miden-stdlib = { workspace = true, features = ["std"] }
|
||||
miden-core-lib = { workspace = true, features = ["std"] }
|
||||
miden-verifier = { workspace = true, optional = true }
|
||||
|
||||
# Local dependencies
|
||||
|
||||
@@ -20,8 +20,8 @@ pub enum Error {
|
||||
err: std::io::Error,
|
||||
},
|
||||
|
||||
#[error("Failed to load Miden standard library: {0}")]
|
||||
LoadStdLibrary(Report),
|
||||
#[error("Failed to load Miden core library: {0}")]
|
||||
LoadCoreLibrary(Report),
|
||||
|
||||
#[error("Miden assembly compilation failed: {0}")]
|
||||
AssemblyCompilation(Report),
|
||||
|
||||
@@ -4,8 +4,8 @@ use crate::{
|
||||
};
|
||||
use ere_zkvm_interface::compiler::Compiler;
|
||||
use miden_assembly::Assembler;
|
||||
use miden_stdlib::StdLibrary;
|
||||
use std::{env, fs, path::Path};
|
||||
use miden_core_lib::CoreLibrary;
|
||||
use std::{fs, path::Path};
|
||||
|
||||
/// Compiler for Miden assembly guest program.
|
||||
pub struct MidenAsm;
|
||||
@@ -34,11 +34,10 @@ impl Compiler for MidenAsm {
|
||||
})?;
|
||||
|
||||
// Compile using Miden assembler
|
||||
let mut assembler =
|
||||
Assembler::default().with_debug_mode(env::var_os("MIDEN_DEBUG").is_some());
|
||||
let mut assembler = Assembler::default();
|
||||
assembler
|
||||
.link_dynamic_library(StdLibrary::default())
|
||||
.map_err(Error::LoadStdLibrary)?;
|
||||
.link_dynamic_library(CoreLibrary::default())
|
||||
.map_err(Error::LoadCoreLibrary)?;
|
||||
|
||||
let program = assembler
|
||||
.assemble_program(&source)
|
||||
|
||||
@@ -8,13 +8,13 @@ use miden_core::{
|
||||
Program,
|
||||
utils::{Deserializable, Serializable},
|
||||
};
|
||||
use miden_core_lib::CoreLibrary;
|
||||
use miden_processor::{
|
||||
DefaultHost, ExecutionOptions, ProgramInfo, StackInputs, StackOutputs, execute as miden_execute,
|
||||
};
|
||||
use miden_prover::{
|
||||
AdviceInputs, ExecutionProof, HashFunction, ProvingOptions, prove as miden_prove,
|
||||
};
|
||||
use miden_stdlib::StdLibrary;
|
||||
use miden_verifier::verify as miden_verify;
|
||||
use std::{env, time::Instant};
|
||||
|
||||
@@ -48,7 +48,7 @@ impl EreMiden {
|
||||
fn setup_host() -> Result<DefaultHost, Error> {
|
||||
let mut host = DefaultHost::default();
|
||||
|
||||
host.load_library(&StdLibrary::default())
|
||||
host.load_library(&CoreLibrary::default())
|
||||
.map_err(Error::Execute)?;
|
||||
|
||||
Ok(host)
|
||||
|
||||
@@ -4,7 +4,7 @@ use ere_zkvm_interface::compiler::Compiler;
|
||||
use std::{env, path::Path};
|
||||
|
||||
const TARGET_TRIPLE: &str = "riscv32ima-unknown-none-elf";
|
||||
// According to https://github.com/brevis-network/pico/blob/v1.1.10/sdk/cli/src/build/build.rs#L104
|
||||
// According to https://github.com/brevis-network/pico/blob/v1.2.0/sdk/cli/src/build/build.rs#L104
|
||||
const RUSTFLAGS: &[&str] = &[
|
||||
// Replace atomic ops with nonatomic versions since the guest is single threaded.
|
||||
"-C",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copied and modified from https://github.com/brevis-network/pico/blob/v1.1.10/sdk/sdk/src/client.rs.
|
||||
// Copied and modified from https://github.com/brevis-network/pico/blob/v1.2.0/sdk/sdk/src/client.rs.
|
||||
// The `EmbedProver` is removed because we don't need the proof to be verified
|
||||
// on chain. Issue for tracking: https://github.com/eth-act/ere/issues/140.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user