Function: calculateManualExecProof()
calculateManualExecProof<
V>(messagesInBatch: readonlyCCIPMessage<V>[],lane:Lane<V>,messageId:string,merkleRoot?:string,ctx?:WithLogger): {merkleRoot:string;proofFlagBits:bigint;proofs:string[]; }
Defined in: execution.ts:54
Pure/sync function to calculate/generate OffRamp.executeManually report for messageIds
Type Parameters
| Type Parameter | Default type |
|---|---|
V extends CCIPVersion | CCIPVersion |
Parameters
| Parameter | Type | Description |
|---|---|---|
messagesInBatch | readonly CCIPMessage<V>[] | Array containing all messages in batch, ordered |
lane | Lane<V> | Arguments for leafHasher (lane info) |
messageId | string | Message ID to prove for manual execution |
merkleRoot? | string | Optional merkleRoot of the CommitReport, for validation |
ctx? | WithLogger | Context for logging |
Returns
{ merkleRoot: string; proofFlagBits: bigint; proofs: string[]; }
ManualExec report arguments
merkleRoot
merkleRoot:
string
proofFlagBits
proofFlagBits:
bigint
proofs
proofs:
string[] =proof.hashes
Throws
CCIPMessageNotInBatchError - When the messageId is not found in the provided batch
Throws
CCIPMerkleRootMismatchError - When calculated merkle root doesn't match the provided one
Remarks
This is a pure/sync function that performs no I/O - all data must be pre-fetched. It builds a merkle tree from the messages, generates a proof for the target messageId, and optionally validates against the provided merkleRoot.
The returned proof can be used with execute to manually execute a stuck message.
Example
import { calculateManualExecProof, EVMChain } from '@chainlink/ccip-sdk'
// Fetch the request and all messages in its batch
const request = (await source.getMessagesInTx(txHash))[0]
const verifications = await dest.getVerifications({ offRamp, request })
const messages = await source.getMessagesInBatch(request, commit.report)
// Calculate proof for manual execution
const proof = calculateManualExecProof(
messages,
request.lane,
request.message.messageId,
commit.report.merkleRoot
)
console.log('Merkle root:', proof.merkleRoot)
console.log('Proofs:', proof.proofs)
See
- discoverOffRamp - Find the OffRamp for manual execution
- execute - Execute the report on destination chain
- generateUnsignedExecute - Build unsigned execution tx