Skip to main content

Module cross_contract

Module cross_contract 

Source
Expand description

Cross-contract calls: a circuit that calls a circuit of another deployed contract.

The caller’s IR names the callee’s contract type and circuit; the callee’s code and deployed state come from the host, which binds each address it is asked about to a CalleeContract. Execution follows compact-runtime 0.21’s crossContractCall: the callee runs against its deployed state with no witnesses of its own, and the caller records the callee’s result and a fresh communication commitment randomness as private transcript outputs, then claims the call through kernel.claimContractCall.

The interpreter is synchronous and the callee’s state lives on chain, so a run that reaches an address the session has no binding for stops with CallTreeOutcome::CalleeRequired. The host binds it and runs again. Witness results from earlier runs are replayed, so the host’s witnesses fire once per call site across all runs, as they would in a single run.

Structs§

CallTreeResult
A completed call tree.
CallTreeRun
Per-run bookkeeping the interpreter threads through every frame of a call tree.
CalleeCall
One call to a callee circuit made while executing a call tree.
CalleeContract
The code deployed at a callee address and its deployed state.
CrossContractSession
The state a call tree keeps between runs: the callees bound so far and the witness results already observed.

Enums§

CallTreeOutcome
The outcome of one run of a call tree.