Overview
MetaProver processes proof messages from Caldera Metalayer’s router and records proven intents. It extends MessageBridgeProver to provide Metalayer-specific messaging functionality.
Contract: contracts/prover/MetaProver.sol
Inheritance: IMetalayerRecipient, MessageBridgeProver, Semver
Proof Type: "Meta"
In MetaProver documentation, “source” refers to the chain where the intent was created, and “destination” refers to the chain where the intent is fulfilled.
Constructor
Address of the local Metalayer router contract
Address of the Portal contract
Array of trusted prover addresses (as bytes32 for cross-VM compatibility)
Minimum gas limit for cross-chain messages. Defaults to 200,000 if zero.
MessengerContractCannotBeZeroAddress(): Router address is zeroZeroPortal(): Portal address is zero
contracts/prover/MetaProver.sol:58
State Variables
ROUTER
PROOF_TYPE
MIN_GAS_LIMIT
MessageBridgeProver. Defaults to 200,000.
ETH_QUOTE_VALUE
Core Functions
prove
MessageBridgeProver. Initiates proving process by dispatching a message via Metalayer.
Address that initiated the proving request (receives refund if overpaid)
Metalayer domain ID of the source chain (where the intent was created). NOT the chain ID.
Encoded (intentHash, claimant) pairs. Format:
[intentHash1][claimant1][intentHash2][claimant2]...ABI-encoded
UnpackedData struct containing:sourceChainProver(bytes32): Address of prover on source chaingasLimit(uint256): Gas limit for execution (min 200k)
- Calculates required fee via
fetchFee - Validates msg.value covers fee
- Dispatches message via Metalayer router
- Refunds excess payment to sender
InsufficientFee(uint256 required): msg.value is less than required feeDomainIdTooLarge(uint64 domainID): Domain ID exceeds uint32.max
MessageBridgeProver.sol:112
handle
Origin chain ID from the destination chain. Cannot be zero.
Address that dispatched the message on destination chain (as bytes32). Cannot be zero.
Encoded message with format:
[chainId (8 bytes)][intentHash1][claimant1][intentHash2][claimant2]...- Validates origin is not zero
- Validates sender is whitelisted
- Extracts chain ID from first 8 bytes of message
- Processes intent proofs using
_processIntentProofs
MessageOriginChainDomainIDCannotBeZero(): Origin is zeroMessageSenderCannotBeZeroAddress(): Sender is zeroUnauthorizedIncomingProof(bytes32 sender): Sender not whitelisted
contracts/prover/MetaProver.sol:77
fetchFee
Metalayer domain ID of the source chain
Encoded (intentHash, claimant) pairs
ABI-encoded UnpackedData struct
contracts/prover/MetaProver.sol:158
getProofType
"Meta"
Internal Functions
_dispatchMessage
prove() function.
Behavior:
- Unpacks data into structured format (enforces min gas limit)
- Formats Metalayer message parameters
- Calls
ROUTER.dispatchwith:- Empty ReadOperation array
- FinalityState.INSTANT
- Configured gas limit
contracts/prover/MetaProver.sol:118
_fetchFee
- Formats Metalayer message
- Creates custom hook metadata with actual gas limit (min 200k)
- Queries router for fee estimate via
quoteDispatch
contracts/prover/MetaProver.sol:175
_formatMetalayerMessage
domain(uint32): Metalayer domain IDrecipient(bytes32): Source chain prover addressmessage(bytes): Encoded proofs
contracts/prover/MetaProver.sol:224
_unpackData
- Decodes ABI-encoded UnpackedData
- If gasLimit < MIN_GAS_LIMIT, sets to MIN_GAS_LIMIT
contracts/prover/MetaProver.sol:99
Data Structures
UnpackedData
data parameter. Gas limit is enforced to be at least MIN_GAS_LIMIT (200k).
Usage Example
Finality State
MetaProver usesFinalityState.INSTANT for all message dispatches, providing the fastest possible message delivery.