IMetalayerRecipient interface to receive messages from the Metalayer router.
Contract Overview
Location:contracts/prover/MetaProver.sol
contracts/prover/MetaProver.sol
Constructor
FromMetaProver.sol:58-67:
contracts/prover/MetaProver.sol
Parameters
address
Address of the local Metalayer router contract
address
Address of the Portal contract that manages rewards
bytes32[]
Array of trusted prover addresses on other chains (as bytes32 for cross-VM compatibility)
uint256
Minimum gas limit for cross-chain messages. Defaults to 200,000 if zero.
Prove Function
Inherited fromMessageBridgeProver.sol:112-117:
contracts/prover/MessageBridgeProver.sol
Data Parameter Structure
Thedata parameter must be ABI-encoded as an UnpackedData struct (from MetaProver.sol:29-32):
contracts/prover/MetaProver.sol
Gas limits below
MIN_GAS_LIMIT (200,000) are automatically increased to the minimum (from MetaProver.sol:105-107).Message Dispatch
Internal dispatch implementation fromMetaProver.sol:118-147:
contracts/prover/MetaProver.sol
Message Formatting
FromMetaProver.sol:224-243:
contracts/prover/MetaProver.sol
Message Reception
FromMetaProver.sol:77-91:
contracts/prover/MetaProver.sol
handle() function:
- Validates call is from the Metalayer router
- Validates origin domain ID is non-zero
- Validates sender address is non-zero
- Checks sender is whitelisted
- Extracts chain ID from message prefix
- Processes intent proofs
Fee Calculation
FromMetaProver.sol:158-165:
contracts/prover/MetaProver.sol
MetaProver.sol:175-205):
contracts/prover/MetaProver.sol
The contract uses a very high ETH quote value (1e36) in fee calculation metadata to avoid failures in the Metalayer router’s quote dispatch function (from
MetaProver.sol:44).Usage Example
Domain ID Reference
Finality States
Metalayer supports different finality states (fromMetaProver.sol:144):
contracts/prover/MetaProver.sol
INSTANT- Fastest, lowest securitySAFE- Balanced security and speedFINALIZED- Highest security, slower
Security Considerations
Whitelist Validation
Only whitelisted prover addresses can send proof messages. This is validated in_handleCrossChainMessage() from MessageBridgeProver.sol:81-82:
contracts/prover/MessageBridgeProver.sol
Gas Limit Enforcement
The contract enforces a minimum gas limit (fromMetaProver.sol:105-107):
contracts/prover/MetaProver.sol
Fee Quote Metadata
The contract uses accurate gas limits in fee calculation to ensure proper fee estimation (fromMetaProver.sol:151-156 comments):
contracts/prover/MetaProver.sol
Related Contracts
- BaseProver - Base proving functionality
- MessageBridgeProver - Message bridge base contract
- Inbox - Intent fulfillment and proving