On-Chain Miner Requests (removed)
This rail no longer exists.
SubnetFacetwas deleted from the Diamond, and with itoutboundSubnetMessage, theSubnetRequestOutandSubnetResponseInevents,getSubnetRequestandexecuteInboundSubnetMessage. Every on-chain request is now a job. Use On-Chain Jobs.
If you are reading this because a contract of yours calls outboundSubnetMessage, it will revert on a current deployment. Here is what to change.
What was different, and what it is now
| Old miner request | Job (now) | |
|---|---|---|
| Entry point | outboundSubnetMessage(subnetId, endpoint, params, callback) | createJob, createJobCapped, createJobAndPay or createJobForMiner |
| You target | a miner id and an endpoint keyword | an intent (bytes32 hash of its canonical name) |
| Cost | gas only | USDC, from escrow or paid in the same call |
| Concurrency | one outstanding request protocol-wide | many jobs in flight at once |
| Callback | mandatory | optional |
| Request layout | the miner's YAML on_chain.request block | the intent's layout, the same for every miner |
| Answer layout | the miner's YAML on_chain.fields block | the intent's processed answer, the same for every miner |
| Failure | callback called with success = false | the quorum fails the job, you are refunded, callback called with success = false |
Moving a contract over
- Pick an intent instead of a miner. Find the intent your old miner served, for example from
GET /engine/v1/intents/{intent}/miners. The intent id iskeccak256of its canonical name. - Read the intent's layout.
GET /engine/v1/intents/{intent}returnsonchain.request(where each input goes) andonchain.response(where each answer field arrives). You no longer read a miner's YAML. - Pay for it. Fund escrow and use
createJobCapped, or approve the Diamond and usecreateJobAndPay. - Keep your callback, change what it reads. The function is still
subnetMessage(uint256,bool,OnChainData,string).successis now meaningful:falsemeans the job failed and you were refunded. Read the answer by the intent's layout. - Pin a miner if you must.
createJobForMiner(intentId, miner, ...)tries one registration first and falls back to the intent's ranked miners, so a single miner outage does not fail your job.
Everything is explained step by step, with the reverts you may hit, in On-Chain Jobs.
A note on the subnet names
The callback keeps its legacy name, subnetMessage, and your callback contract may still implement ISubnetReceiverContract. Only the request side was removed. What subnet addresses is a miner, as everywhere else in the API.
Was this helpful?