jcp: a chained decision enforces caveats, and a chain cannot drop one #300
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/jcp-chained-caveats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The defect
Runtime::decide_chainedevaluated no caveat at all: not the leaf's, and not any ancestor's.It is the decision path behind:
jcp/1wire endpoint (jcp-wire, SPEC §11)jcp-channeljouleclaw-jcpjoule-code-jcpAll of these present a chain, even a one-link chain for an undelegated grant. So
PayloadIs,NotBefore,NotAfter,CallerIs,ActionIn,MaxCostUjandModelInwere enforced only on the single-grantdecide/authorizepath. That path is the only one C24 exercises.Separately,
verify_chainchecked capability, budget, expiry and depth at each hop, but not caveat inheritance or the money ceiling.attenuaterefuses a child that drops a caveat or widens its money ceiling. A chain minted by hand, outsideattenuate, verified anyway and conveyed the authority the caveat withheld.The fix
verify_chain: refuses a hop that drops a parent caveat (caveats_narrow) or widens or drops its money ceiling (funds_narrows). Both are deniedattenuation-violation.check_chained: the chained decision's non-budget checks, moved into one function that now evaluates every link's caveats. Cost-dependent ones are evaluated when the cost is known.authorize_chained/charge_chained: the two-phase metered path for a chain.decide_chained.The mesh steward will use the two-phase chained path to accept delegated grants. That is the next PR.
Checked
On the build host:
gen-vectorswrites is byte-identical tojcp/conformance/v1.verify_chainallowing a dropped caveat (also fails C7)slice::from_refwarnings predate this change.🤖 Generated with Claude Code