Skip to main content
Version: 0.96.0

Function: calculateManualExecProof()

calculateManualExecProof<V>(messagesInBatch: readonly CCIPMessage<V>[], lane: Lane<V>, messageId: string, merkleRoot?: string, ctx?: WithLogger): Omit<ExecutionReport, "offchainTokenData" | "message">

Defined in: execution.ts:64

Pure/sync function to calculate/generate OffRamp.executeManually report for messageIds

Type Parameters

Type ParameterDefault type
V extends CCIPVersionCCIPVersion

Parameters

ParameterTypeDescription
messagesInBatchreadonly CCIPMessage<V>[]Array containing all messages in batch, ordered
laneLane<V>Arguments for leafHasher (lane info)
messageIdstringMessage ID to prove for manual execution
merkleRoot?stringOptional merkleRoot of the CommitReport, for validation
ctx?WithLoggerContext for logging

Returns

Omit<ExecutionReport, "offchainTokenData" | "message">

ManualExec report arguments

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 executeReport to manually execute a stuck message.

Example

TypeScript
import { calculateManualExecProof, EVMChain } from '@chainlink/ccip-sdk'

// Fetch the request and all messages in its batch
const request = (await source.getMessagesInTx(txHash))[0]
const commit = await dest.getCommitReport({ commitStore, 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
  • executeReport - Execute the report on destination chain
  • generateUnsignedExecuteReport - Build unsigned execution tx