Skip to content
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
30 changes: 16 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bin/asm-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2024"
workspace = true

[dependencies]
moho-recursive-proof.workspace = true
moho-runtime-impl.workspace = true
moho-runtime-interface.workspace = true
moho-types.workspace = true
Expand All @@ -30,6 +31,7 @@ strata-identifiers.workspace = true
strata-merkle.workspace = true
strata-predicate.workspace = true
strata-tasks.workspace = true
tree_hash.workspace = true

anyhow.workspace = true
async-trait.workspace = true
Expand Down
10 changes: 7 additions & 3 deletions bin/asm-runner/src/block_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,13 @@ async fn submit_block(
debug!(%height, %hash, "submitted block to ASM worker");

if let Some(tx) = proof_tx {
let proof_id = ProofId::Asm(L1Range::single(commitment));
if let Err(err) = tx.send(proof_id) {
warn!(%height, %hash, ?err, "failed to enqueue proof request");
let asm_proof_id = ProofId::Asm(L1Range::single(commitment));
if let Err(err) = tx.send(asm_proof_id) {
warn!(%height, %hash, ?err, "failed to enqueue ASM proof request");
}
let moho_proof_id = ProofId::Moho(commitment);
if let Err(err) = tx.send(moho_proof_id) {
warn!(%height, %hash, ?err, "failed to enqueue Moho proof request");
}
}

Expand Down
27 changes: 19 additions & 8 deletions bin/asm-runner/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,36 @@ pub(crate) async fn bootstrap(
let proof_db_clone = proof_db.clone();

#[cfg(feature = "sp1")]
let host = {
let (asm, moho) = {
use std::fs;

use strata_asm_sp1_guest_builder::ASM_ELF_PATH;
use strata_asm_sp1_guest_builder::{ASM_ELF_PATH, MOHO_ELF_PATH};
use zkaleido_sp1_host::SP1Host;
let elf = fs::read(ASM_ELF_PATH)
let asm_elf = fs::read(ASM_ELF_PATH)
.unwrap_or_else(|err| panic!("failed to read guest elf at {ASM_ELF_PATH}: {err}"));
SP1Host::init(&elf)
let moho_elf = fs::read(MOHO_ELF_PATH)
.unwrap_or_else(|err| panic!("failed to read guest elf at {MOHO_ELF_PATH}: {err}"));
(SP1Host::init(&asm_elf), SP1Host::init(&moho_elf))
};

#[cfg(not(feature = "sp1"))]
let host = {
let (asm, moho) = {
use moho_recursive_proof::MohoRecursiveProgram;
use strata_asm_proof_impl::program::AsmStfProofProgram;
AsmStfProofProgram::native_host()
(
AsmStfProofProgram::native_host(),
MohoRecursiveProgram::native_host(),
)
};

let input_builder = InputBuilder::new(state_db.clone(), bitcoin_client.clone());
let input_builder = InputBuilder::new(
state_db.clone(),
bitcoin_client.clone(),
proof_db.clone(),
params.anchor.block,
);
let mut orchestrator =
ProofOrchestrator::new(proof_db, host, orch_config, input_builder, rx);
ProofOrchestrator::new(proof_db, asm, moho, orch_config, input_builder, rx);

// ZkVmRemoteProver is !Send (#[async_trait(?Send)]), so the orchestrator
// future cannot be spawned on a multi-threaded runtime directly. We run it
Expand Down
4 changes: 2 additions & 2 deletions bin/asm-runner/src/prover/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub(crate) struct OrchestratorConfig {
/// Interval between orchestrator ticks.
pub tick_interval: Duration,

/// Maximum number of concurrent ASM proof jobs in flight.
pub max_concurrent_asm_proofs: usize,
/// Maximum number of concurrent proof jobs in flight.
pub max_concurrent_proofs: usize,

/// Path to the proof database (SledProofDb).
pub proof_db_path: PathBuf,
Expand Down
Loading
Loading