MCPcopy Create free account
hub / github.com/argumentcomputer/ix / main

Function main

zisk/host/src/main.rs:1609–1955  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1607 Op::NovelLeaf(id) => {
1608 let i = id_to_idx[id]; // present by construction (tree pruned)
1609 slot_proof.push(leaf_proofs[i].clone());
1610 slot_subj.push(leaf_subject_sets[i].clone());
1611 slot_asm.push(leaf_assumption_sets[i].clone());
1612 },
1613 Op::Stored(k) => {
1614 let p = covering[*k];
1615 slot_proof.push(p.blob.clone());
1616 slot_subj.push(p.subjects.clone());
1617 slot_asm.push(p.assumptions.clone());
1618 },
1619 Op::Agg(children) => {
1620 let proofs: Vec<Vec<u8>> =
1621 children.iter().map(|&c| slot_proof[c].clone()).collect();
1622 // Mode-1 witness: each child's subject/assumption preimages, in
1623 // the same order as `proofs`. The guest verifies them against the
1624 // children's committed roots, so they are untrusted inputs here.
1625 let witness: Vec<(Vec<u8>, Vec<u8>)> = children
1626 .iter()
1627 .map(|&c| {
1628 (Address::pack(&slot_subj[c]), Address::pack(&slot_asm[c]))
1629 })
1630 .collect();
1631 let allowed = distinct_vks(&proofs);
1632 let astart = Instant::now();
1633 let result = client
1634 .prove(&AGG_PROGRAM, agg_stdin(&allowed, &proofs, Some(&witness)))
1635 .run()?
1636 .await?;
1637 total_agg_ms += result.get_proving_time();
1638 let (union_s, outstanding) = discharge(
1639 &children
1640 .iter()
1641 .map(|&c| slot_subj[c].as_slice())
1642 .collect::<Vec<_>>(),
1643 &children
1644 .iter()
1645 .map(|&c| slot_asm[c].as_slice())
1646 .collect::<Vec<_>>(),
1647 );
1648 println!(
1649 " agg {} → prove {:.2}s (wall {:.2}s); subjects {} assumptions {} → outstanding {}",
1650 proofs.len(),
1651 result.get_proving_time() as f64 / 1000.0,
1652 astart.elapsed().as_secs_f64(),
1653 union_s.len(),
1654 children.iter().map(|&c| slot_asm[c].len()).sum::<usize>(),
1655 outstanding.len(),
1656 );
1657 slot_proof.push(result.get_proof_bytes()?);
1658 slot_subj.push(union_s);
1659 slot_asm.push(outstanding);
1660 root_result = Some(result);
1661 },
1662 }
1663 }
1664 let root = root_result.expect("tree fold produced a root agg");
1665 let final_size = root.get_proof_bytes()?.len();
1666 let mut fbuf = [0u8; SHARD_PUBLICS_LEN];

Callers

nothing calls this directly

Calls 15

plan_inputFunction · 0.85
load_proof_indexFunction · 0.85
check_inputs_closedFunction · 0.85
build_clientFunction · 0.85
run_shard_planFunction · 0.85
run_constantFunction · 0.85
leaf_stdinFunction · 0.85
check_input_coherenceFunction · 0.85
tree_partitionFunction · 0.85
distinct_vksFunction · 0.85
agg_stdinFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected