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

Function agg_plan

crates/kernel/src/shard.rs:359–364  ·  view source on GitHub ↗

Lower the bisection tree to an arity-bounded fold plan. The binary tree is collapsed* so each agg call folds up to `arity` whole subtrees (never splitting a subtree across calls), keeping the agg-proof count ~`N/(arity-1)` — a strict binary fold would be ~`N` agg proofs, dominating cost. Children of each agg are emitted in shard order so the subject merkle-fold matches the guest's left-associative

(tree: &AggNode, arity: usize)

Source from the content-addressed store, hash-verified

357/// leaf proof; `Agg(children)` folds those slots' proofs in one agg call.
358#[derive(Clone, Debug, PartialEq, Eq)]
359pub enum FoldOp {
360 Leaf(u32),
361 Agg(Vec<usize>),
362}
363
364/// Lower the bisection tree to an arity-bounded fold plan. The binary tree is
365/// *collapsed* so each agg call folds up to `arity` whole subtrees (never
366/// splitting a subtree across calls), keeping the agg-proof count ~`N/(arity-1)`
367/// — a strict binary fold would be ~`N` agg proofs, dominating cost. Children of

Callers 3

run_shard_planFunction · 0.85

Calls 2

build_planFunction · 0.85
maxMethod · 0.45

Tested by 2