You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inventory planner: halving the largest record can reject a reachable target #83
The split loop in sdk/python/aleo/inventory/planner.py always halves the largest remaining record (usable // outputs_needed). In preserve mode this can reject a target that is reachable with a capacity-aware split:
Token amounts [9, 3], records=4, min_record_amount=3: the planner splits 9 into [4, 5], then tries [2, 3] and raises InventoryPlanError; [3, 6] followed by [3, 3] succeeds.
Credits: 20,003 microcredits can fund two 10,000 deductions and three outputs of 1, but the first halving leaves neither output able to fund the second split.
The loop is a line-for-line port of Veil's planner (packages/core/src/inventory/planner.ts), and the planner tests are Veil's known answers, so the fix should land in both SDKs together to keep plans identical for the same inventory. Choose split amounts that retain enough value for the remaining outputs and deductions, and add both cases to the planner tests.
Fixed on the PR #82 branch: the split now cuts whole lots when halving would strand value below the minimum. Both cases from this issue are planner tests. Veil's planner still halves unconditionally; a matching change there would keep the two SDKs' plans identical.
Activity
fix: split whole lots when halving would strand value below the minimum
iamalwaysuncomfortable commentedon Oct 23, 2026
Fixed on the PR #82 branch: the split now cuts whole lots when halving would strand value below the minimum. Both cases from this issue are planner tests. Veil's planner still halves unconditionally; a matching change there would keep the two SDKs' plans identical.