Compiled interface¶
The compiled interface is the checked, final form of your block's interface.
The XCI compiler produces it from the XCI source during
xratu capability generate, and every later stage uses it: bake records it in
the block's capsule, inside the Xratu package, the catalog publishes it with the block, and the kernel checks
calls against it.
What compilation adds¶
The compiler checks the interface definition and adds three identity fields:
{
"interface_id": "acme.billing.Ledger",
"interface_version": "1.2",
"interface_hash": "xci-sha256:a5cb0b948204b50045fb7fada9a716fc25a6af6191087b9950911b9b219f03b6"
}
| Field | Built from |
|---|---|
interface_id |
The package and interface name, joined |
interface_version |
The version, as major.minor |
interface_hash |
The whole contract: every method, type, effect and retry declaration, resource and retired number |
An interface definition the compiler refuses gets no compiled form and no hash. Generation stops there with the reason.
Where it travels¶
- The interface seed. Generation stores the compiled interface in the block's interface seed, beside the manifest.
- The capsule. Bake carries it into the block's capsule, part of the Xratu package, and stamps the capsule's manifest and executable surface index with its hash.
- The catalog. Publishing keeps the compiled interface and its hash with the release, unchanged.
- The kernel. The kernel reads the compiled interface from the capsule and recomputes its hash before it runs anything. See Where the XCI compiler runs.
Where you see it¶
The interface id and hash are stamped at the top of every generated file, so you can tell which interface a generated file belongs to:
INTERFACE_ID = 'acme.billing.Ledger'
INTERFACE_HASH = 'xci-sha256:a5cb0b948204b50045fb7fada9a716fc25a6af6191087b9950911b9b219f03b6'
The same hash appears in the capsule manifest, in the executable surface index, and in every resolved runtime closure built for the block.