JAR: Join-Accumulate Refine

14.2. Host Calls (§12.4)🔗

All 29 host-call handlers (REPLY at slot 0, protocol caps at slots 1–28) are dispatched by handleHostCall. Each protocol cap costs a base gas of 10. Operations include reading/writing service storage, transferring balance, managing preimages, and creating or upgrading services.

🔗def
Jar.Accumulation.hostCallGas : Nat
Jar.Accumulation.hostCallGas : Nat

Base gas cost for host calls: 10 gas.

🔗def
Jar.Accumulation.handleHostCall [Jar.JarConfig] (callId : Jar.JAVM.Reg) (gas : Jar.Gas) (regs : Jar.JAVM.Registers) (mem : Jar.JAVM.Memory) (ctx : AccContext) : Jar.JAVM.InvocationResult × AccContext
Jar.Accumulation.handleHostCall [Jar.JarConfig] (callId : Jar.JAVM.Reg) (gas : Jar.Gas) (regs : Jar.JAVM.Registers) (mem : Jar.JAVM.Memory) (ctx : AccContext) : Jar.JAVM.InvocationResult × AccContext

Dispatch a host call during accumulation (jar1 numbering). Match arms: REPLY=0, GAS=1, FETCH=2, ..., QUOTA=28. GP §12, Appendix B. Returns updated invocation result and context.