Errors

The program defines 23 errors, numbered from 6000. A failed transaction's logs carry the number in hex as custom program error: 0x… on the line where the voynich program fails.

NameCodeHexMessageRaised when
Unauthorized60000x1770Only the configured authority may perform this action.The signer is not the one the account names: the Config's admin, the program's upgrade authority, the model's owner, the model's upload key or the enclave's signing key.
InvalidConfig60010x1771Protocol configuration is invalid.A Config value is out of range: a default address for the attestation program or fee recipient, layout version 0, a protocol share above 10,000, a deadline of 0 slots. In open_call: the model's operator share plus the protocol share exceeds 10,000.
InvalidModel60020x1772Model metadata or cipher format is invalid.In create_model: a name that is empty, longer than 32 bytes or not lowercase groups joined by hyphens; an empty manifest or one above 4,096 bytes; a size of 16 bytes or less; an unknown cipher id; no measurement or more than 8; an upload key that is the owner, holds data or is not system-owned. In create_model and set_price: operator share plus protocol share above 10,000.
ModelNotUploading60030x1773The model is not uploading.write_weights or seal_model on a model that is already sealed.
ModelNotSealed60040x1774Seal the model before granting it.grant_by_owner on a model that is Uploading or Retired.
ModelNotLive60050x1775The model does not accept new calls.open_call or grant_by_enclave on a model that is not Live.
InvalidWeights60060x1776The weights accounts do not match the model.In create_model: no Weights account or more than 8; one that is not owned by the program, not writable, not rent-exempt, listed twice, larger than 10 MiB, or whose first 56 bytes are not zero; sizes that do not add up to size_bytes. In write_weights and seal_model: an account that is not the model's, or not in the model's order.
InvalidWrite60070x1777The upload has a gap or an out-of-range write.In write_weights: no bytes, or an end past the account's size.
UploadIncomplete60080x1778Every weights byte must be written before sealing.seal_model while a Weights account has not been written to its end.
CiphertextHashMismatch60090x1779The ciphertext hash does not match.seal_model with a hash that is not the SHA-256 of the bytes on chain.
InvalidAttestation60100x177aThe attestation record is invalid or expired.The attestation record is not owned by the configured attestation program, is not at the address derived from the signing key, has another layout, names another key, or is expired at the current slot.
MeasurementNotAllowed60110x177bThe enclave measurement is not allowed by this model.The enclave's measurement is not in the model's allowed measurements.
InvalidEnclave60120x177cThe enclave registration does not match its attestation.In register_enclave and refresh_enclave: an endpoint that is empty, above 256 bytes or not http:// or https://; an all-zero encryption key. In grants and calls: a record account that is not the one the Enclave names, or whose hardware type or measurement differs from the Enclave's. In grant_by_enclave: source and target are the same enclave.
InvalidWrappedKey60130x177dThe wrapped key must be a version 1 envelope of 105 bytes.A wrapped key that is not 105 bytes or does not start with version byte 1.
GrantRequired60140x177eThe enclave does not hold an active grant.open_call on a revoked grant, or grant_by_enclave from an enclave whose own grant is revoked.
CallNotOpen60150x177fThe call has already settled or been refunded.settle_call or refund_call on a call that already settled or was refunded.
CallDeadlinePassed60160x1780The call settlement deadline has passed.settle_call after the call's deadline slot.
CallNotRefundable60170x1781The call deadline has not passed.refund_call at or before the call's deadline slot.
InvalidSignature60180x1782The required Ed25519 verification instruction is missing or does not match.In settle_call: the Ed25519 instruction at the given index is missing, or does not carry this signature, the enclave's signing key and the receipt message.
InvalidTokenAccount60190x1783The escrow mint or token accounts are invalid.A token account, mint or token program is missing for a price in a mint, has the wrong owner or mint, or is not the associated token account where one is required.
InvalidRecipient60200x1784A payment recipient does not match the call snapshot.In settle_call and refund_call: the caller, owner, operator or fee recipient passed is not the one recorded in the call.
InsufficientEscrow60210x1785The escrow cannot cover the requested payment.The call's escrow holds less than its price.
ArithmeticOverflow60220x1786An arithmetic limit was exceeded.A slot or counter passed the 64-bit limit.

Errors from Anchor#

Some refusals come from Anchor's own account checks and carry Anchor's numbers:

CodeNameRaised when
2001ConstraintHasOneA Grant passed to revoke_grant or open_call belongs to another model or enclave, or a Call passed to settle_call names another model or enclave.
2006ConstraintSeedsAn account is not at the address its seeds give.
2012ConstraintAddressThe Instructions sysvar or a program account is not the expected one.
3012AccountNotInitializedA Model, Enclave, Grant or Call passed does not exist.

Creating an account that already exists (a model name that is taken, an enclave already registered, a call nonce used before, a call already settled) fails in the System program with custom program error: 0x0.

Through the API#

When a transaction built by the API is refused by the program, the API's error names the program error in programError: the program's address, the error's name and its number. Which API code each program error arrives under is in HTTP API: Transactions.